Skip to content

Commit f147af2

Browse files
committed
chore: add some natspec
1 parent fc81ba6 commit f147af2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/apps/Lido.sol

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,29 @@ import {BurnMintERC20} from "../vendor/BurnMintERC20.sol";
1313
/// Allows bridging two ways:
1414
/// - Signet native bridging with Orders.
1515
/// - CCIP Teleporting via support for the CCT standard.
16+
///
17+
/// Bridging with Signet:
18+
/// - bridgeIn: Creates an order that delilvers wstETH to `HOST_PASSAGE` on L1.
19+
/// If the order is filled, mints stETH on L2 to `recipient`.
20+
/// - bridgeOut: Burns stETH on L2 from `msg.sender`, and creates an order
21+
/// that delivers wstETH to `recipient` on L1.
22+
/// - enter: Transfers WETH from `funder`, creates an order that converts
23+
/// WETH to wstETH on L1 and delivers it to `HOST_PASSAGE`, and mints stETH
24+
/// on L2 to `recipient`.
25+
///
1626
contract LidoL2 is SignetL2, BurnMintERC20 {
1727
using SafeERC20 for IERC20;
1828

29+
/// @notice The WstETH token on the host.
1930
address public immutable HOST_WSTETH;
2031

2132
constructor(address _hostWsteth) BurnMintERC20("Signet Lido Staked Ether", "stETH", 18, 0, 0) {
2233
HOST_WSTETH = _hostWsteth;
2334
WETH.forceApprove(address(ORDERS), type(uint256).max);
2435
}
2536

37+
/// @notice Create an order to bridge in wstETH from L1, and mint stETH on
38+
/// L2.
2639
function _bridgeIn(address recipient, uint256 amount, RollupOrders.Input[] memory inputs) internal {
2740
RollupOrders.Output[] memory outputs = new RollupOrders.Output[](1);
2841
outputs[0] = makeHostOutput(HOST_WSTETH, amount, address(HOST_PASSAGE));
@@ -32,10 +45,16 @@ contract LidoL2 is SignetL2, BurnMintERC20 {
3245
_mint(recipient, amount);
3346
}
3447

48+
/// @notice Bridge in wstETH from L1, and mint stETH on L2.
3549
function bridgeIn(address recipient, uint256 amount) external {
3650
_bridgeIn(recipient, amount, new RollupOrders.Input[](0));
3751
}
3852

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.
3958
function bridgeOut(address recipient, uint256 amount) public {
4059
_burn(msg.sender, amount);
4160

@@ -45,6 +64,8 @@ contract LidoL2 is SignetL2, BurnMintERC20 {
4564
ORDERS.initiate(block.timestamp, new RollupOrders.Input[](0), outputs);
4665
}
4766

67+
/// @notice Transfer WETH from `funder`, create an order to convert it to
68+
/// wstETH on L1 and bridge it to L2, and mint stETH to `recipient`.
4869
function enter(address funder, uint256 amountIn, address recipient, uint256 amountOut) external {
4970
WETH.safeTransferFrom(funder, address(this), amountIn);
5071

0 commit comments

Comments
 (0)