Skip to content

Commit 34c84ce

Browse files
committed
chore: remove pecorino
1 parent ce49820 commit 34c84ce

File tree

2 files changed

+12
-36
lines changed

2 files changed

+12
-36
lines changed

src/l1/Signet.sol

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
77
import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
88
import {IWETH} from "../interfaces/IWETH.sol";
99

10-
import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol";
11-
import {PecorinoConstants} from "../chains/Pecorino.sol";
1210
import {ParmigianaConstants} from "../chains/Parmigiana.sol";
11+
import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol";
1312

1413
abstract 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

src/l2/Signet.sol

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {RollupOrders} from "zenith/src/orders/RollupOrders.sol";
55
import {RollupPassage} from "zenith/src/passage/RollupPassage.sol";
66
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
77

8-
import {PecorinoConstants} from "../chains/Pecorino.sol";
98
import {ParmigianaConstants} from "../chains/Parmigiana.sol";
109
import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol";
1110

@@ -45,23 +44,7 @@ contract SignetL2 {
4544

4645
constructor() {
4746
// Auto-configure based on the chain ID.
48-
if (block.chainid == PecorinoConstants.ROLLUP_CHAIN_ID) {
49-
HOST_CHAIN_ID = PecorinoConstants.HOST_CHAIN_ID;
50-
51-
HOST_PASSAGE = address(PecorinoConstants.HOST_PASSAGE);
52-
53-
PASSAGE = PecorinoConstants.ROLLUP_PASSAGE;
54-
ORDERS = PecorinoConstants.ROLLUP_ORDERS;
55-
56-
WETH = PecorinoConstants.WETH;
57-
WBTC = PecorinoConstants.WBTC;
58-
WUSD = PecorinoConstants.WUSD;
59-
60-
HOST_USDC = PecorinoConstants.HOST_USDC;
61-
HOST_USDT = PecorinoConstants.HOST_USDT;
62-
HOST_WBTC = PecorinoConstants.HOST_WBTC;
63-
HOST_WETH = PecorinoConstants.HOST_WETH;
64-
} else if (block.chainid == ParmigianaConstants.ROLLUP_CHAIN_ID) {
47+
if (block.chainid == ParmigianaConstants.ROLLUP_CHAIN_ID) {
6548
HOST_CHAIN_ID = ParmigianaConstants.HOST_CHAIN_ID;
6649

6750
HOST_PASSAGE = address(ParmigianaConstants.HOST_PASSAGE);

0 commit comments

Comments
 (0)