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
8e593108
Commit
8e593108
authored
Nov 22, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments + fmt
parent
095a07e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
46 deletions
+41
-46
ChainAssertions.sol
packages/contracts-bedrock/scripts/ChainAssertions.sol
+11
-16
Deploy.s.sol
packages/contracts-bedrock/scripts/Deploy.s.sol
+30
-30
No files found.
packages/contracts-bedrock/scripts/ChainAssertions.sol
View file @
8e593108
...
...
@@ -36,26 +36,14 @@ library ChainAssertions {
ResourceMetering.ResourceConfig memory dflt = Constants.DEFAULT_RESOURCE_CONFIG();
require(keccak256(abi.encode(rcfg)) == keccak256(abi.encode(dflt)));
checkSystemConfig({
_contracts: _prox,
_cfg: _cfg,
_isProxy: true
});
checkSystemConfig({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
checkL1CrossDomainMessenger(_prox, _vm);
checkL1StandardBridge(_prox);
checkL2OutputOracle(_prox, _cfg, _l2OutputOracleStartingTimestamp, _l2OutputOracleStartingBlockNumber);
checkOptimismMintableERC20Factory(_prox);
checkL1ERC721Bridge(_prox);
checkOptimismPortal({
_contracts: _prox,
_cfg: _cfg,
_isPaused: false
});
checkProtocolVersions({
_contracts: _prox,
_cfg: _cfg,
_isProxy: true
});
checkOptimismPortal({ _contracts: _prox, _cfg: _cfg, _isPaused: false });
checkProtocolVersions({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
}
/// @notice Asserts that the SystemConfig is setup correctly
...
...
@@ -171,7 +159,14 @@ library ChainAssertions {
}
/// @notice Asserts that the ProtocolVersions is setup correctly
function checkProtocolVersions(Types.ContractSet memory _contracts, DeployConfig _cfg, bool _isProxy) internal view {
function checkProtocolVersions(
Types.ContractSet memory _contracts,
DeployConfig _cfg,
bool _isProxy
)
internal
view
{
ProtocolVersions versions = ProtocolVersions(_contracts.ProtocolVersions);
if (_isProxy) {
require(versions.owner() == _cfg.finalSystemOwner());
...
...
packages/contracts-bedrock/scripts/Deploy.s.sol
View file @
8e593108
...
...
@@ -395,6 +395,9 @@ contract Deploy is Deployer {
save("L1CrossDomainMessenger", address(messenger));
console.log("L1CrossDomainMessenger deployed at %s", address(messenger));
// Override the `L1CrossDomainMessenger` contract to the deployed implementation. This is necessary
// to check the `L1CrossDomainMessenger` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.L1CrossDomainMessenger = address(messenger);
ChainAssertions.checkL1CrossDomainMessenger(contracts, vm);
...
...
@@ -424,13 +427,12 @@ contract Deploy is Deployer {
save("OptimismPortal", address(portal));
console.log("OptimismPortal deployed at %s", address(portal));
// Override the `OptimismPortal` contract to the deployed implementation. This is necessary
// to check the `OptimismPortal` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.OptimismPortal = address(portal);
ChainAssertions.checkOptimismPortal({
_contracts: contracts,
_cfg: cfg,
_isPaused: true
});
ChainAssertions.checkOptimismPortal({ _contracts: contracts, _cfg: cfg, _isPaused: true });
require(loadInitializedSlot("OptimismPortal", false) == 1, "OptimismPortal is not initialized");
...
...
@@ -452,6 +454,9 @@ contract Deploy is Deployer {
save("L2OutputOracle", address(oracle));
console.log("L2OutputOracle deployed at %s", address(oracle));
// Override the `L2OutputOracle` contract to the deployed implementation. This is necessary
// to check the `L2OutputOracle` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.L2OutputOracle = address(oracle);
ChainAssertions.checkL2OutputOracle(contracts, cfg, 0, 0);
...
...
@@ -470,6 +475,9 @@ contract Deploy is Deployer {
save("OptimismMintableERC20Factory", address(factory));
console.log("OptimismMintableERC20Factory deployed at %s", address(factory));
// Override the `OptimismMintableERC20Factory` contract to the deployed implementation. This is necessary
// to check the `OptimismMintableERC20Factory` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.OptimismMintableERC20Factory = address(factory);
ChainAssertions.checkOptimismMintableERC20Factory(contracts);
...
...
@@ -501,13 +509,12 @@ contract Deploy is Deployer {
save("ProtocolVersions", address(versions));
console.log("ProtocolVersions deployed at %s", address(versions));
// Override the `ProtocolVersions` contract to the deployed implementation. This is necessary
// to check the `ProtocolVersions` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.ProtocolVersions = address(versions);
ChainAssertions.checkProtocolVersions({
_contracts: contracts,
_cfg: cfg,
_isProxy: false
});
ChainAssertions.checkProtocolVersions({ _contracts: contracts, _cfg: cfg, _isProxy: false });
require(loadInitializedSlot("ProtocolVersions", false) == 1, "ProtocolVersions is not initialized");
...
...
@@ -549,13 +556,12 @@ contract Deploy is Deployer {
save("SystemConfig", address(config));
console.log("SystemConfig deployed at %s", address(config));
// Override the `SystemConfig` contract to the deployed implementation. This is necessary
// to check the `SystemConfig` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.SystemConfig = address(config);
ChainAssertions.checkSystemConfig({
_contracts: contracts,
_cfg: cfg,
_isProxy: false
});
ChainAssertions.checkSystemConfig({ _contracts: contracts, _cfg: cfg, _isProxy: false });
require(loadInitializedSlot("SystemConfig", false) == 1, "SystemConfig is not initialized");
...
...
@@ -573,6 +579,9 @@ contract Deploy is Deployer {
save("L1StandardBridge", address(bridge));
console.log("L1StandardBridge deployed at %s", address(bridge));
// Override the `L1StandardBridge` contract to the deployed implementation. This is necessary
// to check the `L1StandardBridge` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.L1StandardBridge = address(bridge);
ChainAssertions.checkL1StandardBridge(contracts);
...
...
@@ -591,6 +600,9 @@ contract Deploy is Deployer {
save("L1ERC721Bridge", address(bridge));
console.log("L1ERC721Bridge deployed at %s", address(bridge));
// Override the `L1ERC721Bridge` contract to the deployed implementation. This is necessary
// to check the `L1ERC721Bridge` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.L1ERC721Bridge = address(bridge);
ChainAssertions.checkL1ERC721Bridge(contracts);
...
...
@@ -658,11 +670,7 @@ contract Deploy is Deployer {
string memory version = config.version();
console.log("SystemConfig version: %s", version);
ChainAssertions.checkSystemConfig({
_contracts: _proxies(),
_cfg: cfg,
_isProxy: true
});
ChainAssertions.checkSystemConfig({ _contracts: _proxies(), _cfg: cfg, _isProxy: true });
require(loadInitializedSlot("SystemConfig", true) == 1, "SystemConfigProxy is not initialized");
}
...
...
@@ -815,11 +823,7 @@ contract Deploy is Deployer {
string memory version = portal.version();
console.log("OptimismPortal version: %s", version);
ChainAssertions.checkOptimismPortal({
_contracts: _proxies(),
_cfg: cfg,
_isPaused: false
});
ChainAssertions.checkOptimismPortal({ _contracts: _proxies(), _cfg: cfg, _isPaused: false });
require(loadInitializedSlot("OptimismPortal", true) == 1, "OptimismPortalProxy is not initialized");
}
...
...
@@ -849,11 +853,7 @@ contract Deploy is Deployer {
string memory version = versions.version();
console.log("ProtocolVersions version: %s", version);
ChainAssertions.checkProtocolVersions({
_contracts: _proxies(),
_cfg: cfg,
_isProxy: true
});
ChainAssertions.checkProtocolVersions({ _contracts: _proxies(), _cfg: cfg, _isProxy: true });
require(loadInitializedSlot("ProtocolVersions", true) == 1, "ProtocolVersionsProxy is not initialized");
}
...
...
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