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

Use brownie's Contract API to decode EVM script calls #345

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Psirex
Copy link
Contributor

@Psirex Psirex commented Feb 13, 2025

The current EVM script decoder is based on the AVotesParser library. However, this library has a bug that, under certain conditions (e.g., when a call is made on proxy contracts), can result in unparsed calls in the output (see screenshot below):

image

Since AVotesParser is scheduled for deprecation in the near future, fixing the issue directly in the library is suboptimal.

This PR addresses the problem by eliminating the use of AVotesParser.decode_function_call() and replacing it with a new local method, decode_encoded_call(). This method relies entirely on Brownie’s Contract API, which can natively resolve ABIs and source code from Etherscan, as well as decode call data.

Note: The new implementation requires the ETHERSCAN_TOKEN environment variable to be set in order to run the scripts.

Below is a screenshot showing the output of the updated script using the new method.:

image

@Psirex Psirex requested a review from a team as a code owner February 13, 2025 13:58
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.

2 participants