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

Working contract verification script to verify individual contracts post-deployment #330

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

derekpierre
Copy link
Member

@derekpierre derekpierre commented Sep 11, 2024

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:
NOTE

For ape-etherscan, I implemented a flimsy workaround for now, derekpierre/ape-etherscan@f68365a, related to what I read here, https://mirror.xyz/n00b21337.eth/4HDSO5tlP3-_CAKUgT5QgQ4iIJZ7RH46zucebjycoN8 (it's pretty flimsy! 😟 ) , and added a github dependency to my fork. Once the ape folks provide a proper fix, we can switch back to their released version.


  • Modified verify script to verify contracts post-deployment. If the deployed contract was proxied, the underlying implementation contract is verified.
  • Relocked dependencies to use ape-solidity 0.8.4 and my workaround for the ape-etherscan issue (explained below).

Example usage:

  • Verify Coordinator contract (proxied) deployed on tapir and contract info included in tapir.json contract registry
$ ape run verify --contract-name Coordinator --domain tapir --network polygon:amoy:infura
  • Verify ReimbursementPool contract deployed on mainnet and contract info not included in mainnet.json but rather in a separate registry file
$ ape run verify --contract-name ReimbursementPool --registry-filepath ./deployment/artifacts/reimbursement-mainnet.json --network polygon:mainnet:infura 

Issues fixed/closed:

  • Fixes #...

Why it's needed:

Explain how this PR fits in the greater context of the NuCypher Network.
E.g., if this PR address a nucypher/productdev issue, let reviewers know!

Notes for reviewers:

What should reviewers focus on?
Is there a particular commit/function/section of your PR that requires more attention from reviewers?

Are we ok having this github dependency for modified ape-etherscan in main? The upside is that if this PR is merged then anyone can do post-deployment contract verification.
-> Filed #331 to replace the dependency once the fix is available

I still wouldn't integrate verification with deployment just yet; better to continue to verify contracts separately, post-deployment since the workaround is so flimsy.

…st-deployment. The contracts can either be obtained from the common domain registry, or a customized registry path.

Ensure that implementation contract for proxies are the contracts being verified.
Copy link
Member

@manumonti manumonti left a comment

Choose a reason for hiding this comment

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

LGTM 👌 Great work here!

IMHO it's ok to have this github dependency modified. To have verification working can save a lot of time and efforts when we are deploying new contracts, especially now that we are updating/deploying contracts very frequently.

@theref theref merged commit adab7e2 into nucypher:main Sep 12, 2024
2 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