Skip to content

Commit

Permalink
unPause liquifier via timelock
Browse files Browse the repository at this point in the history
  • Loading branch information
seongyun-ko committed Dec 12, 2024
1 parent c5b51fb commit 28fd7b7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
13 changes: 13 additions & 0 deletions operations/20241212_unpause_liquifier.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ "version": "1.0", "chainId": "1", "meta": { "name": "Transactions Batch", "description": "", "txBuilderVersion": "1.16.5", "createdFromSafeAddress": "0xcdd57D11476c22d265722F68390b036f3DA48c21" }, "transactions": [
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x01d5062a0000000000000000000000009ffdf407cde9a93c47611799da23924af3ef764f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000004feda79674e881e779f8b39b25ceba29bd494ea44b38ab30467ec7b98898516f000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000004bac1520300000000000000000000000000000000000000000000000000000000"
}
,
{
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
"value": "0",
"data": "0x134008d30000000000000000000000009ffdf407cde9a93c47611799da23924af3ef764f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000004feda79674e881e779f8b39b25ceba29bd494ea44b38ab30467ec7b98898516f0000000000000000000000000000000000000000000000000000000000000004bac1520300000000000000000000000000000000000000000000000000000000"
}
] }
7 changes: 7 additions & 0 deletions test/EtherFiTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@ contract TimelockTest is TestSetup {

vm.stopPrank();
}

function test_unpause_liquifier() public {
initializeRealisticFork(MAINNET_FORK);
address target = address(liquifierInstance);
bytes memory data = abi.encodeWithSelector(Liquifier.unPauseContract.selector);
_execute_timelock(target, data, true, true, true, true);
}
}

// {"version":"1.0","chainId":"1
10 changes: 6 additions & 4 deletions test/TestSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1440,14 +1440,16 @@ contract TestSetup is Test {

function _execute_timelock(address target, bytes memory data, bool _schedule, bool _log_schedule, bool _execute, bool _log_execute) internal {
vm.startPrank(0xcdd57D11476c22d265722F68390b036f3DA48c21);

bytes32 salt = keccak256(abi.encodePacked(target, data, block.number));

if (_schedule) etherFiTimelockInstance.schedule(target, 0, data, bytes32(0), bytes32(0), etherFiTimelockInstance.getMinDelay());
if (_log_schedule) _output_schedule_txn(target, data, bytes32(0), bytes32(0), etherFiTimelockInstance.getMinDelay());
if (_schedule) etherFiTimelockInstance.schedule(target, 0, data, bytes32(0), salt, etherFiTimelockInstance.getMinDelay());
if (_log_schedule) _output_schedule_txn(target, data, bytes32(0), salt, etherFiTimelockInstance.getMinDelay());

vm.warp(block.timestamp + etherFiTimelockInstance.getMinDelay());

if (_execute) etherFiTimelockInstance.execute(target, 0, data, bytes32(0), bytes32(0));
if (_log_execute) _output_execute_timelock_txn(target, data, bytes32(0), bytes32(0));
if (_execute) etherFiTimelockInstance.execute(target, 0, data, bytes32(0), salt);
if (_log_execute) _output_execute_timelock_txn(target, data, bytes32(0), salt);

vm.warp(block.timestamp + 1);
vm.stopPrank();
Expand Down

0 comments on commit 28fd7b7

Please sign in to comment.