Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
f8875bec
Unverified
Commit
f8875bec
authored
May 04, 2023
by
mergify[bot]
Committed by
GitHub
May 04, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into fix/cleanup-args-sdk-task
parents
a1601781
2389d445
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
26 deletions
+43
-26
SafeBuilder.sol
packages/contracts-bedrock/scripts/universal/SafeBuilder.sol
+27
-10
PostSherlock.s.sol
...ges/contracts-bedrock/scripts/upgrades/PostSherlock.s.sol
+8
-8
PostSherlockL2.s.sol
...s/contracts-bedrock/scripts/upgrades/PostSherlockL2.s.sol
+8
-8
No files found.
packages/contracts-bedrock/scripts/universal/SafeBuilder.sol
View file @
f8875bec
...
...
@@ -34,14 +34,10 @@ abstract contract SafeBuilder is EnhancedScript, GlobalConstants {
address[] internal approvals;
/**
* @notice The entrypoint to this script.
* -----------------------------------------------------------
* Virtual Functions
* -----------------------------------------------------------
*/
function run(address _safe, address _proxyAdmin) public returns (bool) {
vm.startBroadcast();
bool success = _run(_safe, _proxyAdmin);
if (success) _postCheck();
return success;
}
/**
* @notice Follow up assertions to ensure that the script ran to completion.
...
...
@@ -56,7 +52,30 @@ abstract contract SafeBuilder is EnhancedScript, GlobalConstants {
/**
* @notice Internal helper function to compute the safe transaction hash.
*/
function _getTransactionHash(address _safe, address _proxyAdmin) internal returns (bytes32) {
function computeSafeTransactionHash(address _safe, address _proxyAdmin) public virtual returns (bytes32) {
return _getTransactionHash(_safe, _proxyAdmin);
}
/**
* -----------------------------------------------------------
* Implemented Functions
* -----------------------------------------------------------
*/
/**
* @notice The entrypoint to this script.
*/
function run(address _safe, address _proxyAdmin) public returns (bool) {
vm.startBroadcast();
bool success = _run(_safe, _proxyAdmin);
if (success) _postCheck();
return success;
}
/**
* @notice Computes the safe transaction hash for the provided safe and proxy admin.
*/
function _getTransactionHash(address _safe, address _proxyAdmin) internal view returns (bytes32) {
// Ensure that the required contracts exist
require(address(multicall).code.length > 0, "multicall3 not deployed");
require(_safe.code.length > 0, "no code at safe address");
...
...
@@ -84,7 +103,6 @@ abstract contract SafeBuilder is EnhancedScript, GlobalConstants {
return hash;
}
/**
* @notice The implementation of the upgrade. Split into its own function
* to allow for testability. This is subject to a race condition if
...
...
@@ -189,6 +207,5 @@ abstract contract SafeBuilder is EnhancedScript, GlobalConstants {
}
return signatures;
}
}
packages/contracts-bedrock/scripts/upgrades/PostSherlock.s.sol
View file @
f8875bec
...
...
@@ -115,24 +115,24 @@ contract PostSherlockL1 is SafeBuilder {
* could be added.
*/
function test_script_succeeds() skipWhenNotForking external {
address safe;
address proxyAdmin;
address
_
safe;
address
_
proxyAdmin;
if (block.chainid == GOERLI) {
safe = 0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f;
proxyAdmin = 0x01d3670863c3F4b24D7b107900f0b75d4BbC6e0d;
_
safe = 0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f;
_
proxyAdmin = 0x01d3670863c3F4b24D7b107900f0b75d4BbC6e0d;
// Set the proxy admin for the `_postCheck` function
PROXY_ADMIN = ProxyAdmin(proxyAdmin);
PROXY_ADMIN = ProxyAdmin(
_
proxyAdmin);
}
require(
safe != address(0) &&
proxyAdmin != address(0));
require(
_safe != address(0) && _
proxyAdmin != address(0));
address[] memory owners = IGnosisSafe(payable(safe)).getOwners();
address[] memory owners = IGnosisSafe(payable(
_
safe)).getOwners();
for (uint256 i; i < owners.length; i++) {
address owner = owners[i];
vm.startBroadcast(owner);
bool success = _run(
safe,
proxyAdmin);
bool success = _run(
_safe, _
proxyAdmin);
vm.stopBroadcast();
if (success) {
...
...
packages/contracts-bedrock/scripts/upgrades/PostSherlockL2.s.sol
View file @
f8875bec
...
...
@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
import { console } from "forge-std/console.sol";
import { SafeBuilder } from "../universal/SafeBuilder.sol";
import { IGnosisSafe, Enum } from "../
librari
es/IGnosisSafe.sol";
import { IGnosisSafe, Enum } from "../
interfac
es/IGnosisSafe.sol";
import { IMulticall3 } from "forge-std/interfaces/IMulticall3.sol";
import { Predeploys } from "../../contracts/libraries/Predeploys.sol";
import { ProxyAdmin } from "../../contracts/universal/ProxyAdmin.sol";
...
...
@@ -131,22 +131,22 @@ contract PostSherlockL2 is SafeBuilder {
* could be added.
*/
function test_script_succeeds() skipWhenNotForking external {
address safe;
address proxyAdmin;
address
_
safe;
address
_
proxyAdmin;
if (block.chainid == OP_GOERLI) {
safe = 0xE534ccA2753aCFbcDBCeB2291F596fc60495257e;
proxyAdmin = 0x4200000000000000000000000000000000000018;
_
safe = 0xE534ccA2753aCFbcDBCeB2291F596fc60495257e;
_
proxyAdmin = 0x4200000000000000000000000000000000000018;
}
require(
safe != address(0) &&
proxyAdmin != address(0));
require(
_safe != address(0) && _
proxyAdmin != address(0));
address[] memory owners = IGnosisSafe(payable(safe)).getOwners();
address[] memory owners = IGnosisSafe(payable(
_
safe)).getOwners();
for (uint256 i; i < owners.length; i++) {
address owner = owners[i];
vm.startBroadcast(owner);
bool success = _run(
safe,
proxyAdmin);
bool success = _run(
_safe, _
proxyAdmin);
vm.stopBroadcast();
if (success) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment