Commit df32e7e8 authored by smartcontracts's avatar smartcontracts Committed by GitHub

feat(ct): unlock can be called while paused (#9819)

Modifies DelayedWETH.unlock so that it can be called while the
system is paused. Same change was recently applied to the specs.
Idea behind this change is that the unlock() function is required
for a game to resolve, so pausing the system would also block
games from resolving. We want games to be able to resolve, we
simply don't want incorrectly resolved games to be able to remove
ETH from the contract. As unlock does not distribute any ETH, this
change is considered safe.
parent 18837289
This diff is collapsed.
This diff is collapsed.
......@@ -112,8 +112,8 @@
"sourceCodeHash": "0xef3dee1a6dd89270b67c7e6a54862de9d11b9059cf053127bd26704e7e6b1fbf"
},
"src/dispute/weth/DelayedWETH.sol": {
"initCodeHash": "0x41e274b12dc48658d073dfea67ef694c5cce3963757911ee4cecc9f4c312e4bb",
"sourceCodeHash": "0xb357a0d4b815ea9528cfb6d83aaa1e62cd0352223432d4f3e23bc09ae62691b8"
"initCodeHash": "0xf812f5a6de97162b48ccc847ff64c3be4ba575f1325d6e08fbf9dda91a7dc4c2",
"sourceCodeHash": "0xa03df86dee2d365cef7d0e3db78130c785069ee1c44fb8cb78f3746164793be2"
},
"src/legacy/DeployerWhitelist.sol": {
"initCodeHash": "0x8de80fb23b26dd9d849f6328e56ea7c173cd9e9ce1f05c9beea559d1720deb3d",
......
......@@ -63,7 +63,6 @@ contract DelayedWETH is OwnableUpgradeable, WETH98, IDelayedWETH, ISemver {
// addresses, this will be safe. Could be made safer by having external accounts execute
// withdrawals themselves but that would have added extra complexity and made DelayedWETH
// a leaky abstraction, so we chose this instead.
require(!config.paused(), "DelayedWETH: contract is paused");
WithdrawalRequest storage wd = withdrawals[msg.sender][_guy];
wd.timestamp = block.timestamp;
wd.amount += _wad;
......
......@@ -63,18 +63,6 @@ contract DelayedWETH_Unlock_Test is DelayedWETH_Init {
assertEq(amount2, 2 ether);
assertEq(timestamp2, ts + 1);
}
/// @dev Tests that unlocking while paused fails.
function test_unlock_whilePaused_fails() public {
// Pause the contract.
address guardian = optimismPortal.GUARDIAN();
vm.prank(guardian);
superchainConfig.pause("identifier");
// Unlock fails.
vm.expectRevert("DelayedWETH: contract is paused");
delayedWeth.unlock(alice, 1 ether);
}
}
contract DelayedWETH_Withdraw_Test is DelayedWETH_Init {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment