I can see the error message on Etherscan.
But I can't find it in
Is there any special settings that I need set in my Genesis.json before I can see it?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
Yes you can! I made an NPM package to help with this: eth-revert-reason. You can use that package to get the revert reason from a transaction with just the hash!
It is hard to decode the revert reason in a generalized manner. Many different factors, such as web3.js vs. ethers, Geth vs. Parity, etc. will result in different results for all the answers posted here. Some issues are:
In a happy-path case, the code to retrieve the revert reason is:
const provider = customProvider || ethers.getDefaultProvider(network) const tx = await provider.getTransaction(txHash) const code = await provider.call(tx)
While the code to generate the revert reason in the normal case is simple, the non-happy-path cases are surprisingly difficult to handle, however this package attempts to appease this.