Skip to content

Commit 81e9690

Browse files
authored
feat: split Passage from Zenith (#57)
1 parent e2f72a5 commit 81e9690

File tree

5 files changed

+17
-27
lines changed

5 files changed

+17
-27
lines changed

.gas-snapshot

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ PassageTest:test_setUp() (gas: 16968)
2727
PassageTest:test_transact() (gas: 58562)
2828
PassageTest:test_transact_defaultChain() (gas: 57475)
2929
PassageTest:test_withdraw() (gas: 59033)
30-
ZenithTest:test_addSequencer() (gas: 88191)
31-
ZenithTest:test_badSignature() (gas: 37477)
32-
ZenithTest:test_incorrectHostBlock() (gas: 35310)
33-
ZenithTest:test_notSequencer() (gas: 34223)
34-
ZenithTest:test_notSequencerAdmin() (gas: 10193)
35-
ZenithTest:test_onePerBlock() (gas: 68463)
36-
ZenithTest:test_removeSequencer() (gas: 39857)
37-
ZenithTest:test_setUp() (gas: 8434)
38-
ZenithTest:test_submitBlock() (gas: 63468)
30+
ZenithTest:test_addSequencer() (gas: 88121)
31+
ZenithTest:test_badSignature() (gas: 37241)
32+
ZenithTest:test_incorrectHostBlock() (gas: 35086)
33+
ZenithTest:test_notSequencer() (gas: 34076)
34+
ZenithTest:test_notSequencerAdmin() (gas: 10125)
35+
ZenithTest:test_onePerBlock() (gas: 68193)
36+
ZenithTest:test_removeSequencer() (gas: 39665)
37+
ZenithTest:test_setUp() (gas: 8366)
38+
ZenithTest:test_submitBlock() (gas: 63333)

script/Zenith.s.sol

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity ^0.8.24;
33

44
import {Script} from "forge-std/Script.sol";
55
import {Zenith} from "../src/Zenith.sol";
6+
import {Passage} from "../src/Passage.sol";
67
import {HostOrders, RollupOrders} from "../src/Orders.sol";
78

89
contract ZenithScript is Script {
@@ -13,9 +14,10 @@ contract ZenithScript is Script {
1314
address withdrawalAdmin,
1415
address[] memory initialEnterTokens,
1516
address sequencerAdmin
16-
) public returns (Zenith z, HostOrders m) {
17+
) public returns (Zenith z, Passage p, HostOrders m) {
1718
vm.startBroadcast();
18-
z = new Zenith(defaultRollupChainId, withdrawalAdmin, initialEnterTokens, sequencerAdmin);
19+
z = new Zenith(sequencerAdmin);
20+
p = new Passage(defaultRollupChainId, withdrawalAdmin, initialEnterTokens);
1921
m = new HostOrders();
2022
}
2123

src/Zenith.sol

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.24;
33

44
import {Passage} from "./Passage.sol";
55

6-
contract Zenith is Passage {
6+
contract Zenith {
77
/// @notice The address that is allowed to set/remove sequencers.
88
address public immutable sequencerAdmin;
99

@@ -66,12 +66,7 @@ contract Zenith is Passage {
6666
/// @notice Emitted when a sequencer is added or removed.
6767
event SequencerSet(address indexed sequencer, bool indexed permissioned);
6868

69-
constructor(
70-
uint256 _defaultRollupChainId,
71-
address _withdrawalAdmin,
72-
address[] memory initialEnterTokens,
73-
address _sequencerAdmin
74-
) Passage(_defaultRollupChainId, _withdrawalAdmin, initialEnterTokens) {
69+
constructor(address _sequencerAdmin) {
7570
sequencerAdmin = _sequencerAdmin;
7671
deployBlockNumber = block.number;
7772
}

test/Helpers.t.sol

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ contract HelpersTest is Test {
1818

1919
function setUp() public {
2020
vm.createSelectFork("https://rpc.holesky.ethpandaops.io");
21-
address[] memory initialEnterTokens;
22-
target = new Zenith(
23-
block.chainid + 1,
24-
0x11Aa4EBFbf7a481617c719a2Df028c9DA1a219aa,
25-
initialEnterTokens,
26-
0x29403F107781ea45Bf93710abf8df13F67f2008f
27-
);
21+
target = new Zenith(0x29403F107781ea45Bf93710abf8df13F67f2008f);
2822
}
2923

3024
function check_signature() public {

test/Zenith.t.sol

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ contract ZenithTest is Test {
2626
event SequencerSet(address indexed sequencer, bool indexed permissioned);
2727

2828
function setUp() public {
29-
address[] memory initialEnterTokens;
30-
target = new Zenith(block.chainid + 1, address(this), initialEnterTokens, address(this));
29+
target = new Zenith(address(this));
3130
target.addSequencer(vm.addr(sequencerKey));
3231

3332
// set default block values

0 commit comments

Comments
 (0)