Skip to content

Commit

Permalink
OPCM: Adds a test, cleans up some TODOs, new justfile command (#12182)
Browse files Browse the repository at this point in the history
* add missing assertion and remove unneeded todo comments

* chore: semver lock + pre-pr-no-build

* chore: rename function
  • Loading branch information
mds1 authored Sep 27, 2024
1 parent 289cd71 commit b1dfd74
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
6 changes: 5 additions & 1 deletion packages/contracts-bedrock/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ check: gas-snapshot-check-no-build kontrol-deployment-check snapshots-check-no-b
########################################################

# Cleans, builds, lints, and runs all checks.
pre-pr: clean build-go-ffi build lint gas-snapshot-no-build snapshots-no-build semver-lock check
pre-pr: clean pre-pr-no-build

# Builds, lints, and runs all checks. Sometimes a bad cache causes issues, in which case the above
# `pre-pr` is preferred. But in most cases this will be sufficient and much faster then a full build.
pre-pr-no-build: build-go-ffi build lint gas-snapshot-no-build snapshots-no-build semver-lock check

# Fixes linting errors.
lint-fix:
Expand Down
13 changes: 10 additions & 3 deletions packages/contracts-bedrock/scripts/DeployOPChain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ contract DeployOPChainOutput is BaseDeployIO {
function assertValidDeploy(DeployOPChainInput _doi) internal {
assertValidAnchorStateRegistryImpl(_doi);
assertValidAnchorStateRegistryProxy(_doi);
assertValidDelayedWETHs(_doi);
assertValidDelayedWETH(_doi);
assertValidDisputeGameFactory(_doi);
assertValidL1CrossDomainMessenger(_doi);
assertValidL1ERC721Bridge(_doi);
Expand Down Expand Up @@ -482,8 +482,15 @@ contract DeployOPChainOutput is BaseDeployIO {
require(factory.owner() == address(_doi.opChainProxyAdminOwner()), "DF-20");
}

function assertValidDelayedWETHs(DeployOPChainInput) internal view {
// TODO add in once FP support is added.
function assertValidDelayedWETH(DeployOPChainInput _doi) internal {
DelayedWETH permissioned = delayedWETHPermissionedGameProxy();

require(permissioned.owner() == address(_doi.opChainProxyAdminOwner()), "DWETH-10");

Proxy proxy = Proxy(payable(address(permissioned)));
vm.prank(address(0));
address admin = proxy.admin();
require(admin == address(opChainProxyAdmin()), "DWETH-20");
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/contracts-bedrock/scripts/DeploySuperchain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ contract DeploySuperchainOutput is BaseDeployIO {
require(actualSuperchainConfigImpl == address(_superchainConfigImpl), "100");
require(actualProtocolVersionsImpl == address(_protocolVersionsImpl), "200");

// TODO Also add the assertions for the implementation contracts from ChainAssertions.sol
assertValidDeploy(_dsi);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
},
"src/L1/OPContractsManager.sol": {
"initCodeHash": "0x7c5d90928ce882ed5360939722271e9af36e81c394e4110ba32864b14c3d78be",
"sourceCodeHash": "0x25372ad554eaeb64d7512e19642210bb3736e4047ea97518b2992b3ab67e1a5d"
"initCodeHash": "0xf64b41f5ec9a94ddbac484f2bdcb5792bf71e66ed6197d172cfd4592311f9b85",
"sourceCodeHash": "0x0ac3668c5f1ccbd49713a4e079f0dafb5cc45eca8de33e0faf0f01b1b989da89"
},
"src/L1/OptimismPortal.sol": {
"initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190",
Expand Down
10 changes: 4 additions & 6 deletions packages/contracts-bedrock/src/L1/OPContractsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ contract OPContractsManager is ISemver, Initializable {

// -------- Constants and Variables --------

/// @custom:semver 1.0.0-beta.15
string public constant version = "1.0.0-beta.15";
/// @custom:semver 1.0.0-beta.16
string public constant version = "1.0.0-beta.16";

/// @notice Represents the interface version so consumers know how to decode the DeployOutput struct
/// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used.
Expand Down Expand Up @@ -433,8 +433,6 @@ contract OPContractsManager is ISemver, Initializable {
virtual
returns (bytes memory)
{
_output;
// TODO make GameTypes.CANNON an input once FPs are supported
return abi.encodeWithSelector(
_selector,
_output.disputeGameFactoryProxy,
Expand Down Expand Up @@ -473,7 +471,7 @@ contract OPContractsManager is ISemver, Initializable {
_input.basefeeScalar,
_input.blobBasefeeScalar,
bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash
30_000_000, // gasLimit, TODO should this be an input?
30_000_000,
_input.roles.unsafeBlockSigner,
referenceResourceConfig,
chainIdToBatchInboxAddress(_input.l2ChainId),
Expand All @@ -490,7 +488,7 @@ contract OPContractsManager is ISemver, Initializable {
_input.basefeeScalar,
_input.blobBasefeeScalar,
bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash
30_000_000, // gasLimit, TODO should this be an input?
30_000_000,
_input.roles.unsafeBlockSigner,
referenceResourceConfig,
chainIdToBatchInboxAddress(_input.l2ChainId),
Expand Down

0 comments on commit b1dfd74

Please sign in to comment.