From 962581b2a2b09cfbe20a2640227a881ce8493b0f Mon Sep 17 00:00:00 2001 From: wcgcyx Date: Mon, 6 Nov 2023 08:31:29 +1000 Subject: [PATCH] Update --- bootstrap/3_child_deployment.js | 2 +- bootstrap/7_imx_rebalancing.js | 8 ++++---- bootstrap/README.md | 4 ++-- src/child/ChildERC20Bridge.sol | 6 ++++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bootstrap/3_child_deployment.js b/bootstrap/3_child_deployment.js index 7dc247ddd..3887b5626 100755 --- a/bootstrap/3_child_deployment.js +++ b/bootstrap/3_child_deployment.js @@ -96,7 +96,7 @@ async function run() { let childAdaptorProxy = await deployChildContract(childAdaptorProxyObj, adminWallet, childAdaptorImpl.address, proxyAdmin.address, []); await waitForReceipt(childAdaptorProxy.deployTransaction.hash, childProvider); console.log("Deployed to CHILD_ADAPTOR_PROXY_ADDRESS: ", childAdaptorProxy.address); - output += "CHILD_ADAPTOR_PROXY_ADDRESS" + childAdaptorProxy.address + "\n"; + output += "CHILD_ADAPTOR_PROXY_ADDRESS=" + childAdaptorProxy.address + "\n"; fs.writeFileSync("./3.out.tmp", output); } diff --git a/bootstrap/7_imx_rebalancing.js b/bootstrap/7_imx_rebalancing.js index dcefa4a0b..fe6f39abe 100644 --- a/bootstrap/7_imx_rebalancing.js +++ b/bootstrap/7_imx_rebalancing.js @@ -48,8 +48,8 @@ async function run() { let balanceAmt = ethers.utils.parseEther(TOTAL_SUPPLY).sub(bridgeBal).sub(multisigBal); console.log("The amount to balance on L1 is: ", ethers.utils.formatEther(balanceAmt)); let IMX = new ethers.Contract(imxRootAddr, IMX_ABI, rootProvider); - console.log("Admin L1 IMX balance: ", await IMX.balanceOf(adminAddr)); - console.log("Root bridge L1 IMX balance: ", await IMX.balanceOf(rootBridgeAddr)); + console.log("Admin L1 IMX balance: ", (await IMX.balanceOf(adminAddr)).toString()); + console.log("Root bridge L1 IMX balance: ", (await IMX.balanceOf(rootBridgeAddr)).toString()); console.log("Rebalance in..."); await wait(); @@ -57,8 +57,8 @@ async function run() { console.log("Transfer...") let resp = await IMX.connect(adminWallet).transfer(rootBridgeAddr, balanceAmt); await waitForReceipt(resp.hash, rootProvider); - console.log("Admin L1 IMX balance: ", await IMX.balanceOf(adminAddr)); - console.log("Root bridge L1 IMX balance: ", await IMX.balanceOf(rootBridgeAddr)); + console.log("Admin L1 IMX balance: ", (await IMX.balanceOf(adminAddr)).toString()); + console.log("Root bridge L1 IMX balance: ", (await IMX.balanceOf(rootBridgeAddr)).toString()); } run(); diff --git a/bootstrap/README.md b/bootstrap/README.md index 0b4524182..3a4e2dbbf 100644 --- a/bootstrap/README.md +++ b/bootstrap/README.md @@ -70,11 +70,11 @@ node 4_root_deployment.js 8. Set the following environment variables using the output `3.out.tmp` & `4.out.tmp` from the previous step. ``` CHILD_BRIDGE_ADDRESS= -CHILD_ADAPTER_ADDRESS= +CHILD_ADAPTOR_ADDRESS= WRAPPED_IMX_ADDRESS= CHILD_TOKEN_TEMPLATE= ROOT_BRIDGE_ADDRESS= -ROOT_ADAPTER_ADDRESS= +ROOT_ADAPTOR_ADDRESS= ROOT_TOKEN_TEMPLATE= ``` 9. Initialise bridge contracts on child chain. (see [here](../README.md#remote-deployment) for more details) diff --git a/src/child/ChildERC20Bridge.sol b/src/child/ChildERC20Bridge.sol index dc40ed384..efbe75af6 100644 --- a/src/child/ChildERC20Bridge.sol +++ b/src/child/ChildERC20Bridge.sol @@ -53,6 +53,12 @@ contract ChildERC20Bridge is /// @dev The address of the ETH ERC20 token on L2. address public childETHToken; + /** + * @notice Fallback function on recieving native IMX. + */ + receive() external payable { + } + /** * @notice Initilization function for RootERC20Bridge. * @param newBridgeAdaptor Address of StateSender to send deposit information to.