Changelog
v2 -> v3
Overview
The changes in this contract are related to moving the minting of MOR tokens and migrating new liquidity from the Arbitrum network to the Base network.
This contract in v2 uses two bridges: the Arbitrum Bridge for transferring liquidity, and LayerZero for sending messages to mint tokens on L2.
Moving from Arbitrum to Base using LayerZero will not be a problem and only requires changing contract configuration. On the other hand, it is not possible to use the Arbitrum Bridge to transfer liquidity to Base. Therefore, to meet the new requirements, the bridge used for transferring liquidity must be replaced with Lido's bridge.
Storage changes
arbitrumBridgeConfigrenamed totokenBridgeConfig. Remove the binding to a specific bridge and make it more abstract. The function that sets these parameters has been renamed accordingly.layerZeroConfigrenamed tomessageBridgeConfig. Remove the binding to a specific bridge and make it more abstractThe function that sets these parameters has been renamed accordingly.
Functions changes
setTokenBridgeConfig
We've also added handling for the case when we reconfigure from the Arbitrum bridge to the Lido bridge. The Arbitrum bridge uses a gateway via an additional call, which must be handled in new version. Lido deployments: https://docs.lido.fi/deployed-contracts/#base
if (oldConfig_.wstETH != address(0)) {
IERC20(stETH).approve(oldConfig_.wstETH, 0);
address oldGateway_;
try IGatewayRouter(oldConfig_.gateway).getGateway(oldConfig_.wstETH) returns (address gateway_) {
oldGateway_ = gateway_;
} catch {
oldGateway_ = oldConfig_.gateway;
}
IERC20(oldConfig_.wstETH).approve(oldGateway_, 0);
}sendWstETH
This function has been changed — it now works with the Lido bridge. l2Gas_ is the gas fee for L2 and can be taken from the Lido gateway contract. data_ is additional information for the transfer (optional field).
function sendWstETH(
uint32 l2Gas_,
bytes calldata data_
) external onlyOwner;Test enviroment
Note that in the test environment anyone can call sendMintMessage. The sendWstETH call, as before, can only be made by the contract owner. The environment is configured so that wstETH transfers and MOR minting work.
Ethereum
L1SenderV3
0x6Fd2674E13a42E588f83Ae74e5F22a4EE24eD75A
Base
L2MessageReceiver
0xB69DbF7C9aB4597D3b3BC284Cc8771D580299baD
MOR
0x98e3CFBdB9707dF6107Cb1A7BD03036052EAa20e
Last updated
Was this helpful?