Truffle debug

Do you have any guide to debug smart contract transactions if proxy-contract used?
Or it is not a proxy issue?

:computer: Environment

Truffle v5.0.34 (core: 5.0.34)
Solidity - 0.5.11
Node v10.16.3
Web3.js v1.2.1
Ganache CLI v6.6.0 (ganache-core: 2.7.0)
OpenZeppelin SDK 2.5.2

:1234: Code to reproduce

ganache-cli -d
Transaction: 0x05cb235dd712e4f775e40e223cb5ccf4ee5f2a14b8ac480e28c58a7e6711ecbe
Runtime Error: revert

truffle console --network local
debug 0x05cb235dd712e4f775e40e223cb5ccf4ee5f2a14b8ac480e28c58a7e6711ecbe
Starting Truffle Debugger…
:heavy_check_mark: Compiling your contracts…
:heavy_check_mark: Gathering information about your project and the transaction…

Addresses called: (not created)
 0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab - MyContract
 0xCfEB869F69431e42cdB54A4F4f105C19C080A601(UNKNOWN)

**Warning: The source code for one or more contracts could not be found.**

Hi,

There isn’t a guide to debug upgradeable smart contract transactions that I am aware of.

I assume that truffle debug doesn’t support proxy contracts. I tried and got the same error as you.

You could track down any potential issues just using your logic contract. Otherwise feel free to share your contract.

Oh, I got it.
Just need to execute one step next (n), and debugger jumps to logic contract source code.
Thanks!

1 Like

Nice solution.
I have written this up as a guide: Debugging OpenZeppelin SDK contracts with truffle debug

1 Like