Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: include external calls for contracts gotten through getters in graph #126

Open
jubeira opened this issue Jan 27, 2023 · 1 comment

Comments

@jubeira
Copy link

jubeira commented Jan 27, 2023

I'll illustrate the case with a code sample:

interface IVault {
  function doSomething() external;
}

contract Pool {
  private immutable IVault _vault;

  constructor(IVault vault) {
    _vault = vault;
  }

  function getVault() public view returns (IVault) {
    return _vault;
  }

  function doSomethingInVault() external {
    getVault().doSomething();
  }
}

In this example, a Pool contract holds an immutable reference to a Vault contract, which has a known interface.
When calling doSomethingInVault, the pool gets its internal reference through the public getter, and executes an external call.

When generating the graph however, the parser shows that doSomethingInVault calls getVault (which is correct), but it does not parse the external call to IVault#doSomething (i.e. shows doSomethingInVault --> getVault).

The proposal would be to include the external call as well. In this case, it would be doSomethingInVault --> getVault --> doSomething.

PS: thanks for sharing this tool; it's pretty cool and useful!

@tintinweb
Copy link
Member

hi @jubeira, please file this with https://github.com/Consensys/surya/ which is the underlying lib that generates call traces - and link to this issue. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants