@@ -7,16 +7,18 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
77import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol " ;
88import {IWETH} from "../interfaces/IWETH.sol " ;
99
10- import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol " ;
11- import {PecorinoConstants} from "../chains/Pecorino.sol " ;
1210import {ParmigianaConstants} from "../chains/Parmigiana.sol " ;
11+ import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol " ;
1312
1413abstract contract SignetL1 {
1514 using SafeERC20 for IERC20 ;
1615
1716 /// @notice Sentinel value for the native asset in order inputs/outputs
1817 address constant NATIVE_ASSET = address (0 );
1918
19+ /// @notice The chain ID of the host network.
20+ uint256 immutable HOST_CHAIN_ID;
21+
2022 /// @notice The Passage address
2123 Passage internal immutable PASSAGE;
2224 /// @notice The Host Orders address
@@ -43,19 +45,9 @@ abstract contract SignetL1 {
4345
4446 constructor () {
4547 uint256 chainId = block .chainid ;
46- if (chainId == PecorinoConstants.HOST_CHAIN_ID) {
47- PASSAGE = PecorinoConstants.HOST_PASSAGE;
48- ORDERS = PecorinoConstants.HOST_ORDERS;
49-
50- WETH = IWETH (PecorinoConstants.HOST_WETH);
51- WBTC = IERC20 (PecorinoConstants.HOST_WBTC);
52- USDC = IERC20 (PecorinoConstants.HOST_USDC);
53- USDT = IERC20 (PecorinoConstants.HOST_USDT);
54-
55- RU_WUSD = address (PecorinoConstants.WUSD);
56- RU_WBTC = address (PecorinoConstants.WBTC);
57- RU_WETH = address (PecorinoConstants.WETH);
58- } else if (chainId == ParmigianaConstants.HOST_CHAIN_ID) {
48+ if (chainId == ParmigianaConstants.HOST_CHAIN_ID) {
49+ HOST_CHAIN_ID = ParmigianaConstants.HOST_CHAIN_ID;
50+
5951 PASSAGE = ParmigianaConstants.HOST_PASSAGE;
6052 ORDERS = ParmigianaConstants.HOST_ORDERS;
6153
@@ -96,13 +88,14 @@ abstract contract SignetL1 {
9688 /// @notice Helper to create an output struct.
9789 function makeOutput (address token , uint256 amount , address recipient )
9890 internal
99- pure
91+ view
10092 returns (HostOrders.Output memory output )
10193 {
10294 output.token = token;
10395 output.amount = amount;
10496 output.recipient = recipient;
105- output.chainId = PecorinoConstants.HOST_CHAIN_ID;
97+ // forge-lint: disable-next-line(unsafe-typecast)
98+ output.chainId = uint32 (HOST_CHAIN_ID);
10699 }
107100
108101 /// @notice Helper to create an Output struct for usdc.
@@ -126,7 +119,7 @@ abstract contract SignetL1 {
126119 }
127120
128121 /// @notice Helper to create an Output struct for eth.
129- function ethOutput (uint256 amount , address recipient ) internal pure returns (HostOrders.Output memory output ) {
122+ function ethOutput (uint256 amount , address recipient ) internal view returns (HostOrders.Output memory output ) {
130123 return makeOutput (NATIVE_ASSET, amount, recipient);
131124 }
132125
0 commit comments