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
144a7750
Unverified
Commit
144a7750
authored
Sep 11, 2024
by
Matt Solomon
Committed by
GitHub
Sep 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: fix test and variable naming conventions (#11845)
parent
84b1cde3
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
341 additions
and
333 deletions
+341
-333
DeployImplementations.s.sol
...ges/contracts-bedrock/scripts/DeployImplementations.s.sol
+84
-84
DeployOPChain.s.sol
packages/contracts-bedrock/scripts/DeployOPChain.s.sol
+46
-46
DeploySuperchain.s.sol
packages/contracts-bedrock/scripts/DeploySuperchain.s.sol
+9
-1
DeployImplementations.t.sol
packages/contracts-bedrock/test/DeployImplementations.t.sol
+92
-92
DeployOPChain.t.sol
packages/contracts-bedrock/test/DeployOPChain.t.sol
+109
-109
DeploySuperchain.t.sol
packages/contracts-bedrock/test/DeploySuperchain.t.sol
+1
-1
No files found.
packages/contracts-bedrock/scripts/DeployImplementations.s.sol
View file @
144a7750
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/scripts/DeployOPChain.s.sol
View file @
144a7750
...
...
@@ -292,39 +292,39 @@ contract DeployOPChainOutput {
contract DeployOPChain is Script {
// -------- Core Deployment Methods --------
function run(string memory _infile) public {
(DeployOPChainInput d
si, DeployOPChainOutput ds
o) = etchIOContracts();
d
s
i.loadInputFile(_infile);
run(d
si, ds
o);
(DeployOPChainInput d
oi, DeployOPChainOutput do
o) = etchIOContracts();
d
o
i.loadInputFile(_infile);
run(d
oi, do
o);
string memory outfile = ""; // This will be derived from input file name, e.g. `foo.in.toml` -> `foo.out.toml`
d
s
o.writeOutputFile(outfile);
d
o
o.writeOutputFile(outfile);
require(false, "DeployOPChain: run is not implemented");
}
function run(DeployOPChainInput.Input memory _input) public returns (DeployOPChainOutput.Output memory) {
(DeployOPChainInput d
si, DeployOPChainOutput ds
o) = etchIOContracts();
d
s
i.loadInput(_input);
run(d
si, ds
o);
return d
s
o.output();
(DeployOPChainInput d
oi, DeployOPChainOutput do
o) = etchIOContracts();
d
o
i.loadInput(_input);
run(d
oi, do
o);
return d
o
o.output();
}
function run(DeployOPChainInput _d
si, DeployOPChainOutput _ds
o) public {
require(_d
s
i.inputSet(), "DeployOPChain: input not set");
function run(DeployOPChainInput _d
oi, DeployOPChainOutput _do
o) public {
require(_d
o
i.inputSet(), "DeployOPChain: input not set");
OPStackManager opsm = _d
s
i.opsm();
OPStackManager opsm = _d
o
i.opsm();
OPStackManager.Roles memory roles = OPStackManager.Roles({
opChainProxyAdminOwner: _d
s
i.opChainProxyAdminOwner(),
systemConfigOwner: _d
s
i.systemConfigOwner(),
batcher: _d
s
i.batcher(),
unsafeBlockSigner: _d
s
i.unsafeBlockSigner(),
proposer: _d
s
i.proposer(),
challenger: _d
s
i.challenger()
opChainProxyAdminOwner: _d
o
i.opChainProxyAdminOwner(),
systemConfigOwner: _d
o
i.systemConfigOwner(),
batcher: _d
o
i.batcher(),
unsafeBlockSigner: _d
o
i.unsafeBlockSigner(),
proposer: _d
o
i.proposer(),
challenger: _d
o
i.challenger()
});
OPStackManager.DeployInput memory deployInput = OPStackManager.DeployInput({
roles: roles,
basefeeScalar: _d
s
i.basefeeScalar(),
blobBasefeeScalar: _d
s
i.blobBaseFeeScalar(),
l2ChainId: _d
s
i.l2ChainId()
basefeeScalar: _d
o
i.basefeeScalar(),
blobBasefeeScalar: _d
o
i.blobBaseFeeScalar(),
l2ChainId: _d
o
i.l2ChainId()
});
vm.broadcast(msg.sender);
...
...
@@ -347,40 +347,40 @@ contract DeployOPChain is Script {
vm.label(address(deployOutput.delayedWETHPermissionedGameProxy), "delayedWETHPermissionedGameProxy");
vm.label(address(deployOutput.delayedWETHPermissionlessGameProxy), "delayedWETHPermissionlessGameProxy");
_d
so.set(_ds
o.opChainProxyAdmin.selector, address(deployOutput.opChainProxyAdmin));
_d
so.set(_ds
o.addressManager.selector, address(deployOutput.addressManager));
_d
so.set(_ds
o.l1ERC721BridgeProxy.selector, address(deployOutput.l1ERC721BridgeProxy));
_d
so.set(_ds
o.systemConfigProxy.selector, address(deployOutput.systemConfigProxy));
_d
s
o.set(
_d
s
o.optimismMintableERC20FactoryProxy.selector, address(deployOutput.optimismMintableERC20FactoryProxy)
_d
oo.set(_do
o.opChainProxyAdmin.selector, address(deployOutput.opChainProxyAdmin));
_d
oo.set(_do
o.addressManager.selector, address(deployOutput.addressManager));
_d
oo.set(_do
o.l1ERC721BridgeProxy.selector, address(deployOutput.l1ERC721BridgeProxy));
_d
oo.set(_do
o.systemConfigProxy.selector, address(deployOutput.systemConfigProxy));
_d
o
o.set(
_d
o
o.optimismMintableERC20FactoryProxy.selector, address(deployOutput.optimismMintableERC20FactoryProxy)
);
_d
so.set(_ds
o.l1StandardBridgeProxy.selector, address(deployOutput.l1StandardBridgeProxy));
_d
so.set(_ds
o.l1CrossDomainMessengerProxy.selector, address(deployOutput.l1CrossDomainMessengerProxy));
_d
so.set(_ds
o.optimismPortalProxy.selector, address(deployOutput.optimismPortalProxy));
_d
so.set(_ds
o.disputeGameFactoryProxy.selector, address(deployOutput.disputeGameFactoryProxy));
_d
so.set(_ds
o.disputeGameFactoryImpl.selector, address(deployOutput.disputeGameFactoryImpl));
_d
so.set(_ds
o.anchorStateRegistryProxy.selector, address(deployOutput.anchorStateRegistryProxy));
_d
so.set(_ds
o.anchorStateRegistryImpl.selector, address(deployOutput.anchorStateRegistryImpl));
_d
so.set(_ds
o.faultDisputeGame.selector, address(deployOutput.faultDisputeGame));
_d
so.set(_ds
o.permissionedDisputeGame.selector, address(deployOutput.permissionedDisputeGame));
_d
so.set(_ds
o.delayedWETHPermissionedGameProxy.selector, address(deployOutput.delayedWETHPermissionedGameProxy));
_d
s
o.set(
_d
s
o.delayedWETHPermissionlessGameProxy.selector, address(deployOutput.delayedWETHPermissionlessGameProxy)
_d
oo.set(_do
o.l1StandardBridgeProxy.selector, address(deployOutput.l1StandardBridgeProxy));
_d
oo.set(_do
o.l1CrossDomainMessengerProxy.selector, address(deployOutput.l1CrossDomainMessengerProxy));
_d
oo.set(_do
o.optimismPortalProxy.selector, address(deployOutput.optimismPortalProxy));
_d
oo.set(_do
o.disputeGameFactoryProxy.selector, address(deployOutput.disputeGameFactoryProxy));
_d
oo.set(_do
o.disputeGameFactoryImpl.selector, address(deployOutput.disputeGameFactoryImpl));
_d
oo.set(_do
o.anchorStateRegistryProxy.selector, address(deployOutput.anchorStateRegistryProxy));
_d
oo.set(_do
o.anchorStateRegistryImpl.selector, address(deployOutput.anchorStateRegistryImpl));
_d
oo.set(_do
o.faultDisputeGame.selector, address(deployOutput.faultDisputeGame));
_d
oo.set(_do
o.permissionedDisputeGame.selector, address(deployOutput.permissionedDisputeGame));
_d
oo.set(_do
o.delayedWETHPermissionedGameProxy.selector, address(deployOutput.delayedWETHPermissionedGameProxy));
_d
o
o.set(
_d
o
o.delayedWETHPermissionlessGameProxy.selector, address(deployOutput.delayedWETHPermissionlessGameProxy)
);
_d
s
o.checkOutput();
_d
o
o.checkOutput();
}
// -------- Utilities --------
function etchIOContracts() internal returns (DeployOPChainInput d
si_, DeployOPChainOutput ds
o_) {
(d
si_, ds
o_) = getIOContracts();
vm.etch(address(d
s
i_), type(DeployOPChainInput).runtimeCode);
vm.etch(address(d
s
o_), type(DeployOPChainOutput).runtimeCode);
function etchIOContracts() internal returns (DeployOPChainInput d
oi_, DeployOPChainOutput do
o_) {
(d
oi_, do
o_) = getIOContracts();
vm.etch(address(d
o
i_), type(DeployOPChainInput).runtimeCode);
vm.etch(address(d
o
o_), type(DeployOPChainOutput).runtimeCode);
}
function getIOContracts() public view returns (DeployOPChainInput d
si_, DeployOPChainOutput ds
o_) {
d
s
i_ = DeployOPChainInput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainInput"));
d
s
o_ = DeployOPChainOutput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainOutput"));
function getIOContracts() public view returns (DeployOPChainInput d
oi_, DeployOPChainOutput do
o_) {
d
o
i_ = DeployOPChainInput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainInput"));
d
o
o_ = DeployOPChainOutput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployOPChainOutput"));
}
}
packages/contracts-bedrock/scripts/DeploySuperchain.s.sol
View file @
144a7750
...
...
@@ -56,7 +56,15 @@ import { Solarray } from "scripts/libraries/Solarray.sol";
// documentation.
//
// Additionally, we intentionally use "Input" and "Output" terminology to clearly distinguish these
// scripts from the existing ones that use the "Config" and "Artifacts" terminology.
// scripts from the existing ones that use the "Config" and "Artifacts" terminology. Within scripts
// we use variable names that are shorthand for the full contract names, for example:
// - `dsi` for DeploySuperchainInput
// - `dso` for DeploySuperchainOutput
// - `dio` for DeployImplementationsInput
// - `dio` for DeployImplementationsOutput
// - `doo` for DeployOPChainInput
// - `doo` for DeployOPChainOutput
// - etc.
contract DeploySuperchainInput is CommonBase {
using stdToml for string;
...
...
packages/contracts-bedrock/test/DeployImplementations.t.sol
View file @
144a7750
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/test/DeployOPChain.t.sol
View file @
144a7750
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/test/DeploySuperchain.t.sol
View file @
144a7750
...
...
@@ -206,7 +206,7 @@ contract DeploySuperchain_Test is Test {
return keccak256(abi.encode(_seed, _i));
}
function test_run_memory_succeeds(bytes32 _seed) public {
function test
Fuzz
_run_memory_succeeds(bytes32 _seed) public {
// Generate random input values from the seed. This doesn't give us the benefit of the forge
// fuzzer's dictionary, but that's ok because we are just testing that values are set and
// passed correctly.
...
...
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