deployer for WETHOmnibridgeRouter

This commit is contained in:
Alexey 2021-10-04 13:22:13 +03:00
parent 4df8638014
commit 2a1693247f
3 changed files with 30 additions and 1 deletions

View File

@ -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);
}

View File

@ -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,

View File

@ -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)
})