Skip to content

Commit

Permalink
chore: merge branch 'dev' into mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
wadealexc committed Apr 8, 2024
2 parents 90a0f6a + f063b61 commit 2705829
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
71 changes: 71 additions & 0 deletions script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import "../../utils/ExistingDeploymentParser.sol";
import "../../utils/TimelockEncoding.sol";

// forge script script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol:Mainnet_Unpause_Deposits --fork-url $RPC_MAINNET -vvvv
contract Mainnet_Unpause_Deposits is ExistingDeploymentParser, TimelockEncoding {
Vm cheats = Vm(HEVM_ADDRESS);

// Tues Apr 16 2024 12:00:00 GMT-0700 (Pacific Daylight Time)
uint256 timelockEta = 1713250800;

function run() external virtual {
_parseDeployedContracts("script/output/mainnet/M1_deployment_mainnet_2023_6_9.json");

bytes memory final_calldata_to_executor_multisig = encodeForExecutor({
// call to executor will be from the timelock
from: timelock,
// performing single pause operation
to: address(strategyManager),
// value to send in tx
value: 0,
// calldata for the operation
data: abi.encodeWithSelector(Pausable.unpause.selector, 0),
// operation type (for performing single operation)
operation: ISafe.Operation.Call
});

(bytes memory calldata_to_timelock_queuing_action, bytes memory calldata_to_timelock_executing_action) = encodeForTimelock({
// address to be called from the timelock
to: executorMultisig,
// value to send in tx
value: 0,
// calldata for the operation
data: final_calldata_to_executor_multisig,
// time at which the tx will become executable
timelockEta: timelockEta
});

bytes32 expectedTxHash = getTxHash({
target: executorMultisig,
_value: 0,
_data: final_calldata_to_executor_multisig,
eta: timelockEta
});
emit log_named_bytes32("expectedTxHash", expectedTxHash);

cheats.prank(operationsMultisig);
(bool success, ) = timelock.call(calldata_to_timelock_queuing_action);
require(success, "call to timelock queuing action failed");

require(ITimelock(timelock).queuedTransactions(expectedTxHash), "expectedTxHash not queued");

// test performing the upgrade
cheats.warp(timelockEta);
cheats.prank(operationsMultisig);
(success, ) = timelock.call(calldata_to_timelock_executing_action);
require(success, "call to timelock executing action failed");

// Check correctness after upgrade
require(strategyManager.paused() == 0, "unpausing was not completed correctly");
}

function getTxHash(address target, uint256 _value, bytes memory _data, uint256 eta) public pure returns (bytes32) {
// empty bytes
bytes memory signature;
bytes32 txHash = keccak256(abi.encode(target, _value, signature, _data, eta));
return txHash;
}
}
3 changes: 2 additions & 1 deletion script/output/mainnet/M1_deployment_mainnet_2023_6_9.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90",
"pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390",
"timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF"
}
},
"numStrategies": 0
}

0 comments on commit 2705829

Please sign in to comment.