2

I noticed that reverted transactions on Kovan don't include the revert reason. I'm getting the generic "Reverted"/ "VM execution error."

Is Koval special in this regard? I know that Ethereum Mainnet includes the reason in the "message" response of the JSON-RPC call.

1 Answer 1

5

No, not all Ethereum networks return the revert reason in the message field. Kovan is an exception.

As per the Infura documentation:

On Mainnet, Rinkeby, Ropsten and Goerli, if this call causes the EVM to execute a REVERT operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:

{
 "jsonrpc": "2.0",
 "id": 1,
 "error": {
   "code": 3,
   "message": "execution reverted: Dai/insufficient-balance",
   "data": "0x08c3..."
 }
}

On Kovan, the actual revert reason is instead returned encoded as part of the data field in the response.

{
 "jsonrpc": "2.0",
 "id": 1,
 "error": {
   "code": -32015,
   "data": "Reverted 0x08c3...",
   "message": "VM execution error."
 }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.