Replies: 1 comment 1 reply
-
If the node includes the revert reason, ethers.js should display that in the error. You can try the following const provider = new StaticJsonRpcProvider('https://data-seed-prebsc-1-s1.binance.org:8545/')
const tx = await provider.getTransaction('0x42bb7f43c4258ebd805d14367bfbc7b8214e2ff752b0a8bf57816d0eb414a0fd')
const result = await provider.call(tx, tx.blockNumber)
const iface = new Interface(['function Error(string)']);
const decodedError = iface.decodeFunctionData(result.slice(0,10), result) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Assume contractInstance.methodName(methodArgs) fails due to a require statement. What I want is the error message of that require statement.
I want the status message of the following image.

Error received:
Any help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions