-
Notifications
You must be signed in to change notification settings - Fork 51
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bout3fiddy
reviewed
Jan 29, 2024
i guess we are going to need add an etherscan api key to the CI |
ok i fixed all the little issues. merging, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please beware with me, im new to all this.
What I did
fetch_abi_from_etherscan
to use the ABI of the implementation contract if it is a proxy, enabling the reading of proxy contracts.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[]
oraddress[]
. As i see, this is getting fixed (#115)Description for the changelog
from_etherscan
.from_etherscan_abi
, which retrurns the full ABI of a contract.Cute Animal Picture