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

Add CompilationUnit.implementation_address when the CU is a proxy contract #452

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

SheldonHolmgren
Copy link
Contributor

@SheldonHolmgren SheldonHolmgren commented Jun 15, 2023

This is a small step towards #132. Instead of following the proxy within crytic-compile, this PR allows applications built on top of crytic-compile or slither to do that themselves.

@SheldonHolmgren SheldonHolmgren force-pushed the implementation_address branch from 5b72701 to 24bc098 Compare June 29, 2023 08:42
@SheldonHolmgren
Copy link
Contributor Author

Tested with ipython:

In [1]: from crytic_compile import CryticCompile                                                                                                                                                                         
                                                                                                            
In [2]: print(list(CryticCompile("arbi:0x5A572B5fBBC43387B5eF8de2C4728A4108ef24a6").compilation_units.values())[0].implementation_address)
arbi:0xbca6d5de39c50a863d603702101ab776ce525c3a       

In [3]: print(list(CryticCompile("arbi:0xbca6d5de39c50a863d603702101ab776ce525c3a").compilation_units.values())[0].implementation_address)
None

In [5]: print(list(CryticCompile("0x5e4861a80B55f035D899f66772117F00FA0E8e7B").compilation_units.values())[0].implementation_address)
0x8d014903bf7867260584d714e11809fea5293234

In [6]: print(list(CryticCompile("0x8d014903bf7867260584d714e11809fea5293234").compilation_units.values())[0].implementation_address)
None

(I've cut out the noise in the form of compilation warnings.)

@SheldonHolmgren
Copy link
Contributor Author

The only test failure is:

Etherscan #6
  ERROR:CryticCompile:Etherscan API rate limit exceeded
  ERROR:CryticCompile:Etherscan API rate limit exceeded
  Etherscan #6 test failed

but my change doesn't increase the number of API requests so I believe this failure is unrelated.

@montyly montyly changed the base branch from master to dev October 12, 2023 09:18
@montyly montyly merged commit c9c27e2 into crytic:dev Oct 12, 2023
26 checks passed
@montyly
Copy link
Member

montyly commented Oct 12, 2023

Thanks @SheldonHolmgren

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

Successfully merging this pull request may close these issues.

3 participants