@@ -7,15 +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 {ParmigianaConstants} from "../chains/Parmigiana.sol " ;
1011import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol " ;
11- import {PecorinoConstants} from "../chains/Pecorino.sol " ;
1212
1313abstract contract SignetL1 {
1414 using SafeERC20 for IERC20 ;
1515
1616 /// @notice Sentinel value for the native asset in order inputs/outputs
1717 address constant NATIVE_ASSET = address (0 );
1818
19+ /// @notice The chain ID of the host network.
20+ uint256 immutable HOST_CHAIN_ID;
21+
1922 /// @notice The Passage address
2023 Passage internal immutable PASSAGE;
2124 /// @notice The Host Orders address
@@ -41,18 +44,21 @@ abstract contract SignetL1 {
4144 error UnsupportedChain (uint256 );
4245
4346 constructor () {
44- if (block .chainid == PecorinoConstants.HOST_CHAIN_ID) {
45- PASSAGE = PecorinoConstants.HOST_PASSAGE;
46- ORDERS = PecorinoConstants.HOST_ORDERS;
47-
48- WETH = IWETH (PecorinoConstants.HOST_WETH);
49- WBTC = IERC20 (PecorinoConstants.HOST_WBTC);
50- USDC = IERC20 (PecorinoConstants.HOST_USDC);
51- USDT = IERC20 (PecorinoConstants.HOST_USDT);
52-
53- RU_WUSD = address (PecorinoConstants.WUSD);
54- RU_WBTC = address (PecorinoConstants.WBTC);
55- RU_WETH = address (PecorinoConstants.WETH);
47+ uint256 chainId = block .chainid ;
48+ if (chainId == ParmigianaConstants.HOST_CHAIN_ID) {
49+ HOST_CHAIN_ID = ParmigianaConstants.HOST_CHAIN_ID;
50+
51+ PASSAGE = ParmigianaConstants.HOST_PASSAGE;
52+ ORDERS = ParmigianaConstants.HOST_ORDERS;
53+
54+ WETH = IWETH (ParmigianaConstants.HOST_WETH);
55+ WBTC = IERC20 (ParmigianaConstants.HOST_WBTC);
56+ USDC = IERC20 (ParmigianaConstants.HOST_USDC);
57+ USDT = IERC20 (ParmigianaConstants.HOST_USDT);
58+
59+ RU_WUSD = address (ParmigianaConstants.WUSD);
60+ RU_WBTC = address (ParmigianaConstants.WBTC);
61+ RU_WETH = address (ParmigianaConstants.WETH);
5662 } else {
5763 revert UnsupportedChain (block .chainid );
5864 }
@@ -82,13 +88,14 @@ abstract contract SignetL1 {
8288 /// @notice Helper to create an output struct.
8389 function makeOutput (address token , uint256 amount , address recipient )
8490 internal
85- pure
91+ view
8692 returns (HostOrders.Output memory output )
8793 {
8894 output.token = token;
8995 output.amount = amount;
9096 output.recipient = recipient;
91- output.chainId = PecorinoConstants.HOST_CHAIN_ID;
97+ // forge-lint: disable-next-line(unsafe-typecast)
98+ output.chainId = uint32 (HOST_CHAIN_ID);
9299 }
93100
94101 /// @notice Helper to create an Output struct for usdc.
@@ -112,7 +119,7 @@ abstract contract SignetL1 {
112119 }
113120
114121 /// @notice Helper to create an Output struct for eth.
115- 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 ) {
116123 return makeOutput (NATIVE_ASSET, amount, recipient);
117124 }
118125
0 commit comments