From 2a1693247f6ab9c737ebd84c5de8530ce381a679 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 4 Oct 2021 13:22:13 +0300 Subject: [PATCH] deployer for WETHOmnibridgeRouter --- contracts/bridge/BridgeHelper.sol | 2 +- hardhat.config.js | 8 ++++++++ scripts/deployBSCHelper.js | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 scripts/deployBSCHelper.js diff --git a/contracts/bridge/BridgeHelper.sol b/contracts/bridge/BridgeHelper.sol index 72b32dd..18596a8 100644 --- a/contracts/bridge/BridgeHelper.sol +++ b/contracts/bridge/BridgeHelper.sol @@ -686,7 +686,7 @@ contract WETHOmnibridgeRouter is OwnableModule, Claimable { * @param _receiver bridged assets receiver on the other side of the bridge. * @param _data data for the call of receiver on other side. */ - function wrapAndRelayTokensWithData(address _receiver, bytes memory _data) public payable { + function wrapAndRelayTokens(address _receiver, bytes memory _data) public payable { WETH.deposit{ value: msg.value }(); bridge.relayTokensAndCall(address(WETH), _receiver, msg.value, _data); } diff --git a/hardhat.config.js b/hardhat.config.js index 2e73b11..56d3cf7 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -36,6 +36,14 @@ const config = { mnemonic: 'test test test test test test test test test test test junk', }, }, + bsc: { + url: process.env.ETH_RPC || 'https://bsc-dataseed.binance.org/', + accounts: process.env.PRIVATE_KEY + ? [process.env.PRIVATE_KEY] + : { + mnemonic: 'test test test test test test test test test test test junk', + }, + }, }, mocha: { timeout: 600000000, diff --git a/scripts/deployBSCHelper.js b/scripts/deployBSCHelper.js new file mode 100644 index 0000000..e4d6055 --- /dev/null +++ b/scripts/deployBSCHelper.js @@ -0,0 +1,21 @@ +const { ethers } = require('hardhat') + +// This script deploys WETHOmnibridgeRouter to FOREIGN chain (mainnet) + +async function main() { + const owner = '0x03Ebd0748Aa4D1457cF479cce56309641e0a98F5' + const omniBridge = '0xf0b456250dc9990662a6f25808cc74a6d1131ea9' + const token = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c' // WBNB + + const Helper = await ethers.getContractFactory('WETHOmnibridgeRouter') + const helper = await Helper.deploy(omniBridge, token, owner) + await helper.deployed() + console.log(`WETHOmnibridgeRouter address: ${helper.address}`) +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error) + process.exit(1) + })