Skip to content

Commit

Permalink
Merge branch 'feat/instantiate-governance' into feat/fetch-codeId
Browse files Browse the repository at this point in the history
  • Loading branch information
eguajardo committed Jul 19, 2024
2 parents 485e5dd + 834ea54 commit ed5f24e
Show file tree
Hide file tree
Showing 19 changed files with 1,064 additions and 685 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ local.json
keys.json

temp-arguments.js

# Sui Move Packages
sui/move
2 changes: 1 addition & 1 deletion axelar-chains-config/info/devnet-amplifier.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"Router": {
"adminAddress": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9",
"governanceAddress": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9",
"codeId": 498,
"codeId": 509,
"address": "axelar14jjdxqhuxk803e9pq64w4fgf385y86xxhkpzswe9crmu6vxycezst0zq8y"
},
"Multisig": {
Expand Down
2 changes: 1 addition & 1 deletion axelar-chains-config/info/devnet-verifiers.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
"Router": {
"adminAddress": "axelar19vvhwq57656hqfczhxw3r874l29jtd3uns4fsu",
"governanceAddress": "axelar19vvhwq57656hqfczhxw3r874l29jtd3uns4fsu",
"codeId": 45,
"codeId": 49,
"address": "axelar1q3g7fdqfpftqfpuakwn7x037k80wv35jj9ged7v5e798pds7hnasgj6azz"
},
"Multisig": {
Expand Down
20 changes: 20 additions & 0 deletions axelar-chains-config/info/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@
"deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"implementation": "0xA852412D2d91fE05d790934B6E64C3C351fAB54f",
"address": "0x83a93500d23Fbc3e82B410aD07A6a9F7A0670D66"
},
"AxelarTransceiver": {
"salt": "AXELAR_TRANSCEIVER v1.1.0",
"deployer": "0xba76c6980428A0b10CFC5d8ccb61949677A61233",
"implementation": "0x87fc4b27385bb4e69a40027931229d74ef4d1943",
"address": "0x723AEAD29acee7E9281C32D11eA4ed0070c41B13",
"TransceiverStructs": "0xa12bc993d8144404a8c8c812816048275a066ced",
"wstETH token": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
"NttManager": "0xb948a93827d68a82F6513Ad178964Da487fe2BD9",
"wormholeChainId": 2
}
},
"explorer": {
Expand Down Expand Up @@ -733,6 +743,16 @@
"deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"implementation": "0xA852412D2d91fE05d790934B6E64C3C351fAB54f",
"address": "0x83a93500d23Fbc3e82B410aD07A6a9F7A0670D66"
},
"AxelarTransceiver": {
"salt": "AXELAR_TRANSCEIVER v1.1.0",
"deployer": "0xba76c6980428A0b10CFC5d8ccb61949677A61233",
"implementation": "0xa1ebb6a4b856df8bf6c3aca88a9115a9ab3b2e02",
"address": "0x723AEAD29acee7E9281C32D11eA4ed0070c41B13",
"TransceiverStructs": "0x27a3daf3b243104e9b0afae6b56026a416b852c9",
"wstETH token": "0x26c5e01524d2E6280A48F2c50fF6De7e52E9611C",
"NttManager": "0x6981F5621691CBfE3DdD524dE71076b79F0A0278",
"wormholeChainId": 4
}
},
"explorer": {
Expand Down
20 changes: 20 additions & 0 deletions axelar-chains-config/info/testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@
"deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"implementation": "0xA852412D2d91fE05d790934B6E64C3C351fAB54f",
"address": "0x83a93500d23Fbc3e82B410aD07A6a9F7A0670D66"
},
"AxelarTransceiver": {
"salt": "Transceiver 1.1.0",
"deployer": "0xc28a80699B5914a29465971E6ac5a40370C4f29b",
"implementation": "0xcc6e5c994de73e8a115263b1b512e29b2026df55",
"address": "0xaa8267908e8d2BEfeB601f88A7Cf3ec148039423",
"TransceiverStructs": "0x1ed363be5e925e0f0741207f3f9a48c366d26aba",
"wstETH token": "0xB82381A3fBD3FaFA77B3a7bE693342618240067b",
"NttManager": "0x8B715EAf61A7DdF61C67d5D46687c796D1f47146",
"wormholeChainId": 10002
}
},
"explorer": {
Expand Down Expand Up @@ -558,6 +568,16 @@
"deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05",
"implementation": "0xA852412D2d91fE05d790934B6E64C3C351fAB54f",
"address": "0x83a93500d23Fbc3e82B410aD07A6a9F7A0670D66"
},
"AxelarTransceiver": {
"salt": "Transceiver 1.1.0",
"deployer": "0xc28a80699B5914a29465971E6ac5a40370C4f29b",
"implementation": "0x4fe90d921e279f149ee7c7e1a79ee75803e846b1",
"address": "0xaa8267908e8d2BEfeB601f88A7Cf3ec148039423",
"TransceiverStructs": "0xeecf56798cfc9e927a83f98b0112484623cf175a",
"wstETH token": "0x0B15635FCF5316EdFD2a9A0b0dC3700aeA4D09E6",
"NttManager": "0x66Cb5a992570EF01b522Bc59A056a64A84Bd0aAa",
"wormholeChainId": 4
}
},
"explorer": {
Expand Down
28 changes: 20 additions & 8 deletions evm/deploy-amplifier-gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
ContractFactory,
Contract,
Wallet,
utils: { defaultAbiCoder, getContractAddress, keccak256, hexlify },
utils: { defaultAbiCoder, keccak256, hexlify },
getDefaultProvider,
} = ethers;

