Skip to content

Commit

Permalink
Merge branch 'main' into feat/fetchCodeId-normal-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
talalashraf authored Jul 29, 2024
2 parents 3271ce3 + 78b4174 commit 0cd1c66
Show file tree
Hide file tree
Showing 32 changed files with 1,192 additions and 1,525 deletions.
1 change: 0 additions & 1 deletion axelar-chains-config/info/devnet-amplifier.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,4 +455,3 @@
"gasLimit": "auto"
}
}

1 change: 0 additions & 1 deletion axelar-chains-config/info/devnet-verifiers.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,4 +549,3 @@
"gasLimit": "auto"
}
}

1 change: 0 additions & 1 deletion axelar-chains-config/info/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2386,4 +2386,3 @@
"axelarscanApi": "https://api.axelarscan.io"
}
}

1 change: 0 additions & 1 deletion axelar-chains-config/info/stagenet.json
Original file line number Diff line number Diff line change
Expand Up @@ -641,4 +641,3 @@
"axelarscanApi": "https://testnet.api.axelarscan.io"
}
}

39 changes: 19 additions & 20 deletions axelar-chains-config/info/testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -191,7 +191,7 @@
"salt": "InterchainProposalSender v1.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -307,7 +307,7 @@
"salt": "InterchainProposalSender v1.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -404,7 +404,7 @@
"salt": "InterchainProposalSender v1.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -520,7 +520,7 @@
"salt": "InterchainProposalSender v1.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -658,7 +658,7 @@
"salt": "InterchainProposalSender v1.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -753,7 +753,7 @@
"salt": "InterchainProposalSender v1.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -861,7 +861,7 @@
"salt": "InterchainProposalSender v1.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -962,7 +962,7 @@
"address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1102,7 +1102,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1212,7 +1212,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1321,7 +1321,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1425,7 +1425,7 @@
"deployer": "0x5b593E7b1725dc6FcbbFe80b2415B19153F94A85"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1537,7 +1537,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1650,7 +1650,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1763,7 +1763,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1873,7 +1873,7 @@
"salt": "AxelarGateway v6.2"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -1973,7 +1973,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -2081,7 +2081,7 @@
"salt": "Multisig v5.5"
},
"Operators": {
"owner": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"owner": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"address": "0x7F83F5cA2AE4206AbFf8a3C3668e88ce5F11C0B5",
"deployer": "0xB8Cd93C83A974649D76B1c19f311f639e62272BC",
"deploymentMethod": "create2",
Expand Down Expand Up @@ -2164,4 +2164,3 @@
"axelarscanApi": "https://testnet.api.axelarscan.io"
}
}

4 changes: 1 addition & 3 deletions axelar-chains-config/src/utils/getBytecodeHash.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ async function getBytecodeHash(contractObject, chain = '', provider = null) {
}

if (chain.toLowerCase() === 'polygon-zkevm') {
throw new Error(
"polygon-zkevm is not supported. Use getBytecodeHash from axelar-contract-deployments that handles polygon-zkevm's hash function",
);
throw new Error('polygon-zkevm uses a custom bytecode hash derivation and is not supported');
}

return keccak256(bytecode);
Expand Down
87 changes: 87 additions & 0 deletions common/cli-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
'use strict';

require('dotenv').config();

const { Option } = require('commander');

const addBaseOptions = (program, options = {}) => {
program.addOption(
new Option('-e, --env <env>', 'environment')
.choices(['local', 'devnet', 'devnet-amplifier', 'devnet-verifiers', 'stagenet', 'testnet', 'mainnet'])
.default('testnet')
.makeOptionMandatory(true)
.env('ENV'),
);
program.addOption(new Option('-y, --yes', 'skip deployment prompt confirmation').env('YES'));
program.addOption(new Option('--parallel', 'run script parallely wrt chains'));
program.addOption(new Option('--saveChainSeparately', 'save chain info separately'));
program.addOption(new Option('--gasOptions <gasOptions>', 'gas options cli override'));

if (!options.ignoreChainNames) {
program.addOption(
new Option('-n, --chainNames <chainNames>', 'chains to run the script over').makeOptionMandatory(true).env('CHAINS'),
);
program.addOption(new Option('--skipChains <skipChains>', 'chains to skip over'));
program.addOption(
new Option(
'--startFromChain <startFromChain>',
'start from a specific chain onwards in the config, useful when a cmd fails for an intermediate chain',
),
);
}

if (!options.ignorePrivateKey) {
program.addOption(new Option('-p, --privateKey <privateKey>', 'private key').makeOptionMandatory(true).env('PRIVATE_KEY'));
}

if (options.address) {
program.addOption(new Option('-a, --address <address>', 'override address'));
}

return program;
};

const addExtendedOptions = (program, options = {}) => {
addBaseOptions(program, options);

program.addOption(new Option('-v, --verify', 'verify the deployed contract on the explorer').env('VERIFY'));

if (options.artifactPath) {
program.addOption(new Option('--artifactPath <artifactPath>', 'artifact path'));
}

if (options.contractName) {
program.addOption(new Option('-c, --contractName <contractName>', 'contract name').makeOptionMandatory(true));
}

if (options.deployMethod) {
program.addOption(
new Option('-m, --deployMethod <deployMethod>', 'deployment method')
.choices(['create', 'create2', 'create3'])
.default(options.deployMethod),
);
}

if (options.salt) {
program.addOption(new Option('-s, --salt <salt>', 'salt to use for create2 deployment').env('SALT'));
}

if (options.skipExisting) {
program.addOption(new Option('-x, --skipExisting', 'skip existing if contract was already deployed on chain').env('SKIP_EXISTING'));
}

if (options.upgrade) {
program.addOption(new Option('-u, --upgrade', 'upgrade a deployed contract').env('UPGRADE'));
}

if (options.predictOnly) {
program.addOption(new Option('--predictOnly', 'output the predicted changes only').env('PREDICT_ONLY'));
}

return program;
};

module.exports = {
addBaseOptions,
addExtendedOptions,
};
4 changes: 4 additions & 0 deletions common/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
...require('./cli-utils'),
...require('./utils'),
};
Loading

0 comments on commit 0cd1c66

Please sign in to comment.