Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

New deploy code and contract verification script (+misc) #1

Merged
merged 3 commits into from
Jan 2, 2022

Conversation

rithvikvibhu
Copy link
Contributor

This PR:

  • Adds new deploy script
  • Adds script that verifies contracts on block explorers
  • Adds DNSResolver to PublicRegistry - this is what Fingertip (will) use similar to _eth.
  • Update hardhat package to latest version because it fixed something I don't really remember (but I checked to make sure no breaking changes from 2.0.8 to 2.8.0
  • Updates README to expand the quickstart section
  • Adds hardhat/deployments/ and react-app/src/contracts/ to gitignore
  • Adds namespace for mumbai network in react app constants

Deploying

Instead of a contract or script to handle everything manually, hardhat-deploy looks for deploy scripts in hardhat/deploys/. Multiple scripts can be added, actions taken pre/post deploy, etc. This PR adds 1 script here: 00_deploy_all.js.

Notes:

  • When running hardhat node (which is a fresh chain every start), all contracts are deployed automatically
  • After editing contracts, run yarn deploy:test. This runs yarn deploy and then the publish script that updates frontend's contracts directory.
  • Unmodified contracts are reused and not recompiled.

Verification

A new script scripts/verify-contracts.js does all the work of verifying all contracts on etherscan / polygon / mumbai.polygon / wherever. All you need to do is: node scripts/verify-contracts.js

Notes:

@@ -141,6 +141,9 @@ module.exports = {
},
},
},
// Set API key for etherscan/polygonscan/mumbai.polygonscan
// Endpoint will be chosed based on default network
// TODO: Replace this hardcode with a switch on defaultNetwork
etherscan: {
apiKey: '43JVMCI3EJCZSECDWX99KRZRYWDX3H7MCH'

Choose a reason for hiding this comment

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

whose key is this? should we go ahead and migrate this to env?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not mine :p but it's a block explorer key, strictly read-only.
Yes on the env, there's infura keys in this file and a few other places. Can be a different PR collecting all these keys.

Choose a reason for hiding this comment

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

I can support that

Copy link

@brandondees brandondees left a comment

Choose a reason for hiding this comment

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

LGTM

@kibagateaux
Copy link
Contributor

Just missing transferring ownership of Root and Oracle contracts to non-deployer account at end of script but i will add that in

@kibagateaux kibagateaux merged commit 39b8beb into hnsfund:master Jan 2, 2022
@rithvikvibhu rithvikvibhu deleted the new-deploy-verify branch January 8, 2022 11:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants