Consensys / surya

A set of utilities for exploring Solidity contracts
Apache License 2.0
1.06k stars 118 forks source link

Update ftrace.js for large/complex systems #167

Open 0xdomrom opened 2 years ago

0xdomrom commented 2 years ago

Hi all, I have a pretty complex set of contracts and I run into issues when tracing certain functions.

I've isolated the issue to ftrace.js and have been able to resolve the issue by modifying it slightly. Can share the codebase if anyone is interested in reproducing, but it is private at the moment.

GNSPS commented 2 years ago

Hey @0xdomrom I just pointed this to the right branch "develop" and there are some conflicts. Could you please solve those?

GNSPS commented 2 years ago

On a second thought, maybe don't. This isn't really a fix.

If you're hitting the case where a function name is undefined within a contract that is in the set, then this means that something is wrong beforehand.

Further analysis should be done to fix the code prior to that condition. Would you be OK sharing the code with me synchronously or even doing some synchronous debugging?

0xdomrom commented 2 years ago

Hey @GNSPS thanks for having a look, it can be reproduced on this repo: https://github.com/lyra-finance/lyra-protocol

with the command surya ftrace OptionMarket::openPosition all contracts/OptionMarket.sol -i

The repo uses my branch with the "fix" (more of a bandaid) to produce the correct output.

Screen Shot 2022-05-07 at 11 54 43 am

andreiashu commented 2 years ago

this same issue shows up in a Foundry project that I am working with. The workaround unblocked the ftrace functionality on it.