-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'payments' into payments-natspec
- Loading branch information
Showing
122 changed files
with
477 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Run Deploy Scripts | ||
# We run the deploy scripts just to make sure they work | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, reopened] | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
# install foundry to run forge script. Should we run forge script in a container instead? | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Start Anvil chain | ||
# need to start Anvil chain with -d to let the container run in the background | ||
# if we start with 'anvil &' instead, the process stops when the step ends | ||
run: docker run -d --rm -p 8545:8545 --entrypoint anvil ghcr.io/foundry-rs/foundry:nightly-5b7e4cb3c882b28f3c32ba580de27ce7381f415a --host 0.0.0.0 | ||
|
||
- name: Wait for Anvil chain to start | ||
run: sleep 3 | ||
|
||
# Run Forge script against the Anvil chain | ||
- name: Run M2_Deploy_From_Scratch | ||
run: | | ||
forge script script/deploy/devnet/M2_Deploy_From_Scratch.s.sol --rpc-url http://localhost:8545 \ | ||
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast \ | ||
--sig "run(string memory configFileName)" -- M2_deploy_from_scratch.anvil.config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.