Expand All @@ -26,6 +26,8 @@ const {
getContractConfig,
isString,
getWeightedSigners,
getContractJSON,
getDeployedAddress,
} = require('./utils');
const { calculateDomainSeparator, isValidCosmosAddress } = require('../cosmwasm/utils');
const { addExtendedOptions } = require('./cli-utils');
Expand Down Expand Up @@ -107,7 +109,7 @@ async function deploy(config, chain, options) {

if (owner !== wallet.address) {
printWarn(
'Governance address is not set to the wallet address. This is needed for official deployment and is transferred after deployment',
'Owner address is not set to the wallet address. This is needed for official deployment and is transferred after deployment',
);
}

Expand All @@ -120,6 +122,7 @@ async function deploy(config, chain, options) {

const deployerContract =
options.deployMethod === 'create3' ? chain.contracts.Create3Deployer?.address : chain.contracts.ConstAddressDeployer?.address;
const salt = options.salt || 'AxelarAmplifierGateway';

let gateway;
let proxyAddress;
Expand All @@ -134,11 +137,20 @@ async function deploy(config, chain, options) {
printInfo('Reusing Gateway Proxy address', proxyAddress);
gateway = gatewayFactory.attach(proxyAddress);
} else {
const transactionCount = await wallet.getTransactionCount();
proxyAddress = getContractAddress({
from: wallet.address,
nonce: transactionCount + 1,
if (options.deployMethod === 'create2') {
// TODO: support create2 prediction
printError('create2 prediction is not supported yet');
}

proxyAddress = await getDeployedAddress(wallet.address, options.deployMethod, {
salt,
deployerContract,
contractJson: getContractJSON('AxelarAmplifierGatewayProxy'),
constructorArgs: [], // TODO: populate constructor args for create2 prediction to work
provider: wallet.provider,
nonce: (await wallet.getTransactionCount()) + 1,
});

printInfo('Predicted gateway proxy address', proxyAddress, chalk.cyan);
}

Expand All @@ -155,6 +167,7 @@ async function deploy(config, chain, options) {
if (existingAddress !== undefined && proxyAddress !== existingAddress) {
printWarn(`Predicted address ${proxyAddress} does not match existing deployment ${existingAddress} in chain configs.`);
printWarn('For official deployment, recheck the deployer, salt, args, or contract bytecode.');
printWarn('This is NOT required if the deployments are done by different integrators');
}

if (predictOnly || prompt(`Does derived address match existing gateway deployments? Proceed with deployment on ${chain.name}?`, yes)) {
Expand All @@ -164,7 +177,6 @@ async function deploy(config, chain, options) {
contractConfig.deployer = wallet.address;
const domainSeparator = await getDomainSeparator(config, chain, options);
const minimumRotationDelay = Number(options.minimumRotationDelay);
const salt = options.salt || 'AxelarAmplifierGateway';

printInfo(`Deploying gateway implementation contract`);
printInfo('Gateway Implementation args', `${options.previousSignersRetention}, ${domainSeparator}, ${minimumRotationDelay}`);
Expand Down Expand Up @@ -235,7 +247,7 @@ async function deploy(config, chain, options) {
printInfo(`Existing owner`, ownerAddress);

if (!reuseProxy && owner !== ownerAddress) {
printError(`ERROR: Retrieved governance address is different:`);
printError(`ERROR: Retrieved owner address is different:`);
printError(` Actual: ${ownerAddress}`);
printError(` Expected: ${owner}`);
error = true;
Expand Down
Loading

0 comments on commit ed5f24e

Please sign in to comment.