1

The only information I get from etherscan.io https://goerli.etherscan.io/tx/0xe5d61850c7eb76509d0eaa5ec83e2d67fb43db8ff544f0cfbe184d991dff3617

is "Warning! Error encountered during contract execution [execution reverted]" The method that initiates the transaction works on the local Ganache network. I only see the error on the on the Goerli Testnet.

Is there a way I can get more specific information about the error that caused the transaction to be rolled back?

1 Answer 1

1

One wysiwyg way to debug transactions is by using https://tenderly.co/

It will be much easier if you either verify the contract or (if solidity) add the code to your project so that the debugger can step through it.

Not having the code I can't see the line, but can see it is an underflow or overflow during a call to a contract. trying to move a token without the allowance or spend a balance without a msg.value?
I don't know but maybe you do where you have more context.

The 4 byte sig is "decideWinner(address)", and you are only sending an address, so you could take a look at that function and see what could be throwing in its logic.

"[OPCODE]":"CALL"
"from":{
  "address":"0x3b10f9d3773172f2f74bb1bb8efbcf18626b3be8"
  "balance":"19999999767767636"
}
"to":{
  "address":"0x2afad85f58755098c6ec1faa8415425eafbd0db1"
  "balance":"3667325291503049"
}
"value":"0"
"[INPUT]":"0xda8e303b000000000000000000000000436907c2b327333560cd78ab2d83e26918c34f7f"
"[OUTPUT]":"0x"
"[ERROR]":"panic: arithmetic overflow / underflow"
4
  • Thank you. I am doing simple arithmetic in that function (division, addition, and subtraction), and I have been able to reproduce the reversion in ganache. My js truffle tests are passing, but my application logic uses web3.py. It's a bit confusing. I have a feeling the values I'm sending to my contract when I'm building my transactions in Python are causing the error. Thanks again! Commented Sep 11, 2023 at 3:48
  • You're welcome. That is very possible, maybe print values right before they are encoded and again as calldata then convert any hex, look for a difference. Sounds like you are on the right track.
    – Maka
    Commented Sep 11, 2023 at 4:17
  • 1
    Just to follow up: I'm new to Solidity as a programming language, so I kept forgetting that I have to use whole numbers when doing arithmetic. By simple chance, my JavaScript tests were using whole numbers as inputs, but my Python application code passed in floats as inputs, that's why everything seemed to work when I was just running my Truffle tests. I'm glad I caught this on a testnet. Commented Sep 11, 2023 at 21:07
  • Appreciate the follow up, and ye that makes sense. Love that you worked through it, pretty sure you will do ok.
    – Maka
    Commented Sep 11, 2023 at 22:07

Your Answer

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

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