@@ -5,8 +5,7 @@ import {RollupOrders} from "zenith/src/orders/RollupOrders.sol";
55import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol " ;
66import {IERC20 } from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol " ;
77
8- import {SignetL2} from "../l2/Signet.sol " ;
9- import {BurnMintERC20} from "../vendor/BurnMintERC20.sol " ;
8+ import {BridgeL2} from "./Bridge.sol " ;
109
1110/// @notice An example contract, implementing LIDO staking from Signet L2, with
1211/// support for CCIP teleporting.
@@ -23,47 +22,17 @@ import {BurnMintERC20} from "../vendor/BurnMintERC20.sol";
2322/// WETH to wstETH on L1 and delivers it to `HOST_PASSAGE`, and mints stETH
2423/// on L2 to `recipient`.
2524///
26- contract LidoL2 is SignetL2 , BurnMintERC20 {
25+ contract LidoL2 is BridgeL2 {
2726 using SafeERC20 for IERC20 ;
2827
2928 /// @notice The WstETH token on the host.
3029 address public immutable HOST_WSTETH;
3130
32- constructor (address _hostWsteth ) BurnMintERC20 ( " Signet Lido Staked Ether " , "stETH " , 18 , 0 , 0 ) {
31+ constructor (address _hostWsteth ) BridgeL2 (_hostWsteth, HOST_PASSAGE, " Lido Staked Ether " , "stETH " , 18 ) {
3332 HOST_WSTETH = _hostWsteth;
3433 WETH.forceApprove (address (ORDERS), type (uint256 ).max);
3534 }
3635
37- /// @notice Create an order to bridge in wstETH from L1, and mint stETH on
38- /// L2.
39- function _bridgeIn (address recipient , uint256 amount , RollupOrders.Input[] memory inputs ) internal {
40- RollupOrders.Output[] memory outputs = new RollupOrders.Output [](1 );
41- outputs[0 ] = makeHostOutput (HOST_WSTETH, amount, address (HOST_PASSAGE));
42-
43- ORDERS.initiate (block .timestamp , inputs, outputs);
44-
45- _mint (recipient, amount);
46- }
47-
48- /// @notice Bridge in wstETH from L1, and mint stETH on L2.
49- function bridgeIn (address recipient , uint256 amount ) external {
50- _bridgeIn (recipient, amount, new RollupOrders.Input [](0 ));
51- }
52-
53- /// @notice Burn stETH on L2, and create an order to bridge out wstETH to
54- /// L1. If the order is not filled, the stETH will not be burned.
55- ///
56- /// This transaction should be paired with some off-chain logic that fills
57- /// orders from the L1 bank.
58- function bridgeOut (address recipient , uint256 amount ) public {
59- _burn (msg .sender , amount);
60-
61- RollupOrders.Output[] memory outputs = new RollupOrders.Output [](1 );
62- outputs[0 ] = makeHostOutput (HOST_WSTETH, amount, recipient);
63-
64- ORDERS.initiate (block .timestamp , new RollupOrders.Input [](0 ), outputs);
65- }
66-
6736 /// @notice Transfer WETH from `funder`, create an order to convert it to
6837 /// wstETH on L1 and bridge it to L2, and mint stETH to `recipient`.
6938 function enter (address funder , uint256 amountIn , address recipient , uint256 amountOut ) external {
0 commit comments