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

support for proxy contracts for from_etherscan #122

Merged
merged 12 commits into from
Jan 31, 2024

Conversation

mo-anon
Copy link

@mo-anon mo-anon commented Jan 22, 2024

Please beware with me, im new to all this.

What I did

  • Modified fetch_abi_from_etherscan to use the ABI of the implementation contract if it is a proxy, enabling the reading of proxy contracts.
  • Added a from_etherscan_abi function which returns the actual ABI. I feel like this might be useful (will remove if not needed).

How I did It

Used the Etherscan API to check if the contract is a proxy. If yes, the ABI of the implementation contract is used.
NOTE: Im very positive there are more efficient ways to resolve this as i call the api twice, but it's the only solution I can think of at the moment lol.

How to verify It

Added some simple tests. However, testing/using from_etherscan is a pain because the ABI parser raises an error when the ABI apparently has an invalid length, e.g., uint256[] or address[]. As i see, this is getting fixed (#115)

Description for the changelog

  • Added proxy contract support for from_etherscan.
  • Added from_etherscan_abi, which retrurns the full ABI of a contract.

Cute Animal Picture

Insert a link to a cute animal picture here

boa/explorer.py Outdated Show resolved Hide resolved
boa/explorer.py Show resolved Hide resolved
tests/unitary/test_from_etherscan.py Outdated Show resolved Hide resolved
boa/interpret.py Outdated Show resolved Hide resolved
@charles-cooper
Copy link
Member

i guess we are going to need add an etherscan api key to the CI

@charles-cooper
Copy link
Member

ok i fixed all the little issues. merging, thanks!

@charles-cooper charles-cooper merged commit 858b5e4 into vyperlang:master Jan 31, 2024
5 of 7 checks passed
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.

4 participants