Is there a way to debug step by step in Test Environment?

I hope to debug step by step in Test Environment, so I can know which step causes an error in a certain transaction (function call). Is there a way to do it?

Hello @Ankarrr, unluckily there is no good CLI step by step debugger yet. There are three alternatives to tackle this today, none of them compatible with OpenZeppelin Test Environment:

  1. There’s Buidler’s console.log by Nomic Labs
  2. You can use Tenderly to deploy and debug your contract on a local network
  3. And finally, you can copy-paste your contracts and debug it using Remix which is the only step-by-step debugger

I hope this helps!

2 Likes

Hi @martriay,

Thanks for your reply. May I have a sample of how to use the Buidler’s console.log by Nomic Labs with Test Environment?

Thank you!

1 Like

@Ankarrr Sorry for the confusion, it’s not possible to make use of console.log in Test Environment because it relies on specific features of the Buidler EVM.

2 Likes

Sorry about the confusion, I got it wrong. I updated the answer accordingly.

1 Like

Thank you for your responses! I think we need a better solution to debug a transaction in the test environment.

2 Likes