Skip to content

Commit

Permalink
fix(protocol): allow TaikoL1 to be paused when initialized (#16893)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Apr 28, 2024
1 parent 5fff5a7 commit 22d5d42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents, TaikoErrors {
/// @param _owner The owner of this contract. msg.sender will be used if this value is zero.
/// @param _addressManager The address of the {AddressManager} contract.
/// @param _genesisBlockHash The block hash of the genesis block.
/// @param _pause true to pause the contract by default.
function init(
address _owner,
address _addressManager,
bytes32 _genesisBlockHash
bytes32 _genesisBlockHash,
bool _pause
)
external
initializer
{
__Essential_init(_owner, _addressManager);
LibVerifying.init(state, getConfig(), _genesisBlockHash);
if (_pause) pause();
}

function init2() external onlyOwner reinitializer(2) {
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/script/DeployOnL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ contract DeployOnL1 is DeployCapability {
name: "taiko",
impl: address(new TaikoL1()),
data: abi.encodeCall(
TaikoL1.init, (timelock, rollupAddressManager, vm.envBytes32("L2_GENESIS_HASH"))
TaikoL1.init, (timelock, rollupAddressManager, vm.envBytes32("L2_GENESIS_HASH"), true)
),
registerTo: rollupAddressManager
});
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/L1/TaikoL1TestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ abstract contract TaikoL1TestBase is TaikoTest {
})
);

L1.init(address(0), address(addressManager), GENESIS_BLOCK_HASH);
L1.init(address(0), address(addressManager), GENESIS_BLOCK_HASH, false);

gp.enableTaikoTokenAllowance(true);
printVariables("init ");
Expand Down

0 comments on commit 22d5d42

Please sign in to comment.