From b4954b77ac6c5399d50848681ed2ef85585e623f Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Thu, 2 Nov 2023 02:24:52 -0400 Subject: [PATCH 1/3] chore: cleanup README (#103) * chore: cleanup README * lint * misc --- .example.env | 4 +- axelar-chains-config/info/stagenet.json | 20 ---------- axelar-chains-config/info/testnet.json | 52 +++++++------------------ evm/README.md | 45 +++++++-------------- evm/deploy-gateway-v6.2.x.js | 44 +++++++++++++++------ package.json | 2 +- 6 files changed, 62 insertions(+), 105 deletions(-) diff --git a/.example.env b/.example.env index 034cb64c..006d33c7 100644 --- a/.example.env +++ b/.example.env @@ -1,4 +1,2 @@ PRIVATE_KEY = '0x...' -ENV = 'local' -SALT = 'ITS v0.1.0' -SKIP_EXISTING = true \ No newline at end of file +ENV = 'testnet' diff --git a/axelar-chains-config/info/stagenet.json b/axelar-chains-config/info/stagenet.json index 1fc7e384..f48114a0 100644 --- a/axelar-chains-config/info/stagenet.json +++ b/axelar-chains-config/info/stagenet.json @@ -14,8 +14,6 @@ "implementationCodehash": "0x5703cdd5d9808d811ab9e516c6298a18ff926b2dc03abeba391e662f737df203", "authModule": "0xa30225bE0D505c67028B49c7175a37ff4883980f", "tokenDeployer": "0xD65b4CEde4733F08939719e228F76d13BC99cBBa", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -97,8 +95,6 @@ "implementationCodehash": "0xc680513d76d4bb9ddebb68f3137e92cf5ee91ffd83f8153de0339b7c3f72c156", "authModule": "0x56FdBc2a6b63D768BE38e0585175dC7956d741F3", "tokenDeployer": "0x4e5Fd0f7046aBE327D637D5D4AB756769cB60A97", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -180,8 +176,6 @@ "implementationCodehash": "0xa9ca57c139ac5ae7a0c65d6307c2b26b3a8624a7ab0a3e450be82d86482e2024", "authModule": "0x68F66b5Ea49B43E4d29BDED1051B90a28EADC67d", "tokenDeployer": "0x34bF216E0ae4aFCFf9283ED6D23A89cF1B0CCED1", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -263,8 +257,6 @@ "implementationCodehash": "0x5703cdd5d9808d811ab9e516c6298a18ff926b2dc03abeba391e662f737df203", "authModule": "0xa30225bE0D505c67028B49c7175a37ff4883980f", "tokenDeployer": "0xD65b4CEde4733F08939719e228F76d13BC99cBBa", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -346,8 +338,6 @@ "implementationCodehash": "0xa9ca57c139ac5ae7a0c65d6307c2b26b3a8624a7ab0a3e450be82d86482e2024", "authModule": "0x68F66b5Ea49B43E4d29BDED1051B90a28EADC67d", "tokenDeployer": "0x34bF216E0ae4aFCFf9283ED6D23A89cF1B0CCED1", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -429,8 +419,6 @@ "implementationCodehash": "0x575efa6334e10e63128cb88913044c7c687f47d267640e41faac93b054ae6140", "authModule": "0x34bF216E0ae4aFCFf9283ED6D23A89cF1B0CCED1", "tokenDeployer": "0xdc9fA655094bBaD6840cd4b05c5658eE2042e122", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -512,8 +500,6 @@ "implementationCodehash": "0x5703cdd5d9808d811ab9e516c6298a18ff926b2dc03abeba391e662f737df203", "authModule": "0xa30225bE0D505c67028B49c7175a37ff4883980f", "tokenDeployer": "0xD65b4CEde4733F08939719e228F76d13BC99cBBa", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -598,8 +584,6 @@ "implementationCodehash": "0xf1c37572ed919c97c02f87c70f41e57dd513f335c53237e1af73330b00f04de0", "authModule": "0xB0288E332552f87Ef51EEE5F4060D1A98e99548B", "tokenDeployer": "0xef180cdD04aCec05E085963aCc61BaeD17b50894", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -680,8 +664,6 @@ "implementationCodehash": "0x3eb48e5f48808ef13805b38cffaa69b898238f02ad768e5d1ee5bc73be6bb579", "authModule": "0xD65b4CEde4733F08939719e228F76d13BC99cBBa", "tokenDeployer": "0x68F66b5Ea49B43E4d29BDED1051B90a28EADC67d", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, @@ -766,8 +748,6 @@ "implementationCodehash": "0x7fb0f83cf34549753919f6f16ed3e895fbe26eda1bfded31247048255b5d4331", "authModule": "0x2F4d0bEecEE4559026A8093EDD0e16377202DBe8", "tokenDeployer": "0xB0288E332552f87Ef51EEE5F4060D1A98e99548B", - "governance": "0xeeC07176Ed1d49D9cb6C52f86E278b82Dd006C3e", - "mintLimiter": "0xdae074A742cC3628aF70bCa2B410654dF0168a5A", "deploymentMethod": "create3", "salt": "AxelarGateway v6.2" }, diff --git a/axelar-chains-config/info/testnet.json b/axelar-chains-config/info/testnet.json index 4ec0e1b8..e93a4f46 100644 --- a/axelar-chains-config/info/testnet.json +++ b/axelar-chains-config/info/testnet.json @@ -15,9 +15,7 @@ "authModule": "0xcbf7900138EBc9CdB3E933B9E6F7071587BD6cb8", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -125,9 +123,7 @@ "authModule": "0xE39d7d526DFd7B6D10972708C77ED19c3f2f5625", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -238,9 +234,7 @@ "authModule": "0xE39d7d526DFd7B6D10972708C77ED19c3f2f5625", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -354,9 +348,7 @@ "authModule": "0xE39d7d526DFd7B6D10972708C77ED19c3f2f5625", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -580,9 +572,7 @@ "authModule": "0xE39d7d526DFd7B6D10972708C77ED19c3f2f5625", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -690,9 +680,7 @@ "authModule": "0x6e0e885F0957086e173D95aAA08191a6c1Ac860d", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -800,9 +788,7 @@ "authModule": "0xD9Af006C3b33a87eE8168B9e25721DFb00FC3d2d", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -910,9 +896,7 @@ "authModule": "0x7A599c9bB4D88F648701B653739688edEfd830E8", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -1019,9 +1003,7 @@ "authModule": "0x6e0e885F0957086e173D95aAA08191a6c1Ac860d", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -1133,9 +1115,7 @@ "authModule": "0x6e0e885F0957086e173D95aAA08191a6c1Ac860d", "tokenDeployer": "0xb28478319B64f8D47e19A120209A211D902F8b8f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -1249,9 +1229,7 @@ "deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05", "implementationCodehash": "0xc3516b0df24004564d42ebd7c4e4d3814655ea19ec2535627ebcdced0970cccd", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "collector": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5", @@ -1356,9 +1334,7 @@ "deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05", "implementationCodehash": "0x327eb5816918332c7b6787ef777587c8f9b39af4ec7b8710cdd037d976b65d5f", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "salt": "AxelarGasService", @@ -1466,9 +1442,7 @@ "deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05", "implementationCodehash": "0xf9c0cf2181e91d9a39b38b9b1b32a5f170ddd5b6361b9ae5489224cf65d214be", "deploymentMethod": "create3", - "salt": "AxelarGateway v6.2", - "governance": "0x4F0f42bF41ba60895134EC99dE79A041E5269003", - "mintLimiter": "0xF0E17583C906f3e672e591791a88c1116F53081c" + "salt": "AxelarGateway v6.2" }, "AxelarGasService": { "collector": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5", diff --git a/evm/README.md b/evm/README.md index 8752d1ce..07c00106 100644 --- a/evm/README.md +++ b/evm/README.md @@ -1,62 +1,45 @@ # EVM deployment scripts -This folder contains deployment scripts for the following contracts. +This folder contains deployment and operational scripts for various contracts. +By default the version of contracts specified in `package.json` will be used for deployment. ## Setup `npm ci` -For contract verification to work, copy over the appropriate build `artifacts` and `contracts` folder from the source repo into this repo. And update the hardhat config to use the same compiler version and optimizer runs setting. - -You also need to create a `keys.json` file. See `evm/.example.keys.json` for an example. +Add the deployer private key in `.env` folder (see `.example.env` for reference). ## AxelarGateway -1. Compile the contracts from the source repo -2. Copy the `artifacts` folder at the root level of this repo -3. Add the deployer private key in `.env` folder (see `.example.env` for reference) -4. Add additional params in `.env` such as admin addresses, governance etc. -5. If you'd like to auto-verify the contract on the explorer, then add the explorer API key under `keys.json` (see `.example.keys.json`), and add `--verify` flag -6. Run the following depending on the service, - `node evm/deploy-gateway-v5.0.x.js --env testnet -n fantom` +Deploy the gateway contract. + +`node evm/deploy-gateway-v6.2.x.js -e testnet -n ethereum` ## Gateway Upgrade 1. When upgrading the gateway, the proxy contract will be reused. 2. Depending on the upgrade process, Axelar auth and token deployer helper contracts might be reused as well. -3. `node evm/deploy-gateway-v5.0.x.js -e testnet -n fantom --reuseProxy` OR -4. `node evm/deploy-gateway-v5.0.x.js -e testnet -n fantom --reuseProxy --reuseHelpers` +3. `node evm/deploy-gateway-v6.2.x.js -e testnet -n ethereum --reuseProxy` OR +4. `node evm/deploy-gateway-v6.2.x.js -e testnet -n ethereum --reuseProxy --reuseHelpers` 5. This sets the new `implementation` in the chain config. 6. Upgrade to the new implementation contract - `node evm/deploy-gateway-v5.0.x.js -e testnet -n fantom --upgrade` + `node evm/deploy-gateway-v6.2.x.js -e testnet -n ethereum --upgrade` ## AxelarGasService and AxelarDepositService -1. Compile the contracts from the source repo -2. Copy the `artifacts` folder at the root level of this repo -3. Add the deployer private key in `.env` folder (see `.example.env` for reference) -4. If you'd like to auto-verify the contract on the explorer, then add the explorer API key under `keys.json` (see `.example.keys.json`), and add `--verify` flag -5. Use the `--upgrade` flag to upgrade the contract instead -6. Run the following depending on the service, - `node evm/deploy-upgradable.js deploy --env testnet -n fantom -c AxelarGasService -a ../artifacts/contracts/gas-service/` +1. Run the following depending on the service, +`node evm/deploy-upgradable.js -e testnet -n ethereum -c AxelarGasService` +2. Use the `--upgrade` flag to upgrade the contract instead ## InterchainTokenService -Install and copy default setting with - -```bash -npm ci && cp example.env .env -``` - To test the Interchain Token Service deployment ```bash -node evm/deploy-its -n ${chain-name} -s [salt] +node evm/deploy-its -e testnet -n ethereum -s [salt] ``` -Run again with `-v only` to verify deployed contracts. - -You can change `.env` to run the above script to testnet instead of local. Change the `SALT` to get a new address. +Change the `-s SALT` to derive a new address. ## Contract Verification diff --git a/evm/deploy-gateway-v6.2.x.js b/evm/deploy-gateway-v6.2.x.js index bcf5145a..f4cb96e5 100644 --- a/evm/deploy-gateway-v6.2.x.js +++ b/evm/deploy-gateway-v6.2.x.js @@ -49,7 +49,7 @@ async function checkKeyRotation(config, chain) { } async function getAuthParams(config, chain, options) { - printInfo('Retrieving auth key'); + printInfo(`Retrieving validator addresses for ${chain} from Axelar network`); if (!options.amplifier) { await checkKeyRotation(config, chain); @@ -97,8 +97,8 @@ async function deploy(config, chain, options) { } const contractConfig = chain.contracts[contractName]; - const governance = options.governance || contractConfig.governance || chain.contracts.InterchainGovernance?.address; - const mintLimiter = options.mintLimiter || contractConfig.mintLimiter || chain.contracts.Multisig?.address; + const governance = options.governance || chain.contracts.InterchainGovernance?.address || wallet.address; + const mintLimiter = options.mintLimiter || chain.contracts.Multisig?.address || wallet.address; if (!reuseProxy) { if (governance === undefined) { @@ -110,11 +110,11 @@ async function deploy(config, chain, options) { } if (!(await isContract(governance, provider))) { - printWarn('governance address is not a contract'); + printWarn('Governance address is not a contract. This is optional for test deployments'); } if (!(await isContract(mintLimiter, provider))) { - printWarn('mintLimiter address is not a contract'); + printWarn('MintLimiter address is not a contract. This is optional for test deployments'); } } @@ -236,6 +236,8 @@ async function deploy(config, chain, options) { const params = getProxyParams(governance, mintLimiter); printInfo('Deploying gateway proxy contract'); + printInfo('Governance address', governance); + printInfo('MintLimiter address', mintLimiter); printInfo('Proxy deployment args', `${implementation.address},${params}`); const gatewayProxy = await gatewayProxyFactory.deploy(implementation.address, params, gasOptions); @@ -335,8 +337,6 @@ async function deploy(config, chain, options) { contractConfig.implementationCodehash = implementationCodehash; contractConfig.authModule = auth.address; contractConfig.tokenDeployer = tokenDeployer.address; - contractConfig.governance = governance; - contractConfig.mintLimiter = mintLimiter; contractConfig.deployer = wallet.address; contractConfig.deploymentMethod = options.deployMethod; @@ -344,6 +344,18 @@ async function deploy(config, chain, options) { contractConfig.salt = salt; } + if (!chain.contracts.InterchainGovernance) { + chain.contracts.InterchainGovernance = {}; + } + + chain.contracts.InterchainGovernance.address = governance; + + if (!chain.contracts.Multisig) { + chain.contracts.Multisig = {}; + } + + chain.contracts.Multisig.address = mintLimiter; + printInfo('Deployment status', 'SUCCESS'); saveConfig(config, options.env); @@ -374,11 +386,21 @@ async function upgrade(_, chain, options) { const gateway = new Contract(contractConfig.address, AxelarGateway.abi, wallet); let implementationCodehash = contractConfig.implementationCodehash; - let governance = options.governance || contractConfig.governance || chain.contracts.InterchainGovernance?.address; - let mintLimiter = options.mintLimiter || contractConfig.mintLimiter || chain.contracts.Multisig?.address; + let governance = options.governance || chain.contracts.InterchainGovernance?.address; + let mintLimiter = options.mintLimiter || chain.contracts.Multisig?.address; let setupParams = '0x'; - contractConfig.governance = governance; - contractConfig.mintLimiter = mintLimiter; + + if (!chain.contracts.InterchainGovernance) { + chain.contracts.InterchainGovernance = {}; + } + + chain.contracts.InterchainGovernance.address = governance; + + if (!chain.contracts.Multisig) { + chain.contracts.Multisig = {}; + } + + chain.contracts.Multisig.address = mintLimiter; if (!offline) { if (governance && !(await isContract(governance, provider))) { diff --git a/package.json b/package.json index 8aecd090..a1e9b6ab 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Axelar contract deployment scripts", "main": "index.js", "scripts": { - "lint": "eslint '**/*.js'", + "lint": "eslint --fix '**/*.js'", "prettier": "prettier --write '**/*.js' 'axelar-chains-config/info/*.json' 'package.json' 'evm/**/*.json' '.github/**/*.yaml'" }, "repository": { From 863b8ff276f9101613b321cb70ebb3ada14ab559 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Thu, 2 Nov 2023 18:45:05 -0400 Subject: [PATCH 2/3] feat: create proposal deposit param change script (#104) * feat: create proposal deposit param change script * update readme * lint --- evm/README.md | 5 +++ evm/min-deposit-proposal.js | 86 +++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 evm/min-deposit-proposal.js diff --git a/evm/README.md b/evm/README.md index 07c00106..789a0e89 100644 --- a/evm/README.md +++ b/evm/README.md @@ -41,6 +41,11 @@ node evm/deploy-its -e testnet -n ethereum -s [salt] Change the `-s SALT` to derive a new address. +## InterchainGovernance + +To update the min deposit on Axelar with a param change proposal, you can generate the proposal via +`node evm/min-deposit-proposal.js -e mainnet -n all --deposit 1000000` + ## Contract Verification ### Prerequisites diff --git a/evm/min-deposit-proposal.js b/evm/min-deposit-proposal.js new file mode 100644 index 00000000..09d49e5e --- /dev/null +++ b/evm/min-deposit-proposal.js @@ -0,0 +1,86 @@ +'use strict'; + +require('dotenv').config(); + +const { Command, Option } = require('commander'); +const { mainProcessor, printInfo, isValidNumber, isValidAddress } = require('./utils'); + +const values = []; + +async function processCommand(_, chain, options) { + const { address, deposit } = options; + + printInfo('Chain', chain.name); + + const contracts = chain.contracts; + const contractConfig = contracts.InterchainGovernance; + + let governanceAddress; + + if (isValidAddress(address)) { + governanceAddress = address; + } else { + if (!contractConfig?.address) { + throw new Error(`Governance contract not deployed on ${chain.name}`); + } + + governanceAddress = contractConfig.address; + } + + if (!isValidNumber(deposit)) { + throw new Error('Invalid deposit amount'); + } + + values.push({ + chain: chain.id.toLowerCase(), + contract_address: governanceAddress, + min_deposits: [ + { + denom: 'uaxl', + amount: `${parseInt(deposit) * 1e6}`, + }, + ], + }); +} + +async function main(options) { + await mainProcessor(options, processCommand); + + const paramChange = { + title: 'Update min deposit for governance proposals', + description: `This proposal sets a minimum deposit of ${options.deposit} AXL for any governance proposals for the Axelar gateway contracts.`, + deposit: '2000000000uaxl', + changes: [ + { + subspace: 'axelarnet', + key: 'callContractsProposalMinDeposits', + value: values, + }, + ], + }; + + printInfo('Proposal', JSON.stringify(paramChange, null, 2)); +} + +if (require.main === module) { + const program = new Command(); + + program.name('balances').description('Display balance of the wallet on specified chains.'); + + program.addOption( + new Option('-e, --env ', 'environment') + .choices(['local', 'devnet', 'stagenet', 'testnet', 'mainnet']) + .default('testnet') + .makeOptionMandatory(true) + .env('ENV'), + ); + program.addOption(new Option('-n, --chainNames ', 'chain names').makeOptionMandatory(true).env('CHAINS')); + program.addOption(new Option('-a, --address
', 'override governance address')); + program.addOption(new Option('--deposit ', 'min deposit for governance proposals, in terms of AXL')); + + program.action((options) => { + main(options); + }); + + program.parse(); +} From 05756e3a1118a5ce1c0afd0da23236328bbe84b9 Mon Sep 17 00:00:00 2001 From: Stelios Daveas <48155711+sdaveas@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:14:46 +0200 Subject: [PATCH 3/3] add gas options to gateway deployment (#105) --- evm/deploy-gateway-v4.3.x.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evm/deploy-gateway-v4.3.x.js b/evm/deploy-gateway-v4.3.x.js index fed49ee8..5866bb22 100644 --- a/evm/deploy-gateway-v4.3.x.js +++ b/evm/deploy-gateway-v4.3.x.js @@ -136,7 +136,7 @@ async function deploy(config, options) { if (skipExisting && contractConfig.implementation) { implementation = gatewayFactory.attach(contractConfig.implementation); } else { - implementation = await gatewayFactory.deploy(auth.address, tokenDeployer.address); + implementation = await gatewayFactory.deploy(auth.address, tokenDeployer.address, gasOptions); await implementation.deployTransaction.wait(chain.confirmations); }