Skip to content

Commit

Permalink
Merge pull request #301 from argentlabs/chore/dapp-registry-abi-upload
Browse files Browse the repository at this point in the history
chore(config): add `hydrogen` env and update `dev` env
  • Loading branch information
delaaxe authored Nov 16, 2022
2 parents 1429781 + 4abafab commit c3176bc
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
36 changes: 36 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -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`
4 changes: 3 additions & 1 deletion deployment/1_setup_test_environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion deployment/3_finalise_test_environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deployment/4_deploy_modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions truffle-config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand All @@ -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}`,
Expand Down

0 comments on commit c3176bc

Please sign in to comment.