How to debug into a forked chain's contract code while running forge test? I do have source code #12734
Unanswered
sdajklfw389
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I forked an blockchain locally by using
vm.createSelectFork. And usedforge test --debugto get into the call inside forked contracts.Basically my test calls different functions on different contracts.
But the problem is: I can debug my test code by solidity code, but i can only step into bytecode of the on-chain contracts.
I do have the source code of the forked contracts and compiled them with the same compiler version/optimizer exactly as the onchain contracts, and I also verified the local runtime bytecode is the same as onchain.
And I have compiled the production code(on-chain contracts) together with my test code. Although my test code only need the interfaces of production code. Not the implementation code.
Beta Was this translation helpful? Give feedback.
All reactions