Skip to content

Commit

Permalink
script for deploy proxy on mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
olga24912 committed Sep 10, 2024
1 parent 5d59591 commit 6dccd82
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions eth-custodian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ERC20_DECIMALS=

NEAR_RECIPIENT=${NEAR_ACCOUNT}
ETH_CUSTODIAN_PROXY=
CONFIG_NAME=ethereum-config

compile:
mkdir -p build/proofs && yarn hardhat compile
Expand All @@ -40,10 +41,10 @@ eth-deploy-contracts:
yarn hardhat run --network ${NETWORK} scripts/eth_deploy_contracts.js

eth-deploy-proxy:
yarn hardhat run --network ${NETWORK} scripts/eth_deploy_proxy.js
yarn hardhat --network ${NETWORK} eth-deploy-proxy --config-name ${CONFIG_NAME}

eth-upgrade-proxy:
yarn hardhat run --network ${NETWORK} scripts/eth_upgrade_proxy.js
yarn hardhat run --network ${NETWORK} scripts/eth_upgrade_proxy.js

update-admin-legacy:
yarn hardhat --network ${NETWORK} update-admin-legacy --new-admin ${ETH_CUSTODIAN_PROXY}
Expand Down
8 changes: 8 additions & 0 deletions eth-custodian/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ task('update-admin-legacy', 'Nominate new admin for Eth Custodian')
await updateAdminLegacy(hre.ethers.provider, taskArgs.newAdmin);
});

task('eth-deploy-proxy', 'Deploy Eth Custodian Proxy')
.addParam('configName', 'File name without extension for the config')
.setAction(async taskArgs => {
const { deployEthProxy } = require('./scripts/eth_deploy_proxy');
const ethereumConfig = require(`./scripts/json/${taskArgs.configName}.json`);
await deployEthProxy(ethereumConfig);
});

task('nominate-admin', 'Nominate new admin for Eth Custodian')
.addParam('newAdmin', 'Eth address of new admin')
.setAction(async taskArgs => {
Expand Down
13 changes: 2 additions & 11 deletions eth-custodian/scripts/eth_deploy_proxy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const hre = require('hardhat');

const ethereumConfig = require('./json/ethereum-config.json');

async function main() {
async function deployEthProxy(ethereumConfig) {
const [deployerAccount] = await hre.ethers.getSigners();

console.log(`Deploying proxy with the account: ${deployerAccount.address}`);
Expand All @@ -20,11 +18,4 @@ async function main() {
console.log(`Next, proxy must be made the admin of EthCustodian. The existing admin needs to first call nominateAdmin and then acceptAdmin on EthCustodian passing the proxy address`);
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});
exports.deployEthProxy = deployEthProxy;
5 changes: 3 additions & 2 deletions eth-custodian/scripts/json/ethereum-config-mainnet.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"proverAddress": "0x051ad3f020274910065dcb421629cd2e6e5b46c4",
"clientAddress": "0x0151568af92125fb289f1dd81d9d8f7484efc362",
"clientAddress": "0x3FEFc5A4B1c02f21cBc8D3613643ba0635b9a873",
"ethConnectorAddress": "0x6BFaD42cFC4EfC96f529D786D643Ff4A8B89FA52",
"nearEvmAccount": "aurora",
"bridgeFactoryAccount": "factory.bridge.near"
"bridgeFactoryAccount": "factory.bridge.near",
"proxyAddress": "TODO"
}

0 comments on commit 6dccd82

Please sign in to comment.