From 84d501f37111b7f66a19fd660e3fcb4146952690 Mon Sep 17 00:00:00 2001 From: Dean Amiel Date: Mon, 6 Nov 2023 18:31:07 -0500 Subject: [PATCH] feat: add to gh action test --- .github/workflows/test.yaml | 28 +++++++++++++++++++++++++--- evm/deploy-const-address-deployer.js | 2 +- evm/deploy-contract.js | 19 +++++++++++++++---- evm/deploy-create3-deployer.js | 2 +- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 676f7896..63826e86 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -36,7 +36,14 @@ jobs: "chainId": 31337, "rpc": "http://127.0.0.1:8545", "tokenSymbol": "TEST", - "contracts": {} + "contracts": { + "InterchainGovernance": { + "minimumTimeDelay": 3600 + }, + "AxelarServiceGovernance": { + "minimumTimeDelay": 3600 + } + } } } }' > ./axelar-chains-config/info/local.json @@ -52,13 +59,28 @@ jobs: run: cat ./axelar-chains-config/info/local.json - name: Deploy ConstAddressDeployer - run: node evm/deploy-contract.js -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -m create -y + run: node evm/deploy-contract.js -c ConstAddressDeployer -m create -y - name: Deploy Create3Deployer - run: node evm/deploy-contract.js -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -m create2 -y + run: node evm/deploy-contract.js -c Create3Deployer -m create2 -y - name: Deploy AxelarGateway run: node evm/deploy-gateway-v6.2.x.js -m create3 -s "AxelarGateway v6.2" -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: Call Method on Gateway run: node evm/gateway.js --action callContract --destinationChain test2 -y + + - name: Deploy InterchainGovernance + run: node evm/deploy-contract.js -c InterchainGovernance -m create3 -y + + - name: Deploy AxelarServiceGovernance + run: node evm/deploy-contract.js -c AxelarServiceGovernance -m create3 -y + + - name: Deploy Multisig + run: node evm/deploy-contract.js -c Multisig -m create3 -y + + - name: Deploy Operators + run: node evm/deploy-contract.js -c Operators -m create3 -y + + - name: Deploy TokenDeployer + run: node evm/deploy-contract.js -c TokenDeployer -m create3 -y diff --git a/evm/deploy-const-address-deployer.js b/evm/deploy-const-address-deployer.js index 0292ecbd..9218d237 100644 --- a/evm/deploy-const-address-deployer.js +++ b/evm/deploy-const-address-deployer.js @@ -13,7 +13,7 @@ const { addExtendedOptions } = require('./cli-utils'); const contractJson = require('@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ConstAddressDeployer.sol/ConstAddressDeployer.json'); const contractName = 'ConstAddressDeployer'; -async function deployConstAddressDeployer(wallet, chain, options = null, verifyOptions = null) { +async function deployConstAddressDeployer(wallet, chain, options = {}, verifyOptions = null) { printInfo('Deployer address', wallet.address); const contracts = chain.contracts; diff --git a/evm/deploy-contract.js b/evm/deploy-contract.js index 5c84d522..f2b00a1c 100644 --- a/evm/deploy-contract.js +++ b/evm/deploy-contract.js @@ -41,13 +41,15 @@ async function getConstructorArgs(contractName, chain, wallet) { throw new Error(`Missing AxelarGateway address in the chain info.`); } - const governanceChain = contractConfig.governanceChain; + const governanceChain = contractConfig.governanceChain || 'Axelarnet'; + contractConfig.governanceChain = governanceChain; if (!isString(governanceChain)) { throw new Error(`Missing AxelarServiceGovernance.governanceChain in the chain info.`); } - const governanceAddress = contractConfig.governanceAddress; + const governanceAddress = contractConfig.governanceAddress || 'axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj'; + contractConfig.governanceAddress = governanceAddress; if (!isString(governanceAddress)) { throw new Error(`Missing AxelarServiceGovernance.governanceAddress in the chain info.`); @@ -59,13 +61,22 @@ async function getConstructorArgs(contractName, chain, wallet) { throw new Error(`Missing AxelarServiceGovernance.minimumTimeDelay in the chain info.`); } - const cosigners = contractConfig.cosigners; + const cosigners = contractConfig.cosigners || [ + '0x3f5876a2b06E54949aB106651Ab6694d0289b2b4', + '0x9256Fd872118ed3a97754B0fB42c15015d17E0CC', + '0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b', + '0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821', + '0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f', + '0x027c1882B975E2cd771AE068b0389FA38B9dda73', + ]; + contractConfig.cosigners = cosigners; if (!isAddressArray(cosigners)) { throw new Error(`Missing AxelarServiceGovernance.cosigners in the chain info.`); } - const threshold = contractConfig.threshold; + const threshold = contractConfig.threshold || Math.floor((cosigners.length + 1) / 2); + contractConfig.threshold = threshold; if (!isNumber(threshold)) { throw new Error(`Missing AxelarServiceGovernance.threshold in the chain info.`); diff --git a/evm/deploy-create3-deployer.js b/evm/deploy-create3-deployer.js index 02ffa666..8f570bf9 100644 --- a/evm/deploy-create3-deployer.js +++ b/evm/deploy-create3-deployer.js @@ -15,7 +15,7 @@ const contractJson = require('@axelar-network/axelar-gmp-sdk-solidity/artifacts/ const { deployConstAddressDeployer } = require('./deploy-const-address-deployer'); const contractName = 'Create3Deployer'; -async function deployCreate3Deployer(wallet, chain, options = null, verifyOptions = null) { +async function deployCreate3Deployer(wallet, chain, options = {}, verifyOptions = null) { printInfo('Deployer address', wallet.address); console.log(