Skip to content

Commit

Permalink
Merge branch 'main' into refactor/factory-imports-verify-script
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth authored Oct 19, 2023
2 parents 5f105fc + a95932c commit 1e566a9
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 72 deletions.
2 changes: 1 addition & 1 deletion axelar-chains-config/info/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"name": "Binance",
"id": "binance",
"chainId": 56,
"rpc": "https://bscrpc.com",
"rpc": "https://1rpc.io/bnb",
"tokenSymbol": "BNB",
"wrappedSymbol": "WBNB",
"contracts": {
Expand Down
8 changes: 4 additions & 4 deletions evm/check-wallet-balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}
}
Expand Down
File renamed without changes.
17 changes: 16 additions & 1 deletion evm/governance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
124 changes: 124 additions & 0 deletions evm/nonces.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
4 changes: 4 additions & 0 deletions evm/send-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ async function processCommand(_, chain, options) {
value: amount,
};

if (!offline && chain.name.toLowerCase() === 'binance') {
tx.gasPrice = (await provider.getGasPrice()) * 1.2;
}

const { baseTx, signedTx } = await signTransaction(wallet, chain, tx, options);

if (offline) {
Expand Down
6 changes: 3 additions & 3 deletions evm/sign-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion evm/update-nonces.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit 1e566a9

Please sign in to comment.