From 62a0a94062e685fd0a5f64eaacdfc036ff8cc5ef Mon Sep 17 00:00:00 2001 From: Marccio Silva Date: Thu, 26 Aug 2021 14:51:56 -0300 Subject: [PATCH] Add proxies as named accounts, check if they exist before deploying them in migrations, refactor associated files (having added Prettier config for JS files) --- bridge/.prettierrc.json | 26 ++ bridge/deploy/01_deploy_multiSigWallet.js | 23 +- bridge/deploy/02_deploy_proxyAdmin.js | 22 +- bridge/deploy/08_deploy_bridgeProxy.js | 61 ++- bridge/deploy/21_deploy_allowTokens.js | 484 ++++++++++++---------- bridge/deploy/22_deploy_federation.js | 108 ++--- bridge/hardhat.config.js | 156 ++++--- 7 files changed, 492 insertions(+), 388 deletions(-) create mode 100644 bridge/.prettierrc.json diff --git a/bridge/.prettierrc.json b/bridge/.prettierrc.json new file mode 100644 index 000000000..99846c41a --- /dev/null +++ b/bridge/.prettierrc.json @@ -0,0 +1,26 @@ +{ + "overrides": [ + { + "files": "*.sol", + "options": { + "printWidth": 80, + "tabWidth": 4, + "useTabs": false, + "singleQuote": false, + "bracketSpacing": false, + "explicitTypes": "always" + } + }, + { + "files": "*.js", + "options": { + "parser": "json5", + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false + } + } + ] +} \ No newline at end of file diff --git a/bridge/deploy/01_deploy_multiSigWallet.js b/bridge/deploy/01_deploy_multiSigWallet.js index 99f2b3fc8..f8c286b79 100644 --- a/bridge/deploy/01_deploy_multiSigWallet.js +++ b/bridge/deploy/01_deploy_multiSigWallet.js @@ -1,17 +1,14 @@ -const { deploy1820 } = require('@thinkanddev/deploy-eip-1820-web3-rsk') +const { deploy1820 } = require("@thinkanddev/deploy-eip-1820-web3-rsk"); -module.exports = async function ({getNamedAccounts, deployments, network}) { // HardhatRuntimeEnvironment - const {deployer, multiSig} = await getNamedAccounts() - const {deploy, log} = deployments +module.exports = async function({ getNamedAccounts, deployments, network }) { // HardhatRuntimeEnvironment + const { deployer, multiSig } = await getNamedAccounts(); + const { deploy, log } = deployments; if (!multiSig) { - const deployResult = await deploy('MultiSigWallet', { + const deployResult = await deploy("MultiSigWallet", { from: deployer, - args: [ - [deployer], - 1 - ], - log: true, + args: [[deployer], 1], + log: true }); if (deployResult.newlyDeployed) { @@ -23,6 +20,6 @@ module.exports = async function ({getNamedAccounts, deployments, network}) { // if (!network.live) { await deploy1820(web3); } -} -module.exports.id = 'deploy_multiSigWallet'; // id required to prevent reexecution -module.exports.tags = ['MultiSigWallet']; +}; +module.exports.id = "deploy_multiSigWallet"; // id required to prevent reexecution +module.exports.tags = ["MultiSigWallet"]; diff --git a/bridge/deploy/02_deploy_proxyAdmin.js b/bridge/deploy/02_deploy_proxyAdmin.js index c7496c692..23d1fa27e 100644 --- a/bridge/deploy/02_deploy_proxyAdmin.js +++ b/bridge/deploy/02_deploy_proxyAdmin.js @@ -1,9 +1,9 @@ -module.exports = async function ({getNamedAccounts, deployments}) { // HardhatRuntimeEnvironment - const {deployer, multiSig, proxyAdmin} = await getNamedAccounts() - const {deploy, log, execute} = deployments +module.exports = async function({ getNamedAccounts, deployments }) { // HardhatRuntimeEnvironment + const { deployer, multiSig, proxyAdmin } = await getNamedAccounts(); + const { deploy, log, execute } = deployments; if (!proxyAdmin) { - const deployResult = await deploy('ProxyAdmin', { + const deployResult = await deploy("ProxyAdmin", { from: deployer, log: true, }); @@ -12,14 +12,12 @@ module.exports = async function ({getNamedAccounts, deployments}) { // HardhatRu log( `Contract ProxyAdmin deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed.toString()} gas` ); - const MultiSigWallet = await deployments.get('MultiSigWallet'); - await execute('ProxyAdmin', {from: deployer}, 'transferOwnership', multiSig ?? MultiSigWallet.address); - log( - `Transfered Ownership to MultiSig` - ); + const MultiSigWallet = await deployments.get("MultiSigWallet"); + await execute("ProxyAdmin", { from: deployer }, "transferOwnership", multiSig ?? MultiSigWallet.address); + log(`Transfered Ownership to MultiSig`); } } }; -module.exports.id = 'deploy_proxyAdmin'; // id required to prevent reexecution -module.exports.tags = ['ProxyAdmin']; -module.exports.dependencies = ['MultiSigWallet']; +module.exports.id = "deploy_proxyAdmin"; // id required to prevent reexecution +module.exports.tags = ["ProxyAdmin"]; +module.exports.dependencies = ["MultiSigWallet"]; diff --git a/bridge/deploy/08_deploy_bridgeProxy.js b/bridge/deploy/08_deploy_bridgeProxy.js index 29d4d9b64..0f6362e6e 100644 --- a/bridge/deploy/08_deploy_bridgeProxy.js +++ b/bridge/deploy/08_deploy_bridgeProxy.js @@ -1,43 +1,40 @@ -module.exports = async function ({getNamedAccounts, deployments, network}) { // HardhatRuntimeEnvironment - const {deployer, multiSig, proxyAdmin} = await getNamedAccounts() - const {deploy, log} = deployments +module.exports = async function({ getNamedAccounts, deployments, network }) { // HardhatRuntimeEnvironment + const { deployer, multiSig, proxyAdmin, bridgeProxy } = await getNamedAccounts(); + const { deploy, log } = deployments; - let symbol = 'e'; - if(network.name == 'rskregtest' || network.name == 'rsktestnet' || network.name == 'rskmainnet') - symbol = 'r' + if (!bridgeProxy) { + let symbol = "e"; + if (network.name === "rskregtest" || network.name === "rsktestnet" || network.name === "rskmainnet") { + symbol = "r"; + } - const MultiSigWallet = await deployments.get('MultiSigWallet'); - const ProxyAdmin = await deployments.get('ProxyAdmin'); - const Federation_old = await deployments.get('Federation_old'); - const AllowTokens_old = await deployments.get('AllowTokens_old'); - const SideTokenFactory_old = await deployments.get('SideTokenFactory_old'); + const MultiSigWallet = await deployments.get("MultiSigWallet"); + const ProxyAdmin = await deployments.get("ProxyAdmin"); + const Federation_old = await deployments.get("Federation_old"); + const AllowTokens_old = await deployments.get("AllowTokens_old"); + const SideTokenFactory_old = await deployments.get("SideTokenFactory_old"); - const Bridge_old = await deployments.get('Bridge_old'); + const Bridge_old = await deployments.get("Bridge_old"); const bridge = new web3.eth.Contract(Bridge_old.abi, Bridge_old.address); const methodCall = bridge.methods.initialize( - multiSig ?? MultiSigWallet.address, - Federation_old.address, - AllowTokens_old.address, - SideTokenFactory_old.address, - symbol + multiSig ?? MultiSigWallet.address, + Federation_old.address, + AllowTokens_old.address, + SideTokenFactory_old.address, + symbol ); - await methodCall.call({ from: deployer }) + await methodCall.call({ from: deployer }); - const deployProxyResult = await deploy('BridgeProxy', { - from: deployer, - args: [ - Bridge_old.address, - proxyAdmin ?? ProxyAdmin.address, - methodCall.encodeABI() - ], - log: true, + const deployProxyResult = await deploy("BridgeProxy", { + from: deployer, + args: [Bridge_old.address, proxyAdmin ?? ProxyAdmin.address, methodCall.encodeABI()], + log: true }); if (deployProxyResult.newlyDeployed) { - log( - `Contract BridgeProxy deployed at ${deployProxyResult.address} using ${deployProxyResult.receipt.gasUsed.toString()} gas` - ); + log(`Contract BridgeProxy deployed at ${deployProxyResult.address} using ${deployProxyResult.receipt.gasUsed.toString()} gas`); } + } }; -module.exports.id = 'deploy_bridgeProxy'; // id required to prevent reexecution -module.exports.tags = ['BridgeProxy', 'old']; -module.exports.dependencies = ['Bridge_old', 'MultiSigWallet', 'ProxyAdmin','Federation_old', 'AllowTokens_old', 'SideTokenFactory_old']; +module.exports.id = "deploy_bridgeProxy"; // id required to prevent reexecution +module.exports.tags = ["BridgeProxy", "old"]; +module.exports.dependencies = ["Bridge_old", "MultiSigWallet", "ProxyAdmin", "Federation_old", "AllowTokens_old", "SideTokenFactory_old"]; diff --git a/bridge/deploy/21_deploy_allowTokens.js b/bridge/deploy/21_deploy_allowTokens.js index 328afa8ea..fabb9c8b8 100644 --- a/bridge/deploy/21_deploy_allowTokens.js +++ b/bridge/deploy/21_deploy_allowTokens.js @@ -1,268 +1,298 @@ -//We are actually gona use the latest Bridge but truffle only knows the address of the proxy +//We are actually gonna use the latest Bridge but truffle only knows the address of the proxy const toWei = web3.utils.toWei; const deployHelper = require("../deployed/deployHelper"); -module.exports = async function ({getNamedAccounts, deployments}) { // HardhatRuntimeEnvironment - const {deployer, multiSig, proxyAdmin} = await getNamedAccounts() - const {deploy, log} = deployments +module.exports = async function({ getNamedAccounts, deployments }) { // HardhatRuntimeEnvironment + const { deployer, multiSig, proxyAdmin, allowTokensProxy } = await getNamedAccounts(); + const { deploy, log } = deployments; - const deployResult = await deploy('AllowTokens', { - from: deployer, - log: true, - }); + const deployResult = await deploy("AllowTokens", { + from: deployer, + log: true + }); - if (deployResult.newlyDeployed) { - log( - `Contract AllowTokens deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed.toString()} gas` - ); - } + if (deployResult.newlyDeployed) { + log( + `Contract AllowTokens deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed.toString()} gas` + ); + } - const AllowTokens = await deployments.get('AllowTokens'); - const ProxyAdmin = await deployments.get('ProxyAdmin'); - const BridgeProxy = await deployments.get('BridgeProxy'); + const AllowTokens = await deployments.get("AllowTokens"); + const ProxyAdmin = await deployments.get("ProxyAdmin"); + const BridgeProxy = await deployments.get("BridgeProxy"); - const deployedJson = deployHelper.getDeployed(network.name); - deployedJson.smallAmountConfirmations = deployedJson.smallAmountConfirmations || '0'; - deployedJson.mediumAmountConfirmations = deployedJson.mediumAmountConfirmations || '0'; - deployedJson.largeAmountConfirmations = deployedJson.largeAmountConfirmations || '0'; + const deployedJson = deployHelper.getDeployed(network.name); + deployedJson.smallAmountConfirmations = deployedJson.smallAmountConfirmations || "0"; + deployedJson.mediumAmountConfirmations = deployedJson.mediumAmountConfirmations || "0"; + deployedJson.largeAmountConfirmations = deployedJson.largeAmountConfirmations || "0"; - const typesInfo = network.name == 'rskmainnet' || network.name == 'ethmainnet' + const typesInfo = network.name == "rskmainnet" || network.name == "ethmainnet" ? tokensTypesMainnet() : tokensTypesTestnet(); - const allowTokensLogic = new web3.eth.Contract(AllowTokens.abi, AllowTokens.address) - const methodCall = allowTokensLogic.methods.initialize( - deployer, - BridgeProxy.address, - deployedJson.smallAmountConfirmations, - deployedJson.mediumAmountConfirmations, - deployedJson.largeAmountConfirmations, - typesInfo - ); - methodCall.call({ from: deployer }); + const allowTokensLogic = new web3.eth.Contract(AllowTokens.abi, AllowTokens.address); + const methodCall = allowTokensLogic.methods.initialize( + deployer, + BridgeProxy.address, + deployedJson.smallAmountConfirmations, + deployedJson.mediumAmountConfirmations, + deployedJson.largeAmountConfirmations, + typesInfo + ); + methodCall.call({ from: deployer }); - const deployResultProxy = await deploy('AllowTokensProxy', { - from: deployer, - args: [ - AllowTokens.address, - proxyAdmin ?? ProxyAdmin.address, - methodCall.encodeABI() - ], - log: true, - }); + if (!allowTokensProxy) { + const deployResultProxy = await deploy("AllowTokensProxy", { + from: deployer, + args: [ + AllowTokens.address, + proxyAdmin ?? ProxyAdmin.address, + methodCall.encodeABI() + ], + log: true + }); if (deployResultProxy.newlyDeployed) { log( `Contract AllowTokensProxy deployed at ${deployResultProxy.address} using ${deployResultProxy.receipt.gasUsed.toString()} gas` ); } + } - const AllowTokensProxy = await deployments.get('AllowTokensProxy'); - const allowTokens = new web3.eth.Contract(AllowTokens.abi, AllowTokensProxy.address) + const AllowTokensProxy = await deployments.get("AllowTokensProxy"); + const allowTokens = new web3.eth.Contract(AllowTokens.abi, AllowTokensProxy.address); - if (network.name == 'rsktestnet') { - await setTokensRskTestnet(allowTokens, deployer); - } - if (network.name == 'kovan') { - await setTokensKovan(allowTokens, deployer); - } - if (network.name == 'rskmainnet') { - await setTokensRskMainnet(allowTokens, deployer); - } - if (network.name == 'ethmainnet') { - await setTokensEthereum(allowTokens, deployer); - } - log(`AllowTokens Setted Tokens`); + if (network.name === "rsktestnet") { + await setTokensRskTestnet(allowTokens, deployer); + } + if (network.name === "kovan") { + await setTokensKovan(allowTokens, deployer); + } + if (network.name === "rskmainnet") { + await setTokensRskMainnet(allowTokens, deployer); + } + if (network.name === "ethmainnet") { + await setTokensEthereum(allowTokens, deployer); + } + log(`AllowTokens Setted Tokens`); - const MultiSigWallet = await deployments.get('MultiSigWallet'); - //Set multisig as the owner - await allowTokens.methods.transferOwnership(multiSig ?? MultiSigWallet.address).send({ from: deployer }); - log( - `AllowTokens Transfered Ownership to MultiSigWallet` - ); + const MultiSigWallet = await deployments.get("MultiSigWallet"); + //Set multisig as the owner + await allowTokens.methods.transferOwnership(multiSig ?? MultiSigWallet.address).send({ from: deployer }); + log( + `AllowTokens Transfered Ownership to MultiSigWallet` + ); }; -module.exports.id = 'deploy_allowTokens'; // id required to prevent reexecution -module.exports.tags = ['AllowTokens', 'new']; -module.exports.dependencies = ['MultiSigWallet', 'ProxyAdmin', 'BridgeProxy']; +module.exports.id = "deploy_allowTokens"; // id required to prevent reexecution +module.exports.tags = ["AllowTokens", "new"]; +module.exports.dependencies = ["MultiSigWallet", "ProxyAdmin", "BridgeProxy"]; function tokensTypesMainnet() { - return [ - { description: 'BTC', limits: { - min:toWei('0.0001'), - max:toWei('25'), - daily:toWei('100'), - mediumAmount:toWei('0.1'), - largeAmount:toWei('1') } - }, - { description: 'ETH', limits: { - min:toWei('0.005'), - max:toWei('750'), - daily:toWei('3000'), - mediumAmount:toWei('3'), - largeAmount:toWei('30') } - }, - { description: '<1000usd', limits: { - min:toWei('0.01'), - max:toWei('2500'), - daily:toWei('5000'), - mediumAmount:toWei('10'), - largeAmount:toWei('100') } - }, - { description: '<100usd', limits: { - min:toWei('0.1'), - max:toWei('25000'), - daily:toWei('50000'), - mediumAmount:toWei('100'), - largeAmount:toWei('1000') } - }, - { description: '=1usd', limits: { - min:toWei('10'), - max:toWei('2500000'), - daily:toWei('5000000'), - mediumAmount:toWei('10000'), - largeAmount:toWei('100000') } - }, - { description: '<1usd', limits: { - min:toWei('1000'), - max:toWei('250000000'), - daily:toWei('500000000'), - mediumAmount:toWei('1000000'), - largeAmount:toWei('10000000') } - }, - { description: '<1cent', limits: { - min:toWei('100000'), - max:toWei('25000000000'), - daily:toWei('50000000000'), - mediumAmount:toWei('100000000'), - largeAmount:toWei('1000000000') } - }, - ] + return [ + { + description: "BTC", limits: { + min: toWei("0.0001"), + max: toWei("25"), + daily: toWei("100"), + mediumAmount: toWei("0.1"), + largeAmount: toWei("1") + } + }, + { + description: "ETH", limits: { + min: toWei("0.005"), + max: toWei("750"), + daily: toWei("3000"), + mediumAmount: toWei("3"), + largeAmount: toWei("30") + } + }, + { + description: "<1000usd", limits: { + min: toWei("0.01"), + max: toWei("2500"), + daily: toWei("5000"), + mediumAmount: toWei("10"), + largeAmount: toWei("100") + } + }, + { + description: "<100usd", limits: { + min: toWei("0.1"), + max: toWei("25000"), + daily: toWei("50000"), + mediumAmount: toWei("100"), + largeAmount: toWei("1000") + } + }, + { + description: "=1usd", limits: { + min: toWei("10"), + max: toWei("2500000"), + daily: toWei("5000000"), + mediumAmount: toWei("10000"), + largeAmount: toWei("100000") + } + }, + { + description: "<1usd", limits: { + min: toWei("1000"), + max: toWei("250000000"), + daily: toWei("500000000"), + mediumAmount: toWei("1000000"), + largeAmount: toWei("10000000") + } + }, + { + description: "<1cent", limits: { + min: toWei("100000"), + max: toWei("25000000000"), + daily: toWei("50000000000"), + mediumAmount: toWei("100000000"), + largeAmount: toWei("1000000000") + } + } + ]; } function tokensTypesTestnet() { - return [ - { description: 'BTC', limits: { - min:toWei('0.0001'), - max:toWei('25'), - daily:toWei('100'), - mediumAmount:toWei('0.01'), - largeAmount:toWei('0.1') } - }, - { description: 'ETH', limits: { - min:toWei('0.0005'), - max:toWei('750'), - daily:toWei('3000'), - mediumAmount:toWei('0.03'), - largeAmount:toWei('0.3') } - }, - { description: '<1000usd', limits: { - min:toWei('0.001'), - max:toWei('2500'), - daily:toWei('5000'), - mediumAmount:toWei('0.01'), - largeAmount:toWei('0.1') } - }, - { description: '<100usd', limits: { - min:toWei('0.1'), - max:toWei('25000'), - daily:toWei('50000'), - mediumAmount:toWei('1'), - largeAmount:toWei('10') } - }, - { description: '=1usd', limits: { - min:toWei('1'), - max:toWei('2500000'), - daily:toWei('5000000'), - mediumAmount:toWei('10'), - largeAmount:toWei('100') } - }, - { description: '<1usd', limits: { - min:toWei('10'), - max:toWei('250000000'), - daily:toWei('500000000'), - mediumAmount:toWei('100'), - largeAmount:toWei('1000') } - }, - { description: '<1cent', limits: { - min:toWei('10'), - max:toWei('25000000000'), - daily:toWei('50000000000'), - mediumAmount:toWei('100'), - largeAmount:toWei('1000') } - }, - ] + return [ + { + description: "BTC", limits: { + min: toWei("0.0001"), + max: toWei("25"), + daily: toWei("100"), + mediumAmount: toWei("0.01"), + largeAmount: toWei("0.1") + } + }, + { + description: "ETH", limits: { + min: toWei("0.0005"), + max: toWei("750"), + daily: toWei("3000"), + mediumAmount: toWei("0.03"), + largeAmount: toWei("0.3") + } + }, + { + description: "<1000usd", limits: { + min: toWei("0.001"), + max: toWei("2500"), + daily: toWei("5000"), + mediumAmount: toWei("0.01"), + largeAmount: toWei("0.1") + } + }, + { + description: "<100usd", limits: { + min: toWei("0.1"), + max: toWei("25000"), + daily: toWei("50000"), + mediumAmount: toWei("1"), + largeAmount: toWei("10") + } + }, + { + description: "=1usd", limits: { + min: toWei("1"), + max: toWei("2500000"), + daily: toWei("5000000"), + mediumAmount: toWei("10"), + largeAmount: toWei("100") + } + }, + { + description: "<1usd", limits: { + min: toWei("10"), + max: toWei("250000000"), + daily: toWei("500000000"), + mediumAmount: toWei("100"), + largeAmount: toWei("1000") + } + }, + { + description: "<1cent", limits: { + min: toWei("10"), + max: toWei("25000000000"), + daily: toWei("50000000000"), + mediumAmount: toWei("100"), + largeAmount: toWei("1000") + } + } + ]; } async function setTokensRskTestnet(allowTokens, deployer) { - // await allowTokens.setToken('0x09b6ca5e4496238a1f176aea6bb607db96c2286e', '0'); //WRBTC - await allowTokens.methods.setMultipleTokens([ - { token: '0x19f64674d8a5b4e652319f5e239efd3bc969a1fe', typeId: '5' }, //RIF - { token: '0xcb46c0ddc60d18efeb0e586c17af6ea36452dae0', typeId: '4' }, //DOC - { token: '0x4da7997a819bb46b6758b9102234c289dd2ad3bf', typeId: '0' }, //BPro - // SideToken - { token: '0xd15cdd74dff1a6a81ca639b038839b126bc01ff9', typeId: '1' }, //rKovWETH - { token: '0x0d86fca9be034a363cf12c9834af08d54a10451c', typeId: '4' }, //rKovSAI - { token: '0x7b846216a194c69bb1ea52ea8faa92d314866451', typeId: '4' }, //rKovDAI - { token: '0x0a8d098e31a60da2b9c874d97de6e6b385c28e9d', typeId: '4' }, //rKovTUSD - { token: '0xed3334adb07a3a5947d268e5a8c67b84f5464963', typeId: '4' }, //rKovUSDC - { token: '0x4cfE225cE54c6609a525768b13F7d87432358C57', typeId: '4' }, //rKovUSDT - { token: '0x8bbbd80981fe76d44854d8df305e8985c19f0e78', typeId: '3' }, //rKovLINK - { token: '0xe95afdfec031f7b9cd942eb7e60f053fb605dfcd', typeId: '3' }, //rKovsBUND - ]).send({ from: deployer }); + // await allowTokens.setToken('0x09b6ca5e4496238a1f176aea6bb607db96c2286e', '0'); //WRBTC + await allowTokens.methods.setMultipleTokens([ + { token: "0x19f64674d8a5b4e652319f5e239efd3bc969a1fe", typeId: "5" }, //RIF + { token: "0xcb46c0ddc60d18efeb0e586c17af6ea36452dae0", typeId: "4" }, //DOC + { token: "0x4da7997a819bb46b6758b9102234c289dd2ad3bf", typeId: "0" }, //BPro + // SideToken + { token: "0xd15cdd74dff1a6a81ca639b038839b126bc01ff9", typeId: "1" }, //rKovWETH + { token: "0x0d86fca9be034a363cf12c9834af08d54a10451c", typeId: "4" }, //rKovSAI + { token: "0x7b846216a194c69bb1ea52ea8faa92d314866451", typeId: "4" }, //rKovDAI + { token: "0x0a8d098e31a60da2b9c874d97de6e6b385c28e9d", typeId: "4" }, //rKovTUSD + { token: "0xed3334adb07a3a5947d268e5a8c67b84f5464963", typeId: "4" }, //rKovUSDC + { token: "0x4cfE225cE54c6609a525768b13F7d87432358C57", typeId: "4" }, //rKovUSDT + { token: "0x8bbbd80981fe76d44854d8df305e8985c19f0e78", typeId: "3" }, //rKovLINK + { token: "0xe95afdfec031f7b9cd942eb7e60f053fb605dfcd", typeId: "3" } //rKovsBUND + ]).send({ from: deployer }); } async function setTokensKovan(allowTokens, deployer) { - await allowTokens.methods.setMultipleTokens([ - { token: '0xd1b98b6607330172f1d991521145a22bce793277', typeId: '0' }, //WBTC - { token: '0x0a9add98c076448cbcfacf5e457da12ddbef4a8f', typeId: '0' }, //renBTC - { token: '0xd0A1E359811322d97991E03f863a0C30C2cF029C', typeId: '1' }, //WETH - { token: '0xc7cc3413f169a027dccfeffe5208ca4f38ef0c40', typeId: '4' }, //SAI - { token: '0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa', typeId: '4' }, //DAI - { token: '0x0000000000085d4780B73119b644AE5ecd22b376', typeId: '4' }, //TUSD - { token: '0xe22da380ee6B445bb8273C81944ADEB6E8450422', typeId: '4' }, //USDC - { token: '0x13512979ade267ab5100878e2e0f485b568328a4', typeId: '4' }, //USDT - { token: '0xa36085F69e2889c224210F603D836748e7dC0088', typeId: '3' }, //LINK - { token: '0x8d3e855f3f55109d473735ab76f753218400fe96', typeId: '3' }, //BUND + await allowTokens.methods.setMultipleTokens([ + { token: "0xd1b98b6607330172f1d991521145a22bce793277", typeId: "0" }, //WBTC + { token: "0x0a9add98c076448cbcfacf5e457da12ddbef4a8f", typeId: "0" }, //renBTC + { token: "0xd0A1E359811322d97991E03f863a0C30C2cF029C", typeId: "1" }, //WETH + { token: "0xc7cc3413f169a027dccfeffe5208ca4f38ef0c40", typeId: "4" }, //SAI + { token: "0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa", typeId: "4" }, //DAI + { token: "0x0000000000085d4780B73119b644AE5ecd22b376", typeId: "4" }, //TUSD + { token: "0xe22da380ee6B445bb8273C81944ADEB6E8450422", typeId: "4" }, //USDC + { token: "0x13512979ade267ab5100878e2e0f485b568328a4", typeId: "4" }, //USDT + { token: "0xa36085F69e2889c224210F603D836748e7dC0088", typeId: "3" }, //LINK + { token: "0x8d3e855f3f55109d473735ab76f753218400fe96", typeId: "3" }, //BUND // SideToken - { token: '0x69f6d4d4813f8e2e618dae7572e04b6d5329e207', typeId: '5' }, //eRIF - { token: '0x09a8f2041Be23e8eC3c72790C9A92089BC70FbCa', typeId: '4' }, //eDOC - { token: '0xB3c9ec8833bfA0d382a183EcED27aBc079520928', typeId: '0' }, //eBPro - ]).send({ from: deployer }); + { token: "0x69f6d4d4813f8e2e618dae7572e04b6d5329e207", typeId: "5" }, //eRIF + { token: "0x09a8f2041Be23e8eC3c72790C9A92089BC70FbCa", typeId: "4" }, //eDOC + { token: "0xB3c9ec8833bfA0d382a183EcED27aBc079520928", typeId: "0" } //eBPro + ]).send({ from: deployer }); } async function setTokensRskMainnet(allowTokens, deployer) { - await allowTokens.methods.setMultipleTokens([ - { token: '0xe700691da7b9851f2f35f8b8182c69c53ccad9db', typeId: '5' }, //DOC - { token: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5', typeId: '6' }, //RIF - // await allowTokens.setToken('0x440cd83c160de5c96ddb20246815ea44c7abbca8', '0'); //BPro - // await allowTokens.setToken('0x967f8799af07df1534d48a95a5c9febe92c53ae0', '0'); //WRBTC - // Side Tokens - { token: '0x6b1a73d547f4009a26b8485b63d7015d248ad406', typeId: '4' }, //rDAI - { token: '0x1bda44fda023f2af8280a16fd1b01d1a493ba6c4', typeId: '4' }, //rUSDC - { token: '0xef213441a85df4d7acbdae0cf78004e1e486bb96', typeId: '4' }, //rUSDT - { token: '0x14adae34bef7ca957ce2dde5add97ea050123827', typeId: '3' }, //rLINK - { token: '0x4991516df6053121121274397a8c1dad608bc95b', typeId: '3' }, //rBUND - { token: '0x73c08467E23F7DCB7dDBbc8d05041B74467A498A', typeId: '6' }, //rFLIXX - { token: '0x9c3a5f8d686fade293c0ce989a62a34408c4e307', typeId: '6' }, //rRFOX - { token: '0xff9ea341d9ea91cb7c54342354377f5104fd403f', typeId: '6' }, //rAMLT - ]).send({ from: deployer }); + await allowTokens.methods.setMultipleTokens([ + { token: "0xe700691da7b9851f2f35f8b8182c69c53ccad9db", typeId: "5" }, //DOC + { token: "0x2acc95758f8b5f583470ba265eb685a8f45fc9d5", typeId: "6" }, //RIF + // await allowTokens.setToken('0x440cd83c160de5c96ddb20246815ea44c7abbca8', '0'); //BPro + // await allowTokens.setToken('0x967f8799af07df1534d48a95a5c9febe92c53ae0', '0'); //WRBTC + // Side Tokens + { token: "0x6b1a73d547f4009a26b8485b63d7015d248ad406", typeId: "4" }, //rDAI + { token: "0x1bda44fda023f2af8280a16fd1b01d1a493ba6c4", typeId: "4" }, //rUSDC + { token: "0xef213441a85df4d7acbdae0cf78004e1e486bb96", typeId: "4" }, //rUSDT + { token: "0x14adae34bef7ca957ce2dde5add97ea050123827", typeId: "3" }, //rLINK + { token: "0x4991516df6053121121274397a8c1dad608bc95b", typeId: "3" }, //rBUND + { token: "0x73c08467E23F7DCB7dDBbc8d05041B74467A498A", typeId: "6" }, //rFLIXX + { token: "0x9c3a5f8d686fade293c0ce989a62a34408c4e307", typeId: "6" }, //rRFOX + { token: "0xff9ea341d9ea91cb7c54342354377f5104fd403f", typeId: "6" } //rAMLT + ]).send({ from: deployer }); } async function setTokensEthereum(allowTokens, deployer) { - await allowTokens.methods.setMultipleTokens([ - { token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', typeId: '0' }, //WBTC - { token: '0xeb4c2781e4eba804ce9a9803c67d0893436bb27d', typeId: '0' }, //renBTC - { token: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', typeId: '1' }, //WETH - { token: '0x6b175474e89094c44da98b954eedeac495271d0f', typeId: '4' }, //DAI - { token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', typeId: '5' }, //USDC - { token: '0xdac17f958d2ee523a2206206994597c13d831ec7', typeId: '5' }, //USDT - { token: '0x514910771af9ca656af840dff83e8264ecf986ca', typeId: '3' }, //LINK - { token: '0x8d3e855f3f55109d473735ab76f753218400fe96', typeId: '3' }, //BUND - { token: '0xf04a8ac553fcedb5ba99a64799155826c136b0be', typeId: '6' }, //FLIXX - { token: '0xa1d6Df714F91DeBF4e0802A542E13067f31b8262', typeId: '6' }, //RFOX - { token: '0xca0e7269600d353f70b14ad118a49575455c0f2f', typeId: '6' }, //AMLT - // Side Tokens - { token: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5', typeId: '5' }, //eRIF - { token: '0xe700691da7b9851f2f35f8b8182c69c53ccad9db', typeId: '4' }, //eDOC - ]).send({ from: deployer }); + await allowTokens.methods.setMultipleTokens([ + { token: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", typeId: "0" }, //WBTC + { token: "0xeb4c2781e4eba804ce9a9803c67d0893436bb27d", typeId: "0" }, //renBTC + { token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", typeId: "1" }, //WETH + { token: "0x6b175474e89094c44da98b954eedeac495271d0f", typeId: "4" }, //DAI + { token: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", typeId: "5" }, //USDC + { token: "0xdac17f958d2ee523a2206206994597c13d831ec7", typeId: "5" }, //USDT + { token: "0x514910771af9ca656af840dff83e8264ecf986ca", typeId: "3" }, //LINK + { token: "0x8d3e855f3f55109d473735ab76f753218400fe96", typeId: "3" }, //BUND + { token: "0xf04a8ac553fcedb5ba99a64799155826c136b0be", typeId: "6" }, //FLIXX + { token: "0xa1d6Df714F91DeBF4e0802A542E13067f31b8262", typeId: "6" }, //RFOX + { token: "0xca0e7269600d353f70b14ad118a49575455c0f2f", typeId: "6" }, //AMLT + // Side Tokens + { token: "0x2acc95758f8b5f583470ba265eb685a8f45fc9d5", typeId: "5" }, //eRIF + { token: "0xe700691da7b9851f2f35f8b8182c69c53ccad9db", typeId: "4" } //eDOC + ]).send({ from: deployer }); } diff --git a/bridge/deploy/22_deploy_federation.js b/bridge/deploy/22_deploy_federation.js index e04a5310a..e0d5aa703 100644 --- a/bridge/deploy/22_deploy_federation.js +++ b/bridge/deploy/22_deploy_federation.js @@ -1,62 +1,64 @@ -module.exports = async function ({getNamedAccounts, deployments, network}) { // HardhatRuntimeEnvironment - const {deployer, multiSig, proxyAdmin} = await getNamedAccounts() - const {deploy, log} = deployments +module.exports = async function({ getNamedAccounts, deployments, network }) { // HardhatRuntimeEnvironment + const { deployer, multiSig, proxyAdmin, federatorProxy } = await getNamedAccounts(); + const { deploy, log } = deployments; - const deployResult = await deploy('Federation', { - from: deployer, - log: true, - }); + const deployResult = await deploy("Federation", { + from: deployer, + log: true + }); - if (deployResult.newlyDeployed) { - log( - `Contract Federation deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed.toString()} gas` - ); - } + if (deployResult.newlyDeployed) { + log( + `Contract Federation deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed.toString()} gas` + ); + } - const Federation = await deployments.get('Federation'); - const ProxyAdmin = await deployments.get('ProxyAdmin'); - const BridgeProxy = await deployments.get('BridgeProxy'); - const MultiSigWallet = await deployments.get('MultiSigWallet'); + const Federation = await deployments.get("Federation"); + const ProxyAdmin = await deployments.get("ProxyAdmin"); + const BridgeProxy = await deployments.get("BridgeProxy"); + const MultiSigWallet = await deployments.get("MultiSigWallet"); - let federationsMembers = [deployer]; - let required = 1; - if(network.name.toLowerCase().includes('testnet') || network.name.toLowerCase().includes('kovan')) { - federationsMembers = ['0x8f397ff074ff190fc650e5cab4da039a8163e12a']; - } - if(network.name.toLowerCase().includes('mainnet')) { - federationsMembers = [ - '0x5eb6ceca6bdd82f4a38aac0b957e6a4b5b1cceba', - '0x8a9ec366c1b359fed1a7372cf8607ec52963b550', - '0xa4398c6ff62e9b93b32b28dd29bd27c6b106245f', - '0x1089a708b03821b19db9bdf179fbd7ed7ce591d7', - '0x04237d65eb6cdc9f93db42fef53f7d5aaca2f1d6', - ]; - required = 2; - } - const federationLogic = new web3.eth.Contract(Federation.abi, Federation.address) - const methodCall = federationLogic.methods.initialize( - federationsMembers, - required, - BridgeProxy.address, - multiSig ?? MultiSigWallet.address - ); - methodCall.call({ from: deployer }); + let federationsMembers = [deployer]; + let required = 1; + if (network.name.toLowerCase().includes("testnet") || network.name.toLowerCase().includes("kovan")) { + federationsMembers = ["0x8f397ff074ff190fc650e5cab4da039a8163e12a"]; + } + if (network.name.toLowerCase().includes("mainnet")) { + federationsMembers = [ + "0x5eb6ceca6bdd82f4a38aac0b957e6a4b5b1cceba", + "0x8a9ec366c1b359fed1a7372cf8607ec52963b550", + "0xa4398c6ff62e9b93b32b28dd29bd27c6b106245f", + "0x1089a708b03821b19db9bdf179fbd7ed7ce591d7", + "0x04237d65eb6cdc9f93db42fef53f7d5aaca2f1d6" + ]; + required = 2; + } + const federationLogic = new web3.eth.Contract(Federation.abi, Federation.address); + const methodCall = federationLogic.methods.initialize( + federationsMembers, + required, + BridgeProxy.address, + multiSig ?? MultiSigWallet.address + ); + methodCall.call({ from: deployer }); - const deployProxyResult = await deploy('FederationProxy', { - from: deployer, - args: [ - Federation.address, - proxyAdmin ?? ProxyAdmin.address, - methodCall.encodeABI() - ], - log: true, + if (!federatorProxy) { + const deployProxyResult = await deploy("FederationProxy", { + from: deployer, + args: [ + Federation.address, + proxyAdmin ?? ProxyAdmin.address, + methodCall.encodeABI() + ], + log: true }); if (deployProxyResult.newlyDeployed) { - log( - `Contract BridgeProxy deployed at ${deployProxyResult.address} using ${deployProxyResult.receipt.gasUsed.toString()} gas` - ); + log( + `Contract BridgeProxy deployed at ${deployProxyResult.address} using ${deployProxyResult.receipt.gasUsed.toString()} gas` + ); } + } }; -module.exports.id = 'deploy_federation'; // id required to prevent reexecution -module.exports.tags = ['Federation', 'new']; -module.exports.dependencies = ['MultiSigWallet', 'ProxyAdmin']; +module.exports.id = "deploy_federation"; // id required to prevent reexecution +module.exports.tags = ["Federation", "new"]; +module.exports.dependencies = ["MultiSigWallet", "ProxyAdmin"]; diff --git a/bridge/hardhat.config.js b/bridge/hardhat.config.js index 68803dd43..79af41c5f 100644 --- a/bridge/hardhat.config.js +++ b/bridge/hardhat.config.js @@ -1,71 +1,59 @@ -require("@nomiclabs/hardhat-web3"); -require("@nomiclabs/hardhat-truffle5"); +require('@nomiclabs/hardhat-web3'); +require('@nomiclabs/hardhat-truffle5'); require('solidity-coverage'); require('hardhat-gas-reporter'); require('hardhat-deploy'); require('hardhat-abi-exporter'); require('hardhat-contract-sizer'); -require("@thinkanddev/hardhat-erc1820-rsk"); +require('@thinkanddev/hardhat-erc1820-rsk'); const fs = require('fs'); -const MNEMONIC = fs.existsSync('./mnemonic.key') - ? fs.readFileSync('./mnemonic.key', { encoding: 'utf8' }) - : "";// Your metamask's recovery words -const INFURA_API_KEY = fs.existsSync('./infura.key') - ? fs.readFileSync('./infura.key',{ encoding: 'utf8' }) - : "";// Your Infura API Key after its registration +const MNEMONIC = fs.existsSync('./mnemonic.key') ? fs.readFileSync('./mnemonic.key', {encoding: 'utf8'}) : ''; // Your metamask's recovery words +const INFURA_API_KEY = fs.existsSync('./infura.key') ? fs.readFileSync('./infura.key', {encoding: 'utf8'}) : ''; // Your Infura API Key after its registration + +const ETHEREUM_MAIN_NET_CHAIN_ID = 1; +const RSK_MAIN_NET_CHAIN_ID = 30; +const RSK_TEST_NET_CHAIN_ID = 31; +const ETHEREUM_KOVAN_CHAIN_ID = 42; +const DEFAULT_DEPLOYER_ACCOUNT_INDEX = 0; /** * @type import('hardhat/config').HardhatUserConfig */ module.exports = { solidity: { - version: "0.7.6", + version: '0.7.6', settings: { evmVersion: 'istanbul', optimizer: { enabled: true, - runs: 200 - } - } + runs: 200, + }, + }, }, gasReporter: { currency: 'RBTC', - gasPrice: 0.06 + gasPrice: 0.06, }, abiExporter: { path: './abi', clear: true, flat: true, - only: [':AllowTokens', ':Bridge', ':Federation', ':IERC20$', - ':MainToken$',':ERC777$', ':MultiSigWallet$', ':ProxyAdmin$', ':SideToken', - ':TransparentUpgradeableProxy$' - ] - }, - namedAccounts: { - deployer: { - default: 0, - }, - multiSig: { - 1: '0x040007b1804ad78a97f541bebed377dcb60e4138', - 30: '0x040007b1804ad78a97f541bebed377dcb60e4138', - 31: '0x88f6b2bc66f4c31a3669b9b1359524abf79cfc4a', - 42: '0x040007b1804ad78a97f541bebed377dcb60e4138', - }, - wrappedCurrency: { - 1: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', - 30: '0x967f8799af07df1534d48a95a5c9febe92c53ae0', - 31: '0x09b6ca5e4496238a1f176aea6bb607db96c2286e', - 42: '0xd0A1E359811322d97991E03f863a0C30C2cF029C', - }, - proxyAdmin: { - 1: '0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6', - 30: '0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d', - 31: '0x8c35e166d2dea7a8a28aaea11ad7933cdae4b0ab', - 42: '0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6', - } + only: [ + ':AllowTokens', + ':Bridge', + ':Federation', + ':IERC20$', + ':MainToken$', + ':ERC777$', + ':MultiSigWallet$', + ':ProxyAdmin$', + ':SideToken', + ':TransparentUpgradeableProxy$', + ], }, + namedAccounts: getNamedAccounts(), networks: { hardhat: { live: false, @@ -92,7 +80,7 @@ module.exports = { gas: 6700000, gasPrice: 20000000000, hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice - tags: ['integrationTest','local'], + tags: ['integrationTest', 'local'], saveDeployments: false, }, // RSK @@ -104,9 +92,9 @@ module.exports = { chainId: 31, hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice accounts: { - mnemonic: MNEMONIC + mnemonic: MNEMONIC, }, - tags: ['staging'] + tags: ['staging'], }, rskmainnet: { live: true, @@ -116,9 +104,9 @@ module.exports = { chainId: 30, hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice accounts: { - mnemonic: MNEMONIC + mnemonic: MNEMONIC, }, - tags: ['prod'] + tags: ['prod'], }, //Ethereum kovan: { @@ -129,9 +117,9 @@ module.exports = { gasPrice: 10000000000, websockets: true, accounts: { - mnemonic: MNEMONIC + mnemonic: MNEMONIC, }, - tags: ['staging'] + tags: ['staging'], }, ethmainnet: { live: true, @@ -141,11 +129,77 @@ module.exports = { gasPrice: 250000000000, websockets: true, accounts: { - mnemonic: MNEMONIC + mnemonic: MNEMONIC, }, - tags: ['prod'] + tags: ['prod'], }, - }, }; +function getNamedAccounts() { + return { + deployer: { + default: DEFAULT_DEPLOYER_ACCOUNT_INDEX, + }, + multiSig: getMultiSigAddressesByChainId(), + wrappedCurrency: getWrappedCurrencyAddressesByChainId(), + proxyAdmin: getProxyAdminAddressesByChainId(), + allowTokensProxy: getAllowTokensProxyAddressesByChainId(), + bridgeProxy: getBridgeProxyAddressesByChainId(), + federatorProxy: getFederatorProxyAddressesByChainId(), + }; +} + +function getMultiSigAddressesByChainId() { + let multiSigAddressesByChainId = {}; + multiSigAddressesByChainId[ETHEREUM_MAIN_NET_CHAIN_ID] = '0x040007b1804ad78a97f541bebed377dcb60e4138'; + multiSigAddressesByChainId[RSK_MAIN_NET_CHAIN_ID] = '0x040007b1804ad78a97f541bebed377dcb60e4138'; + multiSigAddressesByChainId[RSK_TEST_NET_CHAIN_ID] = '0x88f6b2bc66f4c31a3669b9b1359524abf79cfc4a'; + multiSigAddressesByChainId[ETHEREUM_KOVAN_CHAIN_ID] = '0x040007b1804ad78a97f541bebed377dcb60e4138'; + return multiSigAddressesByChainId; +} + +function getWrappedCurrencyAddressesByChainId() { + let wrappedCurrencyAddressesByChainId = {}; + wrappedCurrencyAddressesByChainId[ETHEREUM_MAIN_NET_CHAIN_ID] = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'; + wrappedCurrencyAddressesByChainId[RSK_MAIN_NET_CHAIN_ID] = '0x967f8799af07df1534d48a95a5c9febe92c53ae0'; + wrappedCurrencyAddressesByChainId[RSK_TEST_NET_CHAIN_ID] = '0x09b6ca5e4496238a1f176aea6bb607db96c2286e'; + wrappedCurrencyAddressesByChainId[ETHEREUM_KOVAN_CHAIN_ID] = '0xd0A1E359811322d97991E03f863a0C30C2cF029C'; + return wrappedCurrencyAddressesByChainId; +} + +function getProxyAdminAddressesByChainId() { + let proxyAdminAddressesByChainId = {}; + proxyAdminAddressesByChainId[ETHEREUM_MAIN_NET_CHAIN_ID] = '0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6'; + proxyAdminAddressesByChainId[RSK_MAIN_NET_CHAIN_ID] = '0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d'; + proxyAdminAddressesByChainId[RSK_TEST_NET_CHAIN_ID] = '0x8c35e166d2dea7a8a28aaea11ad7933cdae4b0ab'; + proxyAdminAddressesByChainId[ETHEREUM_KOVAN_CHAIN_ID] = '0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6'; + return proxyAdminAddressesByChainId; +} + +function getAllowTokensProxyAddressesByChainId() { + let allowTokensProxyAddressesByChainId = {}; + allowTokensProxyAddressesByChainId[ETHEREUM_MAIN_NET_CHAIN_ID] = '0xa3fc98e0a7a979677bc14d541be770b2cb0a15f3'; + allowTokensProxyAddressesByChainId[RSK_MAIN_NET_CHAIN_ID] = '0xcb789036894a83a008a2aa5b3c2dde41d0605a9a'; + allowTokensProxyAddressesByChainId[RSK_TEST_NET_CHAIN_ID] = '0xc65bf0ae75dc1a5fc9e6f4215125692a548c773a'; + allowTokensProxyAddressesByChainId[ETHEREUM_KOVAN_CHAIN_ID] = '0x92bf86334583909b60f9b798a9dd7debd899fec4'; + return allowTokensProxyAddressesByChainId; +} + +function getBridgeProxyAddressesByChainId() { + let bridgeProxyAddressesByChainId = {}; + bridgeProxyAddressesByChainId[ETHEREUM_MAIN_NET_CHAIN_ID] = '0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d'; + bridgeProxyAddressesByChainId[RSK_MAIN_NET_CHAIN_ID] = '0x9d11937e2179dc5270aa86a3f8143232d6da0e69'; + bridgeProxyAddressesByChainId[RSK_TEST_NET_CHAIN_ID] = '0x684a8a976635fb7ad74a0134ace990a6a0fcce84'; + bridgeProxyAddressesByChainId[ETHEREUM_KOVAN_CHAIN_ID] = '0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d'; + return bridgeProxyAddressesByChainId; +} + +function getFederatorProxyAddressesByChainId() { + let federatorProxyAddressesByChainId = {}; + federatorProxyAddressesByChainId[ETHEREUM_MAIN_NET_CHAIN_ID] = '0x5e29c223d99648c88610519f96e85e627b3abe17'; + federatorProxyAddressesByChainId[RSK_MAIN_NET_CHAIN_ID] = '0x7ecfda6072942577d36f939ad528b366b020004b'; + federatorProxyAddressesByChainId[RSK_TEST_NET_CHAIN_ID] = '0x5d663981d930e8ec108280b9d80885658148ab0f'; + federatorProxyAddressesByChainId[ETHEREUM_KOVAN_CHAIN_ID] = '0xa347438bc288f56cb6083a79133e70dd2d1f6c2d'; + return federatorProxyAddressesByChainId; +}