diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 000000000..b6f488f94 --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,36 @@ +# Deployment + +## 1. Compile the contracts: + +`npm run cc` + +If setting up a new environment `ENV_NAME` for the first time: + +- Add the new environment in `truffle-config.base.js` +- Add a new AWS configuration locally +- Add it to `S3_BUCKET_SUFFIXES` in `.env` + +## 2. Deploy the contracts: + +``` +./scripts/deploy.sh --no-compile ENV_NAME 1 +./scripts/deploy.sh --no-compile ENV_NAME 2 +./scripts/deploy.sh --no-compile ENV_NAME 3 +./scripts/deploy.sh --no-compile ENV_NAME 4 +``` + +If you need to do some manual changes to the config file and reupload it to S3 you can do it like this: + +Download: + +`aws-vault exec argent-ENV_NAME -- aws s3 cp s3://argent-smartcontracts-ENV_NAME/backend/config.json ./config.json` + +Upload: + +`aws-vault exec argent-ENV_NAME -- aws s3 cp ./config.json s3://argent-smartcontracts-ENV_NAME/backend/config.json` + +## 3. Configure the DappRegistry + +- Go to the `argent-trustslists` repo +- Make sure the values in `scripts/config/ENV_NAME.json` match the config file you created earlier in `argent-contracts` (multisig, ens manager, dapp registry, ...) +- Run the deploy script: `aws-vault exec argent-ENV_NAME -- yarn hardhat run ./scripts/configure-registries.ts --network ENV_NAME` diff --git a/deployment/1_setup_test_environment.js b/deployment/1_setup_test_environment.js index 57ee5b243..9df29c627 100644 --- a/deployment/1_setup_test_environment.js +++ b/deployment/1_setup_test_environment.js @@ -21,6 +21,7 @@ const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; async function deployENSRegistry(owner, domain) { // Deploy the public ENS registry const ensRegistryWithoutFallback = await ENSRegistry.new(); + console.log("Deploying local ENSRegistry"); const ENSWrapper = await ENSRegistryWithFallback.new(ensRegistryWithoutFallback.address); console.log("Deployed local ENSRegistry at ", ENSWrapper.address); // ENS domain @@ -40,7 +41,7 @@ async function deployENSRegistry(owner, domain) { } async function main() { - const { configurator, deploymentAccount } = await deployManager.getProps(); + const { configurator, deploymentAccount, abiUploader } = await deployManager.getProps(); const { config } = configurator; if (config.ENS.deployOwnRegistry) { @@ -53,6 +54,7 @@ async function main() { const DappRegistryWrapper = await DappRegistry.new(0); console.log("Deployed local DappRegistry at ", DappRegistryWrapper.address); configurator.updateDappRegistry(DappRegistryWrapper.address); + await abiUploader.upload(DappRegistryWrapper, "contracts"); } if (config.defi.uniswap.deployOwn) { diff --git a/deployment/3_finalise_test_environment.js b/deployment/3_finalise_test_environment.js index 0745fb52f..3f4401a59 100644 --- a/deployment/3_finalise_test_environment.js +++ b/deployment/3_finalise_test_environment.js @@ -33,7 +33,7 @@ async function main() { await deployENSReverseRegistrar(config, deploymentAccount); } - console.log("## completed deployment script 4 ##"); + console.log("## completed deployment script 3 ##"); } // For truffle exec diff --git a/deployment/4_deploy_modules.js b/deployment/4_deploy_modules.js index 8969a599c..d42a058b8 100644 --- a/deployment/4_deploy_modules.js +++ b/deployment/4_deploy_modules.js @@ -84,7 +84,7 @@ async function main() { }; await versionUploader.upload(version); - console.log("## completed deployment script 5 ##"); + console.log("## completed deployment script 4 ##"); } // For truffle exec diff --git a/truffle-config.base.js b/truffle-config.base.js index b84b75ebf..d20efdf98 100644 --- a/truffle-config.base.js +++ b/truffle-config.base.js @@ -60,11 +60,11 @@ module.exports = { dev: { provider: () => new AWSWalletProvider( - `https://rinkeby.infura.io/v3/${process.env.INFURA_KEY}`, + `https://eth-goerli.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`, "argent-smartcontracts-dev", "backend/deploy.key" ), - network_id: 4, // rinkeby + network_id: 5, // goerli gas: _gasLimit, gasPrice: _gasPrice }, @@ -80,6 +80,17 @@ module.exports = { gasPrice: _gasPrice }, + hydrogen: { + provider: () => new AWSWalletProvider( + `https://goerli.infura.io/v3/${process.env.INFURA_KEY}`, + "argent-smartcontracts-hydrogen", + "backend/deploy.key" + ), + network_id: 5, // goerli + gas: _gasLimit, + gasPrice: _gasPrice + }, + staging: { provider: () => new AWSWalletProvider( `https://mainnet.infura.io/v3/${process.env.INFURA_KEY}`,