Skip to content

Commit

Permalink
feat: add immutable devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth committed Nov 8, 2023
1 parent bc7d6c0 commit d098371
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 18 deletions.
91 changes: 91 additions & 0 deletions axelar-chains-config/info/stagenet.json
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,97 @@
"gasOptions": {
"gasLimit": 5000000
}
},
"immutable-devnet": {
"name": "immutable-devnet",
"id": "immutable-devnet",
"chainId": 15003,
"rpc": "",
"tokenSymbol": "IMX",
"gasOptions": {
"gasLimit": 8000000,
"maxPriorityFeePerGas": 150000000000,
"maxFeePerGas": 160000000000
},
"contracts": {
"AxelarGateway": {
"startingKeyIDs": [
"evm-immutable-devnet-genesis"
],
"authModule": "0xe0Ad88660B5B09fE9FF8bA6f1dba1A826b1C7583",
"tokenDeployer": "0x42dBF20686794C1a82A95A629373ed2E8CFb5fEb",
"deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd",
"address": "0x6aF9C075d8C11b9A2CD66bbA801481b3c7A96488",
"implementation": "0x21BB37D5e02Ef479E34f6806C36a506c63741cc1",
"implementationCodehash": "0x25cc2857feace37fdf26f3021ac4af473923d6741611bacf7430f7e72ef99c65",
"deploymentMethod": "create3",
"salt": "AxelarGateway v6.2"
},
"AxelarGasService": {
"collector": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD",
"salt": "AxelarGasService",
"address": "0x47E840B35e0eca3E7C0577835DD78d95574873e7",
"implementation": "0x102A4324EA951BDd0105798C1fe31f8382EE1309",
"deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd"
},
"AxelarDepositService": {
"salt": "AxelarDepositService",
"address": "",
"implementation": "",
"deployer": "",
"wrappedSymbol": "",
"refundIssuer": "0x2517bA7a3E2cef54c1CD8618e7B0B661A7623817"
},
"ConstAddressDeployer": {
"address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e",
"deployer": "0xE86375704CDb8491a5Ed82D90DceCE02Ee0ac25F",
"deploymentMethod": "create",
"codehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe",
"predeployCodehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe"
},
"Create3Deployer": {
"address": "0x6513Aedb4D1593BA12e50644401D976aebDc90d8",
"deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"deploymentMethod": "create2",
"codehash": "0xf0ad66defbe082df243d4d274e626f557f97579c5c9e19f33d8093d6160808b7",
"predeployCodehash": "0x73fc31262c4bad113c79439fd231281201c7c7d45b50328bd86bccf37684bf92",
"salt": "Create3Deployer"
},
"Operators": {
"owner": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd",
"address": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD",
"deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd",
"deploymentMethod": "create2",
"codehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb",
"predeployCodehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb",
"salt": "Operators"
},
"Multisig": {
"threshold": 2,
"signers": [
"0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd",
"0xA24156B88D56696a7beE61A38deB5D8aaD8Ceb55",
"0x2517bA7a3E2cef54c1CD8618e7B0B661A7623817"
],
"address": "0x418FCD3890Ca73f5852eA727505f56396A644873",
"deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd",
"deploymentMethod": "create3",
"codehash": "0x912095d5076ee40a9dd49c0f9d61d61334c47a78c7512852791652baef26c296",
"predeployCodehash": "0x912095d5076ee40a9dd49c0f9d61d61334c47a78c7512852791652baef26c296",
"salt": "Multisig v5.5"
},
"InterchainGovernance": {
"minimumTimeDelay": 300,
"governanceChain": "Axelarnet",
"governanceAddress": "axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj",
"address": "0xf6c4679c0FdA9b4e49fCcfedCEE03a730d35E64D",
"deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd",
"deploymentMethod": "create3",
"codehash": "0xa8c5d3eab2aefc62e03bcf3c5e1db27cbce0e24d3f87d8dfbbb54676bfbf937c",
"predeployCodehash": "0xe2de43b29f2387b6f3575a1b50d566908fc00e03a8d88ad6be74b674a70874d2",
"salt": "InterchainGovernance v5.5"
}
}
}
},
"axelar": {
Expand Down
12 changes: 11 additions & 1 deletion evm/deploy-contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ async function processCommand(config, chain, options) {
const { env, artifactPath, contractName, deployMethod, privateKey, verify, yes } = options;
const verifyOptions = verify ? { env, chain: chain.name, only: verify === 'only' } : null;

if (!chain.contracts) {
chain.contracts = {};
}

const contracts = chain.contracts;

if (!contracts[contractName]) {
Expand Down Expand Up @@ -288,7 +292,13 @@ async function processCommand(config, chain, options) {
printInfo('Deployer contract', deployerContract);
printInfo(`${contractName} will be deployed to`, predictedAddress);

if (prompt(`Does derived address match existing deployments? Proceed with deployment on ${chain.name}?`, yes)) {
const existingAddress = config.chains.ethereum?.contracts?.[contractName]?.address;
if (existingAddress !== undefined && predictedAddress !== existingAddress) {
printWarn(`Predicted address ${predictedAddress} does not match existing deployment ${existingAddress} on chain ${chain.name}.`);
printWarn('For official deployment, recheck the deployer, salt, args, or contract bytecode.');
}

if (prompt(`Proceed with deployment on ${chain.name}?`, yes)) {
return;
}

Expand Down
18 changes: 14 additions & 4 deletions evm/deploy-gateway-v6.2.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ async function deploy(config, chain, options) {
const wallet = new Wallet(privateKey).connect(provider);
await printWalletInfo(wallet);

if (chain.contracts === undefined) {
chain.contracts = {};
}

if (chain.contracts[contractName] === undefined) {
chain.contracts[contractName] = {};
}
Expand All @@ -117,6 +121,9 @@ async function deploy(config, chain, options) {
if (!(await isContract(mintLimiter, provider))) {
printWarn('MintLimiter address is not a contract. This is optional for test deployments');
}

printInfo('Governance address', governance);
printInfo('MintLimiter address', mintLimiter);
}

const gatewayFactory = new ContractFactory(AxelarGateway.abi, AxelarGateway.bytecode, wallet);
Expand Down Expand Up @@ -161,7 +168,9 @@ async function deploy(config, chain, options) {

contractConfig.deployer = wallet.address;

if (reuseProxy && reuseHelpers) {
if (options.skipExisting && contractConfig.authModule) {
auth = authFactory.attach(contractConfig.authModule);
} else if (reuseProxy && reuseHelpers) {
auth = authFactory.attach(await gateway.authModule());
} else {
printInfo(`Deploying auth contract`);
Expand All @@ -180,7 +189,9 @@ async function deploy(config, chain, options) {
});
}

if (reuseProxy && reuseHelpers) {
if (options.skipExisting && contractConfig.tokenDeployer) {
tokenDeployer = tokenDeployerFactory.attach(contractConfig.tokenDeployer);
} else if (reuseProxy && reuseHelpers) {
tokenDeployer = tokenDeployerFactory.attach(await gateway.tokenDeployer());
} else {
printInfo(`Deploying token deployer contract`);
Expand Down Expand Up @@ -237,8 +248,6 @@ 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);
Expand Down Expand Up @@ -521,6 +530,7 @@ async function programHandler() {
program.addOption(new Option('--prevKeyIDs <prevKeyIDs>', 'previous key IDs to be used for auth contract'));
program.addOption(new Option('--offline', 'Run in offline mode'));
program.addOption(new Option('--nonceOffset <nonceOffset>', 'The value to add in local nonce if it deviates from actual wallet nonce'));
program.addOption(new Option('-x, --skipExisting', 'skip existing if contract was already deployed on chain'));

program.action((options) => {
main(options);
Expand Down
2 changes: 1 addition & 1 deletion evm/deploy-upgradable.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async function deploy(options, chain) {
const implArgs = await getImplementationArgs(contractName, contracts, options);
const gasOptions = contractConfig.gasOptions || chain.gasOptions || {};
printInfo(`Implementation args for chain ${chain.name}`, implArgs);
console.log(`Gas override for chain ${chain.name}: ${JSON.stringify(gasOptions)}`);
console.log(`Gas override for chain ${chain.name}: ${JSON.stringify(gasOptions, null, 2)}`);
const salt = options.salt || contractName;
let deployerContract = deployMethod === 'create3' ? contracts.Create3Deployer?.address : contracts.ConstAddressDeployer?.address;

Expand Down
133 changes: 133 additions & 0 deletions evm/legacy/ConstAddressDeployer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "ConstAddressDeployer",
"sourceName": "contracts/ConstAddressDeployer.sol",
"abi": [
{
"inputs": [],
"name": "EmptyBytecode",
"type": "error"
},
{
"inputs": [],
"name": "FailedDeploy",
"type": "error"
},
{
"inputs": [],
"name": "FailedInit",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "bytecodeHash",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "deployedAddress",
"type": "address"
}
],
"name": "Deployed",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "bytecode",
"type": "bytes"
},
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
}
],
"name": "deploy",
"outputs": [
{
"internalType": "address",
"name": "deployedAddress_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "bytecode",
"type": "bytes"
},
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "init",
"type": "bytes"
}
],
"name": "deployAndInit",
"outputs": [
{
"internalType": "address",
"name": "deployedAddress_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "bytecode",
"type": "bytes"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
}
],
"name": "deployedAddress",
"outputs": [
{
"internalType": "address",
"name": "deployedAddress_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506105a4806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80634af63f0214610046578063c2b1041c14610075578063cf4d643214610088575b600080fd5b6100596100543660046103f7565b61009b565b6040516001600160a01b03909116815260200160405180910390f35b610059610083366004610485565b6100da565b6100596100963660046104ee565b6101a9565b604080513360208201529081018290526000906100d39084906060015b6040516020818303038152906040528051906020012061026e565b9392505050565b604080516001600160a01b038416602082015290810182905260009081906060016040516020818303038152906040528051906020012090503081878760405161012592919061055e565b6040519081900381206101879392916020017fff00000000000000000000000000000000000000000000000000000000000000815260609390931b6bffffffffffffffffffffffff191660018401526015830191909152603582015260550190565b60408051601f1981840301815291905280516020909101209695505050505050565b604080513360208201529081018490526000906101ca9086906060016100b8565b90506000816001600160a01b031684846040516101e892919061055e565b6000604051808303816000865af19150503d8060008114610225576040519150601f19603f3d011682016040523d82523d6000602084013e61022a565b606091505b5050905080610265576040517f4f77232300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50949350505050565b60008251600014156102ac576040517f21744a5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818351602085016000f590506001600160a01b0381166102f8576040517f4102e83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825160208401206040516001600160a01b0383169184917f27b8e3132afa95254770e1c1d214eafde52bc47d1b6e1f5dfcbb380c3ca3f53290600090a492915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261037b57600080fd5b813567ffffffffffffffff808211156103965761039661033b565b604051601f8301601f19908116603f011681019082821181831017156103be576103be61033b565b816040528381528660208588010111156103d757600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561040a57600080fd5b823567ffffffffffffffff81111561042157600080fd5b61042d8582860161036a565b95602094909401359450505050565b60008083601f84011261044e57600080fd5b50813567ffffffffffffffff81111561046657600080fd5b60208301915083602082850101111561047e57600080fd5b9250929050565b6000806000806060858703121561049b57600080fd5b843567ffffffffffffffff8111156104b257600080fd5b6104be8782880161043c565b90955093505060208501356001600160a01b03811681146104de57600080fd5b9396929550929360400135925050565b6000806000806060858703121561050457600080fd5b843567ffffffffffffffff8082111561051c57600080fd5b6105288883890161036a565b955060208701359450604087013591508082111561054557600080fd5b506105528782880161043c565b95989497509550505050565b818382376000910190815291905056fea26469706673582212206a8d0537e27fe239a39d5ad8e5334db0447d0a1d7d49a7e82479baaa1319b39664736f6c63430008090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80634af63f0214610046578063c2b1041c14610075578063cf4d643214610088575b600080fd5b6100596100543660046103f7565b61009b565b6040516001600160a01b03909116815260200160405180910390f35b610059610083366004610485565b6100da565b6100596100963660046104ee565b6101a9565b604080513360208201529081018290526000906100d39084906060015b6040516020818303038152906040528051906020012061026e565b9392505050565b604080516001600160a01b038416602082015290810182905260009081906060016040516020818303038152906040528051906020012090503081878760405161012592919061055e565b6040519081900381206101879392916020017fff00000000000000000000000000000000000000000000000000000000000000815260609390931b6bffffffffffffffffffffffff191660018401526015830191909152603582015260550190565b60408051601f1981840301815291905280516020909101209695505050505050565b604080513360208201529081018490526000906101ca9086906060016100b8565b90506000816001600160a01b031684846040516101e892919061055e565b6000604051808303816000865af19150503d8060008114610225576040519150601f19603f3d011682016040523d82523d6000602084013e61022a565b606091505b5050905080610265576040517f4f77232300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50949350505050565b60008251600014156102ac576040517f21744a5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818351602085016000f590506001600160a01b0381166102f8576040517f4102e83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825160208401206040516001600160a01b0383169184917f27b8e3132afa95254770e1c1d214eafde52bc47d1b6e1f5dfcbb380c3ca3f53290600090a492915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261037b57600080fd5b813567ffffffffffffffff808211156103965761039661033b565b604051601f8301601f19908116603f011681019082821181831017156103be576103be61033b565b816040528381528660208588010111156103d757600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561040a57600080fd5b823567ffffffffffffffff81111561042157600080fd5b61042d8582860161036a565b95602094909401359450505050565b60008083601f84011261044e57600080fd5b50813567ffffffffffffffff81111561046657600080fd5b60208301915083602082850101111561047e57600080fd5b9250929050565b6000806000806060858703121561049b57600080fd5b843567ffffffffffffffff8111156104b257600080fd5b6104be8782880161043c565b90955093505060208501356001600160a01b03811681146104de57600080fd5b9396929550929360400135925050565b6000806000806060858703121561050457600080fd5b843567ffffffffffffffff8082111561051c57600080fd5b6105288883890161036a565b955060208701359450604087013591508082111561054557600080fd5b506105528782880161043c565b95989497509550505050565b818382376000910190815291905056fea26469706673582212206a8d0537e27fe239a39d5ad8e5334db0447d0a1d7d49a7e82479baaa1319b39664736f6c63430008090033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Loading

0 comments on commit d098371

Please sign in to comment.