Commit 35423988 authored by Matt Solomon's avatar Matt Solomon Committed by GitHub

OPSM: scaffold the `DeployOPChain` script (#11593)

* scaffold the DeployOPChain scripts

* test: add tests
parent f20b92d3
......@@ -273,14 +273,15 @@ contract DeployImplementations is Script {
// - AnchorStateRegistry: Proxied, bespoke per chain.
// - FaultDisputeGame: Not proxied, bespoke per chain.
// - PermissionedDisputeGame: Not proxied, bespoke per chain.
// - DelayedWETH: Proxied, shared by all standard chains.
// - DelayedWETH: Proxied, and two bespoke ones per chain (one for each DisputeGame).
// - PreimageOracle: Not proxied, shared by all standard chains.
// - MIPS: Not proxied, shared by all standard chains.
// - OptimismPortal2: Proxied, shared by all standard chains.
//
// This script only deploys the shared contracts. The bespoke contracts are deployed by
// `DeployOPChain.s.sol`. When the shared contracts are proxied, we call the "implementations",
// and when they are not proxied, we call them "singletons". So here we deploy:
// `DeployOPChain.s.sol`. When the shared contracts are proxied, the contracts deployed here are
// "implementations", and when shared contracts are not proxied, they are "singletons". So
// here we deploy:
//
// - OptimismPortal2 (implementation)
// - DelayedWETH (implementation)
......
This diff is collapsed.
......@@ -96,7 +96,8 @@ contract DeploySuperchainInput {
require(!inputSet, "DeploySuperchainInput: input already set");
// All assertions on inputs happen here. You cannot set any inputs in Solidity unless
// they're all valid. For Go testing, the input and outputs
// they're all valid. For Go testing, the input and outputs are set individually by
// treating the input and output contracts as precompiles and intercepting calls to them.
require(_input.roles.proxyAdminOwner != address(0), "DeploySuperchainInput: null proxyAdminOwner");
require(_input.roles.protocolVersionsOwner != address(0), "DeploySuperchainInput: null protocolVersionsOwner");
require(_input.roles.guardian != address(0), "DeploySuperchainInput: null guardian");
......
......@@ -188,4 +188,26 @@ library Solarray {
arr[9] = j;
return arr;
}
function extend(address[] memory arr1, address[] memory arr2) internal pure returns (address[] memory newArr) {
uint256 length1 = arr1.length;
uint256 length2 = arr2.length;
newArr = new address[](length1 + length2);
for (uint256 i = 0; i < length1;) {
newArr[i] = arr1[i];
unchecked {
++i;
}
}
for (uint256 i = 0; i < arr2.length;) {
uint256 j;
unchecked {
j = i + length1;
}
newArr[j] = arr2[i];
unchecked {
++i;
}
}
}
}
This diff is collapsed.
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