Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cast run does not decode custom error signature #8348

Closed
dcb9 opened this issue Jul 4, 2024 · 5 comments
Closed

bug: cast run does not decode custom error signature #8348

dcb9 opened this issue Jul 4, 2024 · 5 comments
Labels
C-cast Command: cast T-bug Type: bug T-to-reproduce Type: requires reproduction
Milestone

Comments

@dcb9
Copy link
Contributor

dcb9 commented Jul 4, 2024

Component

Cast

Describe the feature you would like

When I run cast run -v txhash, the custom error has not been decoded.

Executing previous transactions from the block.
Traces:
  [13566] 
   ... ... 
    ├─ [8580] 
     ... ... 
    │   └─ ← [Revert] custom error 0x245aecd3:
    └─ ← [Revert] custom error 0x245aecd3:

It would be nice if the output is something like this

Executing previous transactions from the block.
Traces:
  [13566] 
   ... ... 
    ├─ [8580] 
     ... ... 
    │   └─ ← [Revert] custom error 0x245aecd3 NotOwner(address): 
    └─ ← [Revert] custom error 0x245aecd3 NotOwner(address):

Additional context

No response

@dcb9 dcb9 added the T-feature Type: feature label Jul 4, 2024
@zerosnacks zerosnacks added T-bug Type: bug and removed T-feature Type: feature labels Jul 16, 2024
@zerosnacks zerosnacks changed the title cast run does not decode custom error signature bug: cast run does not decode custom error signature Jul 16, 2024
@zerosnacks zerosnacks added the T-to-reproduce Type: requires reproduction label Jul 16, 2024
@zerosnacks
Copy link
Member

Hi @dcb9 thanks for your report, could you please share a relevant transaction hash that reproduces this?

@zerosnacks zerosnacks added the C-cast Command: cast label Jul 16, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@jenpaff

This comment was marked as outdated.

@jenpaff

This comment was marked as outdated.

@DaniPopes
Copy link
Member

If the contract is verified on Etherscan we fetch its ABI, which includes custom errors:

$ cast run -r $MAINNET --quick 0x1b30ce1abee78ce2728ee96903366c45162fd1da72bbcd933514d463426e4c27
Traces:
  [3020] MerkleDistributorWithDeadline::claim(17808 [1.78e4], 0x2bfAAD9dF86e309a65f0fe282378cCC86393de75, 27495548672456482820 [2.749e19], [0xfe4e6d61286c7a04ea318886e3358bc22937aa5722b604771bd45c62038ec927, 0xced8ad1e05f1005d8a76e65b173fcba7dc3c58622eec8e7fd5fcbc7ae4ea363a, 0x99e8efa82d1ba5267f5ad7eead97f058bb65407f1f056f17fef23693542d7145, 0x0d00c03b132e25d1e3db9a92f91ddd537bb46fdebb1752ec1c7e199fbb4266a4, 0xa834fb7d3afbe2c31db51c37cb575da91d5a2482fa73ef9a67c6cc405fcd4b9d, 0xe6917a0941ee9f58d9f1de7dc3c0009629dfe4fcc2ed1a399996e48be52e8f20, 0x8e45cd00cf19524b8cd0683f93cee4a66ae00917d3f50b983e07750c011ff2c3, 0x14ab743afc04495af5c8d67698fb59ba6f5ad19ab9ff0e393008d308458f3f9a, 0x8d126b77dc1b6cf80c9f49d8900df3ec7b60f3c1e55c81f5bd21ef526a2e3477, 0xa028e9a51898890a687b82ba9556efbc6ff06eee5e9a9790ca9d436299204734, 0xbf5ad00f75c35b0db11421bf517e2e411f2ed58f82dfecd0a82f9b5c8a45f376, 0x66b6295c047f6901661bcb743229aa18d639e15a9f1fd6d6b1ef840232d23755, 0x7a7fe8ade7ebfe7560c1d76c59517e3cc799d4d9a07c88917f9ea36665820951, 0x527261410b3980df7eaa6f617fa1336aea50df4d424e8517ae7e00f312c6b765, 0x2ac952f98bace032016eba15d15b3b82b8bd9dcc54a1340fa3fa43345003c38d])
    └─ ← [Revert] AlreadyClaimed()

@zerosnacks
Copy link
Member

Per @DaniPopes's reply, if the contract is verified on Etherscan the custom errors should resolve automatically. Marking as resolved.

@dcb9 if you are still able to reproduce this error would you mind leaving a comment / re-opening the ticket with a minimal reproduction? That would help us narrow the edge case down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-bug Type: bug T-to-reproduce Type: requires reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants