foundry icon indicating copy to clipboard operation
foundry copied to clipboard

bug(`cast`): revert reason is not printed upon failed execution

Open cuiweixie opened this issue 6 months ago • 0 comments

Component

Cast

Describe the feature you would like

➜  foundry_test git:(master) ✗ cast send 0x5FbDB2315678afecb367f032d93F642f64180aa3  "customError()" --private-key $PK
Error:
server returned an error response: error code 3: execution reverted:

cast send result in execution revert with out reason(data) is hard to debug.

old version of cast send result would be like:

(code: 3, message: execution reverted: CustomError3333, data: Some(String("0x8d6ea8be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f437573746f6d4572726f72333333330000000000000000000000000000000000"))) 

it's good to make cast send print data like "0x8d6ea8be...".

Additional context

it's good to make cast send print data like "0x8d6ea8be...".

cuiweixie avatar Aug 05 '24 16:08 cuiweixie