Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/L1/SuperchainConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ contract SuperchainConfig is ProxyAdminOwnedBase, ISemver {
// Only the Guardian can extend the pause.
_assertOnlyGuardian();

// Cannot extend the pause if not already paused.
if (pauseTimestamps[_identifier] == 0) {
// An expired pause retains its timestamp but is no longer active. Requiring
// paused() here prevents extend() from re-activating it without unpause().
if (!paused(_identifier)) {
revert SuperchainConfig_NotAlreadyPaused(_identifier);
}

Expand Down
17 changes: 17 additions & 0 deletions test/L1/SuperchainConfig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,23 @@ contract SuperchainConfig_Extend_Test is SuperchainConfig_TestInit {
);
superchainConfig.extend(_identifier);
}

/// @notice Tests that `extend` cannot re-activate an expired pause.
function test_extend_expiredPause_reverts() external {
_pauseAsGuardian(address(this));
vm.warp(block.timestamp + PAUSE_EXPIRY + 1);

assertFalse(superchainConfig.paused(address(this)));

vm.expectRevert(
abi.encodeWithSelector(
ISuperchainConfig.SuperchainConfig_NotAlreadyPaused.selector,
address(this)
)
);
vm.prank(superchainConfig.guardian());
superchainConfig.extend(address(this));
}
}

/// @title SuperchainConfig_Pausable_Test
Expand Down