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

feat: Etherscan contract verification #330

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

Conversation

DanielSchiavini
Copy link
Collaborator

What I did

  • Implemented contract validation on Etherscan

How I did it

Cute Animal Picture

image

@DanielSchiavini DanielSchiavini marked this pull request as ready for review November 13, 2024 12:02
boa/verifiers.py Outdated
wait_time = backoff
while datetime.now() < timeout:
if result := predicate():
return result
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why return the result?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it could be used with more than just bools (but yeah I know you don't like truthiness)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the value is actually used to wait until the contract is created:

identifier = _wait_until(

boa/explorer.py Outdated Show resolved Hide resolved
response.raise_for_status()
response_json = response.json()
if response_json.get("status") == "1":
return response_json["result"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes definitely, that's the identifier

boa/explorer.py Outdated Show resolved Hide resolved
boa/verifiers.py Outdated
)


def _wait_until(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the indirection here is extremely confusing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just make it part of the base contract verifier?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is in the verifiers file, it is definitely not specific for contract verification.
Since it doesn't use anything from self I didn't see the point of keeping it in a class

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