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

Automatically follow proxies #14

Closed
krzkaczor opened this issue Oct 10, 2021 · 0 comments · Fixed by #41
Closed

Automatically follow proxies #14

krzkaczor opened this issue Oct 10, 2021 · 0 comments · Fixed by #41
Assignees
Projects

Comments

@krzkaczor
Copy link
Member

krzkaczor commented Oct 10, 2021

eth-sdk should detect that it's reading ABI of a proxy and should query implementation ABI. Finally, both should be merged. Example contract: 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B.

Steps:

  1. After receiving ABI for a given address we should inspect it and detect is it a proxy. I think good enough heuristics include:
    a) check for implementation or _implementation getters
    b) reading particular storage slot Storage slot 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc (obtained as bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)). More info: https://docs.openzeppelin.com/upgrades-plugins/1.x/proxies and https://eips.ethereum.org/EIPS/eip-1967
  2. If proxy was detected, eth-sdk should query implementation for ABI and then either merge both ABIs or just use implementation proxy. (I think it might be better just to use implementation).

To implement this properly we need to have web3 node connection setup in eth-sdk. I think it's fine for now just to hardcode dummy infura key and allow user to input custom one in config (similarly to etherscan key).

@krzkaczor krzkaczor self-assigned this Oct 28, 2021
@krzkaczor krzkaczor added this to ToDo in eth-sdk Oct 28, 2021
@krzkaczor krzkaczor assigned hasparus and unassigned krzkaczor Oct 28, 2021
@hasparus hasparus moved this from To do to In progress in eth-sdk Nov 4, 2021
@hasparus hasparus mentioned this issue Nov 12, 2021
4 tasks
eth-sdk automation moved this from In progress to Done Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants