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

EIP-838 Error Codes #4235

Closed
TomiOhl opened this issue Aug 13, 2021 · 19 comments
Closed

EIP-838 Error Codes #4235

TomiOhl opened this issue Aug 13, 2021 · 19 comments
Assignees
Labels

Comments

@TomiOhl
Copy link

TomiOhl commented Aug 13, 2021

Expected behavior

It would be nice to be able to get the new, custom error codes with their arguments, introduced in Solidity 0.8.4.
Ethers.js already supports them: https://github.com/shapeshift/ethers.js/blob/master/packages/tests/src.ts/test-contract-interface.ts#L636

Actual behavior

If I try to catch the error as in the link above, I get the following error message:
Error: Returned error: VM Exception while processing transaction: revert
Error code, error name, etc. are all undefined

Steps to reproduce the behavior

  1. Send a transaction to a contract that will revert with errors
  2. Try to catch the error

Environment

Web3.js v1.5.1
Node v12.18.4
elementary OS 5.1.7

@philknows
Copy link

This will be addressed in the 4.x rewrite.

@philknows philknows added the 4.x 4.0 related label Aug 31, 2021
@nazarhussain nazarhussain self-assigned this Sep 1, 2021
@frangio
Copy link

frangio commented Sep 2, 2021

@philknows Is there a timeline for that? 🙂

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Nov 2, 2021
@frangio
Copy link

frangio commented Nov 2, 2021

Still important. OpenZeppelin Contracts is blocked from adopting custom errors until Web3.js supports them.

@github-actions github-actions bot removed the Stale Has not received enough activity label Nov 3, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Jan 15, 2022
@frangio
Copy link

frangio commented Jan 15, 2022

Not stale! Waiting patiently. 😁

@github-actions github-actions bot removed the Stale Has not received enough activity label Jan 16, 2022
@TomiOhl
Copy link
Author

TomiOhl commented Feb 8, 2022

@philknows Is there a timeline for that? slightly_smiling_face

Seems like they plan to release version 4.x in April: RELEASE.md#long-term-support-lts

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Apr 10, 2022
@TomiOhl
Copy link
Author

TomiOhl commented Apr 10, 2022

gm. Dear bot remove the stale label. 😃

@github-actions github-actions bot removed the Stale Has not received enough activity label Apr 11, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Jun 10, 2022
@AyoAlfonso
Copy link

@TomiOhl is this issue still active

@TomiOhl
Copy link
Author

TomiOhl commented Jun 19, 2022

Yes, it very much is.Haven't tried the one on the 4.x branch yet, but it isn't addressed in the latest 1.x release afaik

@github-actions github-actions bot removed the Stale Has not received enough activity label Jun 20, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Aug 19, 2022
@TomiOhl
Copy link
Author

TomiOhl commented Aug 19, 2022

Well, 4.x definitely wasn't released in April. Waiting

@github-actions github-actions bot removed the Stale Has not received enough activity label Aug 20, 2022
@mconnelly8
Copy link

Hey @TomiOhl, we recently released 4.x Alpha last week. Still working diligently now on our Beta release for later this year.

@CruzMolina
Copy link
Contributor

Please @Muhammad-Altabba 🙏🙏🙏

@Muhammad-Altabba
Copy link
Contributor

Sorry I got busy with other tasks and was also sick for a couple of days 🥲 . However, I will start working on it very soon 😊...
And nice to see you here @CruzMolina 💐

@DinizSa
Copy link

DinizSa commented Apr 26, 2023

Any progress on this?
Just deployed a set of contracts in mumbai & polygon using 100% custom errors, and when a transaction fails I can only see "Fail".
These opaque error messages makes the debugging process harder and slower.
Any alternative or advice please?

@TomiOhl
Copy link
Author

TomiOhl commented Apr 26, 2023

Any progress on this? Just deployed a set of contracts in mumbai & polygon using 100% custom errors, and when a transaction fails I can only see "Fail". These opaque error messages makes the debugging process harder and slower. Any alternative or advice please?

  • wait and eventually web3.js 4.0 will be released with support for these custom errors (rc 1 was released last week)
  • or switch to something else:
    • for any other use case than smart contract tests, use ethers.js
    • if you're using web3.js because of truffle, switch to hardhat or foundry/forge
    • if you're using truffle and don't want to switch, use this helper package: https://www.npmjs.com/package/custom-error-test-helper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants