@@ -6,6 +6,7 @@ import {RollupPassage} from "zenith/src/passage/RollupPassage.sol";
66import {IERC20 } from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol " ;
77
88import {PecorinoConstants} from "../chains/Pecorino.sol " ;
9+ import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol " ;
910
1011contract SignetL2 {
1112 /// @notice Sentinal value for the native asset in order inputs/outputs
@@ -19,6 +20,9 @@ contract SignetL2 {
1920 /// @notice The Rollup Orders contract.
2021 RollupOrders internal immutable ORDERS;
2122
23+ /// @notice The address of the Rollup Passage on the host network.
24+ address immutable HOST_PASSAGE;
25+
2226 /// @notice The WETH token address.
2327 IERC20 internal immutable WETH;
2428 /// @notice The WBTC token address.
@@ -43,8 +47,10 @@ contract SignetL2 {
4347 if (block .chainid == PecorinoConstants.ROLLUP_CHAIN_ID) {
4448 HOST_CHAIN_ID = PecorinoConstants.HOST_CHAIN_ID;
4549
46- PASSAGE = PecorinoConstants.PECORINO_ROLLUP_PASSAGE;
47- ORDERS = PecorinoConstants.PECORINO_ROLLUP_ORDERS;
50+ HOST_PASSAGE = address (PecorinoConstants.HOST_PASSAGE);
51+
52+ PASSAGE = PecorinoConstants.ROLLUP_PASSAGE;
53+ ORDERS = PecorinoConstants.ROLLUP_ORDERS;
4854
4955 WETH = PecorinoConstants.WETH;
5056 WBTC = PecorinoConstants.WBTC;
@@ -59,6 +65,12 @@ contract SignetL2 {
5965 }
6066 }
6167
68+ /// @notice Gets the aliased address of this contracat, representing itself
69+ /// on L1. Use with caustion.
70+ function aliasedSelf () internal view returns (address ) {
71+ return AddressAliasHelper.applyL1ToL2Alias (address (this ));
72+ }
73+
6274 /// @notice Creates an Input struct for the RollupOrders.
6375 /// @param token The address of the token.
6476 /// @param amount The amount of the token.
@@ -68,14 +80,24 @@ contract SignetL2 {
6880 input.amount = amount;
6981 }
7082
71- /// @notice Creates an Input struct for the native asset (ETH ).
83+ /// @notice Creates an Input struct for the native asset (USD ).
7284 /// @param amount The amount of the native asset (in wei).
7385 /// @return input The created Input struct for the native asset.
74- function makeEthInput (uint256 amount ) internal pure returns (RollupOrders.Input memory input ) {
86+ function makeUsdInput (uint256 amount ) internal pure returns (RollupOrders.Input memory input ) {
7587 input.token = address (0 );
7688 input.amount = amount;
7789 }
7890
91+ function makeWethInput (uint256 amount ) internal view returns (RollupOrders.Input memory input ) {
92+ input.token = address (WETH);
93+ input.amount = amount;
94+ }
95+
96+ function makeWbtcInput (uint256 amount ) internal view returns (RollupOrders.Input memory input ) {
97+ input.token = address (WBTC);
98+ input.amount = amount;
99+ }
100+
79101 /// @notice Creates an Output struct for the RollupOrders.
80102 /// @param token The address of the token.
81103 /// @param amount The amount of the token.
0 commit comments