iotex-core
iotex-core copied to clipboard
[ Web3 API ] Custom Errors are not correctly returned
What version of iotex-core image (or code branch) are you using?
N/A
What operating system and processor architecture are you using?
Mac M1
What did you do? If possible, provide a recipe for reproducing the error.
Unzip hardhat-starter.zip
cd hardhat-starter
echo PRIVATE_KEY=[YOUR IOTEX DEV ACCOUNT] > .env
npm install
npx hardhat run scripts/deploy_and_reproduce.ts --network iotex_testnet
What did you expect to see?
Custom Errors have been introduced in Solidity 0.8.4. The script execution deploys a contract that reverts with a custom error and it should catch and log the custom error with its data.
What did you see instead?
The script is failing with a Provider Error: "ProviderError: execution simulation failed: status = 106"
Run npx hardhat run scripts/deploy_and_reproduce.ts
to see the correct behavior in the local Hardhat VM
This bug cause by eth_estimategas
api doesn't return correct error data.
This bug cause by
eth_estimategas
api doesn't return correct error data.
There are two bugs here, in addition to this, there is one eth_call will be returned as a normal call(revert reason was no caught), not return custom error with its data, fix it later
This bug cause by
eth_estimategas
api doesn't return correct error data.
@ququzone I tested 'eth_estimategas' with ganache and it also return 'revert' message, Can you confirm it's a bug and need to fix?