diff --git a/evm/check-wallet-balance.js b/evm/check-wallet-balance.js index f9385e95..2177c83e 100644 --- a/evm/check-wallet-balance.js +++ b/evm/check-wallet-balance.js @@ -22,22 +22,22 @@ async function processCommand(_, chain, options) { const gasLimit = BigNumber.from(staticGasOptions.gasLimit); const gasPrice = BigNumber.from(staticGasOptions.gasPrice); - const minRequiredBalance = gasLimit * gasPrice; + const minRequiredBalance = gasLimit * gasPrice * 1.5; const nonceData = getNonceFileData(); const nonces = nonceData[options.env][chainName]; if (addresses) { addresses = JSON.parse(addresses); } else { - addresses = Object.entries(nonces); + addresses = Object.keys(nonces); } for (const address of addresses) { const balance = await provider.getBalance(address); if (balance < minRequiredBalance) { - printError('Minimum required Balance is', `${minRequiredBalance / 1e18}`); - printError(`Wallet Balance for address ${address} is`, `${balance / 1e18}`); + printError(`${chain.name} minimum required Balance`, `${minRequiredBalance / 1e18}`); + printError(`${chain.name} Wallet Balance for ${address} is`, `${balance / 1e18}`); } } } diff --git a/evm/governance.js b/evm/governance.js index 4eff3b4a..64c456f2 100644 --- a/evm/governance.js +++ b/evm/governance.js @@ -30,6 +30,8 @@ const { getWallet } = require('./sign-utils.js'); const IGovernance = require('@axelar-network/axelar-gmp-sdk-solidity/interfaces/IAxelarServiceGovernance.json'); const IGateway = require('@axelar-network/axelar-gmp-sdk-solidity/interfaces/IAxelarGateway.json'); +let proposals = []; + async function getGatewaySetupParams(governance, gateway, contracts, options) { const currGovernance = await gateway.governance(); const currMintLimiter = await gateway.mintLimiter(); @@ -527,13 +529,26 @@ async function processCommand(_, chain, options) { ], }; + // Print all proposals together + proposals.push(proposal.contract_calls[0]); + // printInfo('Proposal', JSON.stringify(proposal, null, 2)); - console.log(JSON.stringify(proposal.contract_calls[0])); + // console.log(JSON.stringify(proposal.contract_calls[0])); } } async function main(options) { + proposals = []; + await mainProcessor(options, processCommand); + + const proposal = { + title: 'Interchain Governance Proposal', + description: 'Interchain Governance Proposal', + contract_calls: proposals, + }; + + printInfo('Proposal', JSON.stringify(proposal, null, 2)); } const program = new Command(); diff --git a/evm/nonces.json b/evm/nonces.json new file mode 100644 index 00000000..43d5ea23 --- /dev/null +++ b/evm/nonces.json @@ -0,0 +1,124 @@ +{ + "mainnet": { + "ethereum": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 15, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 15, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 11, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 2, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 13 + }, + "avalanche": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 11, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 11, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 8, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 1, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 10 + }, + "fantom": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 11, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 11, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 7, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 1, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 10 + }, + "polygon": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 13, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 13, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 9, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 3, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 1, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 10 + }, + "moonbeam": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 10, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 10, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 8, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 1, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 9 + }, + "binance": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 10, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 10, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 7, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 4, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 8 + }, + "arbitrum": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 4, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 4, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 2, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 3, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 3 + }, + "celo": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 1, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 1, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 0, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 1, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 1 + }, + "kava": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 2, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 1, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 2, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 1, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 2 + }, + "filecoin": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 0, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 0, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 0, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 0, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 0 + }, + "optimism": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 0, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 0, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 0, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 0, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 0 + }, + "linea": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 0, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 0, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 0, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 0, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 0 + }, + "base": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 0, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 0, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 0, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 0, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 0 + }, + "mantle": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 0, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 0, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 0, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 0, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 0 + }, + "scroll": { + "0x3f5876a2b06E54949aB106651Ab6694d0289b2b4": 0, + "0x9256Fd872118ed3a97754B0fB42c15015d17E0CC": 0, + "0x1486157d505C7F7E546aD00E3E2Eee25BF665C9b": 0, + "0x2eC991B5c0B742AbD9d2ea31fe6c14a85e91C821": 0, + "0xf505462A29E36E26f25Ef0175Ca1eCBa09CC118f": 0, + "0x027c1882B975E2cd771AE068b0389FA38B9dda73": 0 + } + } +} diff --git a/evm/sign-utils.js b/evm/sign-utils.js index 6f716a6d..60574d78 100644 --- a/evm/sign-utils.js +++ b/evm/sign-utils.js @@ -121,7 +121,7 @@ const signTransaction = async (wallet, chain, tx, options = {}) => { } if (!options.offline) { - await sendTransaction(signedTx, wallet.provider); + await sendTransaction(signedTx, wallet.provider, chain.confirmations); } return { baseTx: tx, signedTx }; @@ -254,7 +254,7 @@ function isValidJSON(obj) { } const getNonceFileData = () => { - const filePath = `${__dirname}/../axelar-chains-config/info/nonces.json`; + const filePath = `${__dirname}/nonces.json`; const emptyData = {}; const data = getFileData(filePath); @@ -286,7 +286,7 @@ function createFileIfNotExists(filePath) { } const updateNonceFileData = (nonceData) => { - const filePath = `${__dirname}/../axelar-chains-config/info/nonces.json`; + const filePath = `${__dirname}/nonces.json`; createFileIfNotExists(filePath); // Write nonceData to the file diff --git a/evm/update-nonces.js b/evm/update-nonces.js index ab043b3f..6c740ea6 100644 --- a/evm/update-nonces.js +++ b/evm/update-nonces.js @@ -37,7 +37,7 @@ async function processCommand(_, chain, options) { } for (const address of addresses) { - printInfo('Updating nonce for address', address); + printInfo(`Updating nonce on ${chain.name} for address`, address); const nonce = await getNonceFromProvider(provider, address); chainNonceData[address] = nonce; }