Skip to content

Commit

Permalink
feat: split Passage from Zenith (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-carroll authored Jul 2, 2024
1 parent e2f72a5 commit 81e9690
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
18 changes: 9 additions & 9 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ PassageTest:test_setUp() (gas: 16968)
PassageTest:test_transact() (gas: 58562)
PassageTest:test_transact_defaultChain() (gas: 57475)
PassageTest:test_withdraw() (gas: 59033)
ZenithTest:test_addSequencer() (gas: 88191)
ZenithTest:test_badSignature() (gas: 37477)
ZenithTest:test_incorrectHostBlock() (gas: 35310)
ZenithTest:test_notSequencer() (gas: 34223)
ZenithTest:test_notSequencerAdmin() (gas: 10193)
ZenithTest:test_onePerBlock() (gas: 68463)
ZenithTest:test_removeSequencer() (gas: 39857)
ZenithTest:test_setUp() (gas: 8434)
ZenithTest:test_submitBlock() (gas: 63468)
ZenithTest:test_addSequencer() (gas: 88121)
ZenithTest:test_badSignature() (gas: 37241)
ZenithTest:test_incorrectHostBlock() (gas: 35086)
ZenithTest:test_notSequencer() (gas: 34076)
ZenithTest:test_notSequencerAdmin() (gas: 10125)
ZenithTest:test_onePerBlock() (gas: 68193)
ZenithTest:test_removeSequencer() (gas: 39665)
ZenithTest:test_setUp() (gas: 8366)
ZenithTest:test_submitBlock() (gas: 63333)
6 changes: 4 additions & 2 deletions script/Zenith.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.24;

import {Script} from "forge-std/Script.sol";
import {Zenith} from "../src/Zenith.sol";
import {Passage} from "../src/Passage.sol";
import {HostOrders, RollupOrders} from "../src/Orders.sol";

contract ZenithScript is Script {
Expand All @@ -13,9 +14,10 @@ contract ZenithScript is Script {
address withdrawalAdmin,
address[] memory initialEnterTokens,
address sequencerAdmin
) public returns (Zenith z, HostOrders m) {
) public returns (Zenith z, Passage p, HostOrders m) {
vm.startBroadcast();
z = new Zenith(defaultRollupChainId, withdrawalAdmin, initialEnterTokens, sequencerAdmin);
z = new Zenith(sequencerAdmin);
p = new Passage(defaultRollupChainId, withdrawalAdmin, initialEnterTokens);
m = new HostOrders();
}

Expand Down
9 changes: 2 additions & 7 deletions src/Zenith.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.24;

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

contract Zenith is Passage {
contract Zenith {
/// @notice The address that is allowed to set/remove sequencers.
address public immutable sequencerAdmin;

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

constructor(
uint256 _defaultRollupChainId,
address _withdrawalAdmin,
address[] memory initialEnterTokens,
address _sequencerAdmin
) Passage(_defaultRollupChainId, _withdrawalAdmin, initialEnterTokens) {
constructor(address _sequencerAdmin) {
sequencerAdmin = _sequencerAdmin;
deployBlockNumber = block.number;
}
Expand Down
8 changes: 1 addition & 7 deletions test/Helpers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ contract HelpersTest is Test {

function setUp() public {
vm.createSelectFork("https://rpc.holesky.ethpandaops.io");
address[] memory initialEnterTokens;
target = new Zenith(
block.chainid + 1,
0x11Aa4EBFbf7a481617c719a2Df028c9DA1a219aa,
initialEnterTokens,
0x29403F107781ea45Bf93710abf8df13F67f2008f
);
target = new Zenith(0x29403F107781ea45Bf93710abf8df13F67f2008f);
}

function check_signature() public {
Expand Down
3 changes: 1 addition & 2 deletions test/Zenith.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ contract ZenithTest is Test {
event SequencerSet(address indexed sequencer, bool indexed permissioned);

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

// set default block values
Expand Down

0 comments on commit 81e9690

Please sign in to comment.