Commit bf7e95ce authored by Michael Amadi's avatar Michael Amadi Committed by GitHub

use disableInitializers (#13183)

* use disableInitializers

* use disableInitializers

* use disableInitializers

* use disableInitializers

* fixes

* assert the values of storage slot of proxies and implementation contracts

* fix initialize's visibility

* fixes

* fixes

* fixes

* semver bump
parent 32638bbb
...@@ -221,7 +221,7 @@ abstract contract Artifacts { ...@@ -221,7 +221,7 @@ abstract contract Artifacts {
} }
StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(_contractName); StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(_contractName);
bytes32 slotVal = vm.load(contractAddress, bytes32(vm.parseUint(slot.slot))); bytes32 slotVal = vm.load(contractAddress, bytes32(slot.slot));
initialized_ = uint8((uint256(slotVal) >> (slot.offset * 8)) & 0xFF); initialized_ = uint8((uint256(slotVal) >> (slot.offset * 8)) & 0xFF);
} }
} }
...@@ -1018,10 +1018,10 @@ contract Deploy is Deployer { ...@@ -1018,10 +1018,10 @@ contract Deploy is Deployer {
console.log("resetting initialized value on %s Proxy", _contractName); console.log("resetting initialized value on %s Proxy", _contractName);
address proxy = mustGetAddress(string.concat(_contractName, "Proxy")); address proxy = mustGetAddress(string.concat(_contractName, "Proxy"));
StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(_contractName); StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(_contractName);
bytes32 slotVal = vm.load(proxy, bytes32(vm.parseUint(slot.slot))); bytes32 slotVal = vm.load(proxy, bytes32(slot.slot));
uint256 value = uint256(slotVal); uint256 value = uint256(slotVal);
value = value & ~(0xFF << (slot.offset * 8)); value = value & ~(0xFF << (slot.offset * 8));
slotVal = bytes32(value); slotVal = bytes32(value);
vm.store(proxy, bytes32(vm.parseUint(slot.slot)), slotVal); vm.store(proxy, bytes32(slot.slot), slotVal);
} }
} }
...@@ -178,7 +178,7 @@ contract DeployAltDA is Script { ...@@ -178,7 +178,7 @@ contract DeployAltDA is Script {
address admin = proxy.admin(); address admin = proxy.admin();
require(admin == address(_dai.proxyAdmin()), "DACP-10"); require(admin == address(_dai.proxyAdmin()), "DACP-10");
DeployUtils.assertInitialized({ _contractAddress: address(proxy), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(proxy), _isProxy: true, _slot: 0, _offset: 0 });
vm.prank(address(0)); vm.prank(address(0));
address impl = proxy.implementation(); address impl = proxy.implementation();
...@@ -194,6 +194,6 @@ contract DeployAltDA is Script { ...@@ -194,6 +194,6 @@ contract DeployAltDA is Script {
function assertValidDataAvailabilityChallengeImpl(DeployAltDAOutput _dao) public view { function assertValidDataAvailabilityChallengeImpl(DeployAltDAOutput _dao) public view {
IDataAvailabilityChallenge dac = _dao.dataAvailabilityChallengeImpl(); IDataAvailabilityChallenge dac = _dao.dataAvailabilityChallengeImpl();
DeployUtils.assertInitialized({ _contractAddress: address(dac), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(dac), _isProxy: false, _slot: 0, _offset: 0 });
} }
} }
...@@ -135,7 +135,12 @@ contract DeployDelayedWETHOutput is BaseDeployIO { ...@@ -135,7 +135,12 @@ contract DeployDelayedWETHOutput is BaseDeployIO {
vm.prank(address(0)); vm.prank(address(0));
address impl = proxy.implementation(); address impl = proxy.implementation();
require(impl == address(delayedWethImpl()), "DWI-10"); require(impl == address(delayedWethImpl()), "DWI-10");
DeployUtils.assertInitialized({ _contractAddress: address(delayedWethImpl()), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({
_contractAddress: address(delayedWethImpl()),
_isProxy: false,
_slot: 0,
_offset: 0
});
require(delayedWethImpl().owner() == address(0), "DWI-20"); require(delayedWethImpl().owner() == address(0), "DWI-20");
require(delayedWethImpl().delay() == _dwi.delayedWethDelay(), "DWI-30"); require(delayedWethImpl().delay() == _dwi.delayedWethDelay(), "DWI-30");
require(address(delayedWethImpl().config()) == address(0), "DWI-30"); require(address(delayedWethImpl().config()) == address(0), "DWI-30");
...@@ -149,7 +154,12 @@ contract DeployDelayedWETHOutput is BaseDeployIO { ...@@ -149,7 +154,12 @@ contract DeployDelayedWETHOutput is BaseDeployIO {
require(admin == _dwi.proxyAdmin(), "DWP-10"); require(admin == _dwi.proxyAdmin(), "DWP-10");
// Check as implementation. // Check as implementation.
DeployUtils.assertInitialized({ _contractAddress: address(delayedWethProxy()), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({
_contractAddress: address(delayedWethProxy()),
_isProxy: true,
_slot: 0,
_offset: 0
});
require(delayedWethProxy().owner() == _dwi.delayedWethOwner(), "DWP-20"); require(delayedWethProxy().owner() == _dwi.delayedWethOwner(), "DWP-20");
require(delayedWethProxy().delay() == _dwi.delayedWethDelay(), "DWP-30"); require(delayedWethProxy().delay() == _dwi.delayedWethDelay(), "DWP-30");
require(delayedWethProxy().config() == _dwi.superchainConfigProxy(), "DWP-40"); require(delayedWethProxy().config() == _dwi.superchainConfigProxy(), "DWP-40");
......
...@@ -9,8 +9,6 @@ import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol"; ...@@ -9,8 +9,6 @@ import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol"; import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol"; import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol";
import { Constants } from "src/libraries/Constants.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
import { Bytes } from "src/libraries/Bytes.sol"; import { Bytes } from "src/libraries/Bytes.sol";
import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
...@@ -291,12 +289,12 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -291,12 +289,12 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidOptimismPortalImpl(DeployImplementationsInput) internal view { function assertValidOptimismPortalImpl(DeployImplementationsInput) internal view {
IOptimismPortal2 portal = optimismPortalImpl(); IOptimismPortal2 portal = optimismPortalImpl();
DeployUtils.assertInitialized({ _contractAddress: address(portal), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(portal), _isProxy: false, _slot: 0, _offset: 0 });
require(address(portal.disputeGameFactory()) == address(0), "PORTAL-10"); require(address(portal.disputeGameFactory()) == address(0), "PORTAL-10");
require(address(portal.systemConfig()) == address(0), "PORTAL-20"); require(address(portal.systemConfig()) == address(0), "PORTAL-20");
require(address(portal.superchainConfig()) == address(0), "PORTAL-30"); require(address(portal.superchainConfig()) == address(0), "PORTAL-30");
require(portal.l2Sender() == Constants.DEFAULT_L2_SENDER, "PORTAL-40"); require(portal.l2Sender() == address(0), "PORTAL-40");
// This slot is the custom gas token _balance and this check ensures // This slot is the custom gas token _balance and this check ensures
// that it stays unset for forwards compatibility with custom gas token. // that it stays unset for forwards compatibility with custom gas token.
...@@ -306,7 +304,7 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -306,7 +304,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidDelayedWETHImpl(DeployImplementationsInput _dii) internal view { function assertValidDelayedWETHImpl(DeployImplementationsInput _dii) internal view {
IDelayedWETH delayedWETH = delayedWETHImpl(); IDelayedWETH delayedWETH = delayedWETHImpl();
DeployUtils.assertInitialized({ _contractAddress: address(delayedWETH), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(delayedWETH), _isProxy: false, _slot: 0, _offset: 0 });
require(delayedWETH.owner() == address(0), "DW-10"); require(delayedWETH.owner() == address(0), "DW-10");
require(delayedWETH.delay() == _dii.withdrawalDelaySeconds(), "DW-20"); require(delayedWETH.delay() == _dii.withdrawalDelaySeconds(), "DW-20");
...@@ -328,21 +326,21 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -328,21 +326,21 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidSystemConfigImpl(DeployImplementationsInput) internal view { function assertValidSystemConfigImpl(DeployImplementationsInput) internal view {
ISystemConfig systemConfig = systemConfigImpl(); ISystemConfig systemConfig = systemConfigImpl();
DeployUtils.assertInitialized({ _contractAddress: address(systemConfig), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(systemConfig), _isProxy: false, _slot: 0, _offset: 0 });
require(systemConfig.owner() == address(0xdead), "SYSCON-10"); require(systemConfig.owner() == address(0), "SYSCON-10");
require(systemConfig.overhead() == 0, "SYSCON-20"); require(systemConfig.overhead() == 0, "SYSCON-20");
require(systemConfig.scalar() == uint256(0x01) << 248, "SYSCON-30"); require(systemConfig.scalar() == 0, "SYSCON-30");
require(systemConfig.basefeeScalar() == 0, "SYSCON-40"); require(systemConfig.basefeeScalar() == 0, "SYSCON-40");
require(systemConfig.blobbasefeeScalar() == 0, "SYSCON-50"); require(systemConfig.blobbasefeeScalar() == 0, "SYSCON-50");
require(systemConfig.batcherHash() == bytes32(0), "SYSCON-60"); require(systemConfig.batcherHash() == bytes32(0), "SYSCON-60");
require(systemConfig.gasLimit() == 1, "SYSCON-70"); require(systemConfig.gasLimit() == 0, "SYSCON-70");
require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-80"); require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-80");
IResourceMetering.ResourceConfig memory resourceConfig = systemConfig.resourceConfig(); IResourceMetering.ResourceConfig memory resourceConfig = systemConfig.resourceConfig();
require(resourceConfig.maxResourceLimit == 1, "SYSCON-90"); require(resourceConfig.maxResourceLimit == 0, "SYSCON-90");
require(resourceConfig.elasticityMultiplier == 1, "SYSCON-100"); require(resourceConfig.elasticityMultiplier == 0, "SYSCON-100");
require(resourceConfig.baseFeeMaxChangeDenominator == 2, "SYSCON-110"); require(resourceConfig.baseFeeMaxChangeDenominator == 0, "SYSCON-110");
require(resourceConfig.systemTxMaxGas == 0, "SYSCON-120"); require(resourceConfig.systemTxMaxGas == 0, "SYSCON-120");
require(resourceConfig.minimumBaseFee == 0, "SYSCON-130"); require(resourceConfig.minimumBaseFee == 0, "SYSCON-130");
require(resourceConfig.maximumBaseFee == 0, "SYSCON-140"); require(resourceConfig.maximumBaseFee == 0, "SYSCON-140");
...@@ -360,25 +358,25 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -360,25 +358,25 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidL1CrossDomainMessengerImpl(DeployImplementationsInput) internal view { function assertValidL1CrossDomainMessengerImpl(DeployImplementationsInput) internal view {
IL1CrossDomainMessenger messenger = l1CrossDomainMessengerImpl(); IL1CrossDomainMessenger messenger = l1CrossDomainMessengerImpl();
DeployUtils.assertInitialized({ _contractAddress: address(messenger), _slot: 0, _offset: 20 }); DeployUtils.assertInitialized({ _contractAddress: address(messenger), _isProxy: false, _slot: 0, _offset: 20 });
require(address(messenger.OTHER_MESSENGER()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-10"); require(address(messenger.OTHER_MESSENGER()) == address(0), "L1xDM-10");
require(address(messenger.otherMessenger()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-20"); require(address(messenger.otherMessenger()) == address(0), "L1xDM-20");
require(address(messenger.PORTAL()) == address(0), "L1xDM-30"); require(address(messenger.PORTAL()) == address(0), "L1xDM-30");
require(address(messenger.portal()) == address(0), "L1xDM-40"); require(address(messenger.portal()) == address(0), "L1xDM-40");
require(address(messenger.superchainConfig()) == address(0), "L1xDM-50"); require(address(messenger.superchainConfig()) == address(0), "L1xDM-50");
bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204))); bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204)));
require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60"); require(address(uint160(uint256(xdmSenderSlot))) == address(0), "L1xDM-60");
} }
function assertValidL1ERC721BridgeImpl(DeployImplementationsInput) internal view { function assertValidL1ERC721BridgeImpl(DeployImplementationsInput) internal view {
IL1ERC721Bridge bridge = l1ERC721BridgeImpl(); IL1ERC721Bridge bridge = l1ERC721BridgeImpl();
DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _isProxy: false, _slot: 0, _offset: 0 });
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_ERC721_BRIDGE, "L721B-10"); require(address(bridge.OTHER_BRIDGE()) == address(0), "L721B-10");
require(address(bridge.otherBridge()) == Predeploys.L2_ERC721_BRIDGE, "L721B-20"); require(address(bridge.otherBridge()) == address(0), "L721B-20");
require(address(bridge.MESSENGER()) == address(0), "L721B-30"); require(address(bridge.MESSENGER()) == address(0), "L721B-30");
require(address(bridge.messenger()) == address(0), "L721B-40"); require(address(bridge.messenger()) == address(0), "L721B-40");
require(address(bridge.superchainConfig()) == address(0), "L721B-50"); require(address(bridge.superchainConfig()) == address(0), "L721B-50");
...@@ -387,19 +385,19 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -387,19 +385,19 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidL1StandardBridgeImpl(DeployImplementationsInput) internal view { function assertValidL1StandardBridgeImpl(DeployImplementationsInput) internal view {
IL1StandardBridge bridge = l1StandardBridgeImpl(); IL1StandardBridge bridge = l1StandardBridgeImpl();
DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _isProxy: false, _slot: 0, _offset: 0 });
require(address(bridge.MESSENGER()) == address(0), "L1SB-10"); require(address(bridge.MESSENGER()) == address(0), "L1SB-10");
require(address(bridge.messenger()) == address(0), "L1SB-20"); require(address(bridge.messenger()) == address(0), "L1SB-20");
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30"); require(address(bridge.OTHER_BRIDGE()) == address(0), "L1SB-30");
require(address(bridge.otherBridge()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-40"); require(address(bridge.otherBridge()) == address(0), "L1SB-40");
require(address(bridge.superchainConfig()) == address(0), "L1SB-50"); require(address(bridge.superchainConfig()) == address(0), "L1SB-50");
} }
function assertValidOptimismMintableERC20FactoryImpl(DeployImplementationsInput) internal view { function assertValidOptimismMintableERC20FactoryImpl(DeployImplementationsInput) internal view {
IOptimismMintableERC20Factory factory = optimismMintableERC20FactoryImpl(); IOptimismMintableERC20Factory factory = optimismMintableERC20FactoryImpl();
DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(factory), _isProxy: false, _slot: 0, _offset: 0 });
require(address(factory.BRIDGE()) == address(0), "MERC20F-10"); require(address(factory.BRIDGE()) == address(0), "MERC20F-10");
require(address(factory.bridge()) == address(0), "MERC20F-20"); require(address(factory.bridge()) == address(0), "MERC20F-20");
...@@ -408,7 +406,7 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -408,7 +406,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidDisputeGameFactoryImpl(DeployImplementationsInput) internal view { function assertValidDisputeGameFactoryImpl(DeployImplementationsInput) internal view {
IDisputeGameFactory factory = disputeGameFactoryImpl(); IDisputeGameFactory factory = disputeGameFactoryImpl();
DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(factory), _isProxy: false, _slot: 0, _offset: 0 });
require(address(factory.owner()) == address(0), "DG-10"); require(address(factory.owner()) == address(0), "DG-10");
} }
......
...@@ -503,6 +503,7 @@ contract DeployOPChain is Script { ...@@ -503,6 +503,7 @@ contract DeployOPChain is Script {
// Then we check the proxy as ASR. // Then we check the proxy as ASR.
DeployUtils.assertInitialized({ DeployUtils.assertInitialized({
_contractAddress: address(_doo.anchorStateRegistryProxy()), _contractAddress: address(_doo.anchorStateRegistryProxy()),
_isProxy: true,
_slot: 0, _slot: 0,
_offset: 0 _offset: 0
}); });
...@@ -523,7 +524,7 @@ contract DeployOPChain is Script { ...@@ -523,7 +524,7 @@ contract DeployOPChain is Script {
function assertValidAnchorStateRegistryImpl(DeployOPChainInput, DeployOPChainOutput _doo) internal { function assertValidAnchorStateRegistryImpl(DeployOPChainInput, DeployOPChainOutput _doo) internal {
IAnchorStateRegistry registry = _doo.anchorStateRegistryImpl(); IAnchorStateRegistry registry = _doo.anchorStateRegistryImpl();
DeployUtils.assertInitialized({ _contractAddress: address(registry), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(registry), _isProxy: false, _slot: 0, _offset: 0 });
require(address(registry.disputeGameFactory()) == address(_doo.disputeGameFactoryProxy()), "ANCHORI-10"); require(address(registry.disputeGameFactory()) == address(_doo.disputeGameFactoryProxy()), "ANCHORI-10");
} }
...@@ -531,7 +532,7 @@ contract DeployOPChain is Script { ...@@ -531,7 +532,7 @@ contract DeployOPChain is Script {
function assertValidSystemConfig(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal { function assertValidSystemConfig(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {
ISystemConfig systemConfig = _doo.systemConfigProxy(); ISystemConfig systemConfig = _doo.systemConfigProxy();
DeployUtils.assertInitialized({ _contractAddress: address(systemConfig), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(systemConfig), _isProxy: true, _slot: 0, _offset: 0 });
require(systemConfig.owner() == _doi.systemConfigOwner(), "SYSCON-10"); require(systemConfig.owner() == _doi.systemConfigOwner(), "SYSCON-10");
require(systemConfig.basefeeScalar() == _doi.basefeeScalar(), "SYSCON-20"); require(systemConfig.basefeeScalar() == _doi.basefeeScalar(), "SYSCON-20");
...@@ -569,7 +570,7 @@ contract DeployOPChain is Script { ...@@ -569,7 +570,7 @@ contract DeployOPChain is Script {
function assertValidL1CrossDomainMessenger(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal { function assertValidL1CrossDomainMessenger(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {
IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy(); IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy();
DeployUtils.assertInitialized({ _contractAddress: address(messenger), _slot: 0, _offset: 20 }); DeployUtils.assertInitialized({ _contractAddress: address(messenger), _isProxy: true, _slot: 0, _offset: 20 });
require(address(messenger.OTHER_MESSENGER()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-10"); require(address(messenger.OTHER_MESSENGER()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-10");
require(address(messenger.otherMessenger()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-20"); require(address(messenger.otherMessenger()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-20");
...@@ -586,7 +587,7 @@ contract DeployOPChain is Script { ...@@ -586,7 +587,7 @@ contract DeployOPChain is Script {
IL1StandardBridge bridge = _doo.l1StandardBridgeProxy(); IL1StandardBridge bridge = _doo.l1StandardBridgeProxy();
IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy(); IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy();
DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _isProxy: true, _slot: 0, _offset: 0 });
require(address(bridge.MESSENGER()) == address(messenger), "L1SB-10"); require(address(bridge.MESSENGER()) == address(messenger), "L1SB-10");
require(address(bridge.messenger()) == address(messenger), "L1SB-20"); require(address(bridge.messenger()) == address(messenger), "L1SB-20");
...@@ -598,7 +599,7 @@ contract DeployOPChain is Script { ...@@ -598,7 +599,7 @@ contract DeployOPChain is Script {
function assertValidOptimismMintableERC20Factory(DeployOPChainInput, DeployOPChainOutput _doo) internal { function assertValidOptimismMintableERC20Factory(DeployOPChainInput, DeployOPChainOutput _doo) internal {
IOptimismMintableERC20Factory factory = _doo.optimismMintableERC20FactoryProxy(); IOptimismMintableERC20Factory factory = _doo.optimismMintableERC20FactoryProxy();
DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(factory), _isProxy: true, _slot: 0, _offset: 0 });
require(factory.BRIDGE() == address(_doo.l1StandardBridgeProxy()), "MERC20F-10"); require(factory.BRIDGE() == address(_doo.l1StandardBridgeProxy()), "MERC20F-10");
require(factory.bridge() == address(_doo.l1StandardBridgeProxy()), "MERC20F-20"); require(factory.bridge() == address(_doo.l1StandardBridgeProxy()), "MERC20F-20");
...@@ -607,7 +608,7 @@ contract DeployOPChain is Script { ...@@ -607,7 +608,7 @@ contract DeployOPChain is Script {
function assertValidL1ERC721Bridge(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal { function assertValidL1ERC721Bridge(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {
IL1ERC721Bridge bridge = _doo.l1ERC721BridgeProxy(); IL1ERC721Bridge bridge = _doo.l1ERC721BridgeProxy();
DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _isProxy: true, _slot: 0, _offset: 0 });
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_ERC721_BRIDGE, "L721B-10"); require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_ERC721_BRIDGE, "L721B-10");
require(address(bridge.otherBridge()) == Predeploys.L2_ERC721_BRIDGE, "L721B-20"); require(address(bridge.otherBridge()) == Predeploys.L2_ERC721_BRIDGE, "L721B-20");
...@@ -636,7 +637,7 @@ contract DeployOPChain is Script { ...@@ -636,7 +637,7 @@ contract DeployOPChain is Script {
function assertValidDisputeGameFactory(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal { function assertValidDisputeGameFactory(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {
IDisputeGameFactory factory = _doo.disputeGameFactoryProxy(); IDisputeGameFactory factory = _doo.disputeGameFactoryProxy();
DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(factory), _isProxy: true, _slot: 0, _offset: 0 });
require( require(
address(factory.gameImpls(GameTypes.PERMISSIONED_CANNON)) == address(_doo.permissionedDisputeGame()), address(factory.gameImpls(GameTypes.PERMISSIONED_CANNON)) == address(_doo.permissionedDisputeGame()),
......
...@@ -239,7 +239,12 @@ contract DeploySuperchainOutput is BaseDeployIO { ...@@ -239,7 +239,12 @@ contract DeploySuperchainOutput is BaseDeployIO {
function assertValidSuperchainConfig(DeploySuperchainInput _dsi) internal { function assertValidSuperchainConfig(DeploySuperchainInput _dsi) internal {
// Proxy checks. // Proxy checks.
ISuperchainConfig superchainConfig = superchainConfigProxy(); ISuperchainConfig superchainConfig = superchainConfigProxy();
DeployUtils.assertInitialized({ _contractAddress: address(superchainConfig), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({
_contractAddress: address(superchainConfig),
_isProxy: true,
_slot: 0,
_offset: 0
});
require(superchainConfig.guardian() == _dsi.guardian(), "SUPCON-10"); require(superchainConfig.guardian() == _dsi.guardian(), "SUPCON-10");
require(superchainConfig.paused() == _dsi.paused(), "SUPCON-20"); require(superchainConfig.paused() == _dsi.paused(), "SUPCON-20");
...@@ -259,7 +264,7 @@ contract DeploySuperchainOutput is BaseDeployIO { ...@@ -259,7 +264,7 @@ contract DeploySuperchainOutput is BaseDeployIO {
function assertValidProtocolVersions(DeploySuperchainInput _dsi) internal { function assertValidProtocolVersions(DeploySuperchainInput _dsi) internal {
// Proxy checks. // Proxy checks.
IProtocolVersions pv = protocolVersionsProxy(); IProtocolVersions pv = protocolVersionsProxy();
DeployUtils.assertInitialized({ _contractAddress: address(pv), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(pv), _isProxy: true, _slot: 0, _offset: 0 });
require(pv.owner() == _dsi.protocolVersionsOwner(), "PV-10"); require(pv.owner() == _dsi.protocolVersionsOwner(), "PV-10");
require( require(
ProtocolVersion.unwrap(pv.required()) == ProtocolVersion.unwrap(_dsi.requiredProtocolVersion()), "PV-20" ProtocolVersion.unwrap(pv.required()) == ProtocolVersion.unwrap(_dsi.requiredProtocolVersion()), "PV-20"
...@@ -276,7 +281,7 @@ contract DeploySuperchainOutput is BaseDeployIO { ...@@ -276,7 +281,7 @@ contract DeploySuperchainOutput is BaseDeployIO {
// Implementation checks. // Implementation checks.
pv = protocolVersionsImpl(); pv = protocolVersionsImpl();
require(pv.owner() == address(0xdead), "PV-60"); require(pv.owner() == address(0), "PV-60");
require(ProtocolVersion.unwrap(pv.required()) == 0, "PV-70"); require(ProtocolVersion.unwrap(pv.required()) == 0, "PV-70");
require(ProtocolVersion.unwrap(pv.recommended()) == 0, "PV-80"); require(ProtocolVersion.unwrap(pv.recommended()) == 0, "PV-80");
} }
......
...@@ -351,15 +351,17 @@ library DeployUtils { ...@@ -351,15 +351,17 @@ library DeployUtils {
} }
} }
/// @notice Asserts that for a given contract the value of a storage slot at an offset is 1 or /// @dev Asserts that for a given contract the value of a storage slot at an offset is 1 (if a proxy contract) or
/// `type(uint8).max`. The value is set to 1 when a contract is initialized, and set to /// type(uint8).max (if an implementation contract).
/// `type(uint8).max` when `_disableInitializers` is called. /// A call to `initialize` will set proxies to 1 and a call to _disableInitializers will set implementations to
function assertInitialized(address _contractAddress, uint256 _slot, uint256 _offset) internal view { /// type(uint8).max.
function assertInitialized(address _contractAddress, bool _isProxy, uint256 _slot, uint256 _offset) internal view {
bytes32 slotVal = vm.load(_contractAddress, bytes32(_slot)); bytes32 slotVal = vm.load(_contractAddress, bytes32(_slot));
uint8 value = uint8((uint256(slotVal) >> (_offset * 8)) & 0xFF); uint8 val = uint8((uint256(slotVal) >> (_offset * 8)) & 0xFF);
require( if (_isProxy) {
value == 1 || value == type(uint8).max, require(val == 1, "DeployUtils: storage value is not 1 at the given slot and offset");
"DeployUtils: value at the given slot and offset does not indicate initialization" } else {
); require(val == type(uint8).max, "DeployUtils: storage value is not 0xff at the given slot and offset");
}
} }
} }
...@@ -8,7 +8,7 @@ import { Process } from "scripts/libraries/Process.sol"; ...@@ -8,7 +8,7 @@ import { Process } from "scripts/libraries/Process.sol";
/// @notice Contains information about a storage slot. Mirrors the layout of the storage /// @notice Contains information about a storage slot. Mirrors the layout of the storage
/// slot object in Forge artifacts so that we can deserialize JSON into this struct. /// slot object in Forge artifacts so that we can deserialize JSON into this struct.
struct StorageSlot { struct ForgeStorageSlot {
uint256 astId; uint256 astId;
string _contract; string _contract;
string label; string label;
...@@ -17,6 +17,16 @@ struct StorageSlot { ...@@ -17,6 +17,16 @@ struct StorageSlot {
string _type; string _type;
} }
/// @notice Same as ForgeStorageSlot but with the slot field as a uint256 instead of a string.
struct StorageSlot {
uint256 astId;
string _contract;
string label;
uint256 offset;
uint256 slot;
string _type;
}
struct AbiEntry { struct AbiEntry {
string fnName; string fnName;
bytes4 sel; bytes4 sel;
...@@ -165,14 +175,22 @@ library ForgeArtifacts { ...@@ -165,14 +175,22 @@ library ForgeArtifacts {
) )
) )
); );
slot_ = abi.decode(rawSlot, (StorageSlot)); ForgeStorageSlot memory slot = abi.decode(rawSlot, (ForgeStorageSlot));
slot_ = StorageSlot({
astId: slot.astId,
_contract: slot._contract,
label: slot.label,
offset: slot.offset,
slot: vm.parseUint(slot.slot),
_type: slot._type
});
} }
/// @notice Returns whether or not a contract is initialized. /// @notice Returns whether or not a contract is initialized.
/// Needs the name to get the storage layout. /// Needs the name to get the storage layout.
function isInitialized(string memory _name, address _address) internal returns (bool initialized_) { function isInitialized(string memory _name, address _address) internal returns (bool initialized_) {
StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(_name); StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(_name);
bytes32 slotVal = vm.load(_address, bytes32(vm.parseUint(slot.slot))); bytes32 slotVal = vm.load(_address, bytes32(slot.slot));
initialized_ = uint8((uint256(slotVal) >> (slot.offset * 8)) & 0xFF) != 0; initialized_ = uint8((uint256(slotVal) >> (slot.offset * 8)) & 0xFF) != 0;
} }
......
{ {
"src/L1/DataAvailabilityChallenge.sol": { "src/L1/DataAvailabilityChallenge.sol": {
"initCodeHash": "0x2d2efa7ac3e2f96a5712344c8df0ef4657c6fe430c4aa33e68dd8327d708b6b6", "initCodeHash": "0xa547dfd266330a9af21ebedd0cd7ca6b22487676748b1503df4de787e1c91af9",
"sourceCodeHash": "0x262e3e3f144fc93fd431296251961a70e939703bf62d1c79f23239644ac8e978" "sourceCodeHash": "0xae49c741c8cd546981ab59b85b88e9fc1055c4fae085e7078d601b42464f86e6"
}, },
"src/L1/L1CrossDomainMessenger.sol": { "src/L1/L1CrossDomainMessenger.sol": {
"initCodeHash": "0x9e8763b2fca99b577e8374a1f8d0421eeeb3e922535728a22d24a1b658c85665", "initCodeHash": "0x833d739d04125bf14f3bd11d9da9405354d37ad246737b56d5b112cddc0031ff",
"sourceCodeHash": "0x370dd42d9888fd53a85811190208bc0f68e4071a2e3e4b2d15f2a4b92f4707ff" "sourceCodeHash": "0xca20239ad3eb140e0d3d165ec1d3d1c68581d878ec2b86c5d33b07c6c87f6f45"
}, },
"src/L1/L1ERC721Bridge.sol": { "src/L1/L1ERC721Bridge.sol": {
"initCodeHash": "0x7d8dbcc9b146d21ce4aabfc41a724d4c8d945956318a120127234afd53a4315c", "initCodeHash": "0x280488bce8b4fb364740c59de14c423851902088f384e077bccc79b9df48528a",
"sourceCodeHash": "0x48f4e1db42f82490e91fd33b05117b05c072444ed53bbd4e06e742d330a422bb" "sourceCodeHash": "0xe12b9e6c4e4ac2e2c9a03f07c7689f6bf2231922536072812cf1f37a5a276e73"
}, },
"src/L1/L1StandardBridge.sol": { "src/L1/L1StandardBridge.sol": {
"initCodeHash": "0x1f9b323a6e1e55a8089bb4de7b7b82d608bccc07e574d79cc690e117f02d0cda", "initCodeHash": "0x7d7030359826f64714ef0c2a5198901812fb0a99e949f23fe54ccf87a0df2e67",
"sourceCodeHash": "0xb58db3988e7b31467983b91c402e25b00c74c38d5be92eb14e381979eb996dbd" "sourceCodeHash": "0xa91b445bdc666a02ba18e3b91ba94b6d54bbe65da714002fc734814201319d57"
}, },
"src/L1/L2OutputOracle.sol": { "src/L1/L2OutputOracle.sol": {
"initCodeHash": "0x0e0573841e43e4c5f0df5839db2bdf387f29fed7c830f05960542e7d7109ed4a", "initCodeHash": "0xd992c45b8461b9546fe4e3cecbce15d17ce366a62aab17058aad3b15bf36d21d",
"sourceCodeHash": "0x8aafeffb41332fddf2fb1ef4fc033bd1f323cdc5b199c6951da73e3cb86276e6" "sourceCodeHash": "0xa35478e9e2659a320da725a117b200dea2826175d2b17d881de1196da0cc91eb"
}, },
"src/L1/OPContractsManager.sol": { "src/L1/OPContractsManager.sol": {
"initCodeHash": "0x9b704574a7005dc2aa8d6a3e0d85572493cc4bbd60033a23e437632a5fef7720", "initCodeHash": "0x9b704574a7005dc2aa8d6a3e0d85572493cc4bbd60033a23e437632a5fef7720",
"sourceCodeHash": "0x05ed7ad68e4e9bca7334314e794a1f66e5899532bb01cfa3a7716cb2688df9d5" "sourceCodeHash": "0x05ed7ad68e4e9bca7334314e794a1f66e5899532bb01cfa3a7716cb2688df9d5"
}, },
"src/L1/OptimismPortal.sol": { "src/L1/OptimismPortal.sol": {
"initCodeHash": "0xa8b2f8a6d1092c5e64529736462ebb35daa9ea9e67585f7de8e3e5394682ee64", "initCodeHash": "0x2f5427c78c3445cdbe38931e67274ae87a6ac7fcc1a2279f1e9fc294808b67f9",
"sourceCodeHash": "0xb71e8bc24ea9ebb5692762005f2936ba2a00bf169e1e32f504a0f6e23a349a22" "sourceCodeHash": "0x77e0f0f8caa9742896a3e7cdee15b0061e298f9c950159bb7231b8196517c9d2"
}, },
"src/L1/OptimismPortal2.sol": { "src/L1/OptimismPortal2.sol": {
"initCodeHash": "0xe7c85e9822e0fdadd7a5b7909b8b097e18a72997f70d85ea5122f8f129d89847", "initCodeHash": "0xfd14fd690752519064d6de6c3e15d69ec9146bc8714e56ac286305773dbb1533",
"sourceCodeHash": "0x9d138b09731e7c47d32c3671b0757a0a66d0629e397656d9690c38841bbb643a" "sourceCodeHash": "0x3dbd4601c67a43c42f403f6b28e6e2d8bf4f3d2cf2f2d8f7460026e0c6c66def"
}, },
"src/L1/OptimismPortalInterop.sol": { "src/L1/OptimismPortalInterop.sol": {
"initCodeHash": "0x339019bc5c09e0defac37c6bba7b356d55e5a421cbd761ab9af84def39556413", "initCodeHash": "0xc7a9282ef32425b65a647039908ea2b8d6ef231ba1b87c345c7b9f3f73acc240",
"sourceCodeHash": "0xeb7323d25dfcbeac165a27d4bb112c45ca9d04de82b75b2dba22b3b2181514ae" "sourceCodeHash": "0x85e9f10ba1884b1a45737fd35ae4c2f9a9054f81a6aba08941ab7a95e74543da"
}, },
"src/L1/ProtocolVersions.sol": { "src/L1/ProtocolVersions.sol": {
"initCodeHash": "0xb0ff1661226417342001fe9f0b64c340b7c074ff71579abf05399f4e742aaca1", "initCodeHash": "0x0000ec89712d8b4609873f1ba76afffd4205bf9110818995c90134dbec12e91e",
"sourceCodeHash": "0xc82754087747c067d4c3ae7deed08a574acbeaec0fbacc1f80ce63313ae817ed" "sourceCodeHash": "0xd4284db247fc1e686bd4b57755c7ac9a073a173d6df4f93448eb7fb5518882f7"
}, },
"src/L1/SuperchainConfig.sol": { "src/L1/SuperchainConfig.sol": {
"initCodeHash": "0xddfc0ea9a7d5b0a3a3c1080d022295af57cd9bcd6171ad0fe09287c493c9e95d", "initCodeHash": "0xcc35362cfd686d2f50e1db8c4a864cbc1eb847eaf58007d8ce7295ae9e101102",
"sourceCodeHash": "0xb9f372ce43c42179efd7d7ee7f7df29f89c484efb7cd6e83430b615d1c2592d8" "sourceCodeHash": "0xafa784ea78818a382ff3a61e2d84be58c7978110c06b9273db68c0213ead02d3"
}, },
"src/L1/SystemConfig.sol": { "src/L1/SystemConfig.sol": {
"initCodeHash": "0x3ba55b46516de34186ff0cc92af9ca3ff916989ecb7d2fa9e82000f648607985", "initCodeHash": "0x11707ca5ef2bfc0da82e945cb97e62226852d850e8bdecb8ec22fc1ab7967894",
"sourceCodeHash": "0x4085b02ea01cd16172a1809ddd9be69c567f7b204cefc93f7c4d9071da812daa" "sourceCodeHash": "0x71cedc36b538c3db2ac43d1d9554583a3f09eee9e9a5c5d39608418bd466ee0e"
}, },
"src/L1/SystemConfigInterop.sol": { "src/L1/SystemConfigInterop.sol": {
"initCodeHash": "0xed198351099bd243a7a69e64944f43a3f203b5778ac55dbec428cc4df337cd8e", "initCodeHash": "0x53d4adf9db26e1217daccff4e91f9717925ad2e666d0953d43009535efd5ad3d",
"sourceCodeHash": "0x733fd71047569d974ac39477c6b6d55ec4100f32ac40b0597a0f7bdbde2867c3" "sourceCodeHash": "0x8a08e71f05581449c32ea15702c1881463a878243fd8bb90dea33a795abd0b84"
}, },
"src/L2/BaseFeeVault.sol": { "src/L2/BaseFeeVault.sol": {
"initCodeHash": "0x6745b7be3895a5e8d373df0066d931bae29c47672ac46c2f5829bd0052cc6d9e", "initCodeHash": "0xc403d4c555d8e69a2699e01d192ae7327136701fa02da10a6d75a584b3c364c9",
"sourceCodeHash": "0x45ea3acdbc8d1e583d4395239c9e9956e8cddda501f2e8eea50113333390f708" "sourceCodeHash": "0xfa56426153227e798150f6becc30a33fd20a3c6e0d73c797a3922dd631acbb57"
}, },
"src/L2/CrossL2Inbox.sol": { "src/L2/CrossL2Inbox.sol": {
"initCodeHash": "0x7a189f6dff6c19ec6f1e94d84a0d9d98a320a68812f957e50bf8b63224bb0dce", "initCodeHash": "0x7a189f6dff6c19ec6f1e94d84a0d9d98a320a68812f957e50bf8b63224bb0dce",
...@@ -80,20 +80,20 @@ ...@@ -80,20 +80,20 @@
"sourceCodeHash": "0xd0471c328c1d17c5863261322bf8d5aff2e7e9e3a1135631a993aa75667621df" "sourceCodeHash": "0xd0471c328c1d17c5863261322bf8d5aff2e7e9e3a1135631a993aa75667621df"
}, },
"src/L2/L2CrossDomainMessenger.sol": { "src/L2/L2CrossDomainMessenger.sol": {
"initCodeHash": "0xcef22d29fed2e160e4c4350dee5c7671d2fd280895f9d2e4655b7060c56d5ba7", "initCodeHash": "0xa6adb9d117af95f1a8be066b67a56ed8a029dd692ca363d636ad251ec9179945",
"sourceCodeHash": "0x754c71bffa5525159bc1d60c0085a5edc23fba0384a44e8c2c1215eaa7fd17b7" "sourceCodeHash": "0x74882c3cca14807219789b5b2b264ebd17479b409042c09db2da52736f9de36e"
}, },
"src/L2/L2ERC721Bridge.sol": { "src/L2/L2ERC721Bridge.sol": {
"initCodeHash": "0xf30040071bb7def116eab4c26c921d6c7b24e4f02d001601f52a1ee5bd6629fc", "initCodeHash": "0xa89e9b87c3b7ff8a4cd09fc121f371e6974a133be46e6be822f1773d775d973d",
"sourceCodeHash": "0xc7258cb394333527bfc58d0a8ba6bd9d90b46b60ace20a500d94192fea60aef4" "sourceCodeHash": "0xc3778aacf2f7ba182aebb84c8b9eeceaa0fe32da46422beb0dd9ee30dbd19383"
}, },
"src/L2/L2StandardBridge.sol": { "src/L2/L2StandardBridge.sol": {
"initCodeHash": "0x85d7cc69dfe340ffeee00d5a0524a199c11078504aa8007903c86572bd34a5c9", "initCodeHash": "0xde3b3a1aa0056d25ab3f4ad6e29b9d56c4740b29cd9bef36588d849ffc0178f6",
"sourceCodeHash": "0x411d8cf2f9ef44949962aaed71c6b40eb4bb93768888632fa8330bf249c2301b" "sourceCodeHash": "0x6c32dba4550b9c82d80666796e89c77799c21001691a116663970508121be03b"
}, },
"src/L2/L2StandardBridgeInterop.sol": { "src/L2/L2StandardBridgeInterop.sol": {
"initCodeHash": "0x6f121b0f0db6856f0cf36b112cc1a342530f15df962110a1a71c0d93cdd09f8a", "initCodeHash": "0xb8df14bf93beb53be269c641c80b50d6ad872894da49d5f60d0b976e0ba8839e",
"sourceCodeHash": "0x616bd1da0b2f9a4efe5841ba4c292f123802d155a2d3ac595ef25542ee475490" "sourceCodeHash": "0x3b35ee19099fc4ffb111a4cd774434c414e56d33017cce47fdba3f712e2429b1"
}, },
"src/L2/L2ToL1MessagePasser.sol": { "src/L2/L2ToL1MessagePasser.sol": {
"initCodeHash": "0xf9d82084dcef31a3737a76d8ee4e5842ea190d0f77ed4678adb3bbb95217050f", "initCodeHash": "0xf9d82084dcef31a3737a76d8ee4e5842ea190d0f77ed4678adb3bbb95217050f",
...@@ -152,16 +152,16 @@ ...@@ -152,16 +152,16 @@
"sourceCodeHash": "0x14b952b2a00bc4ec5e149bb5fb2a973bb255f0fd3f4a42b6bd05bc3bbe51f2b1" "sourceCodeHash": "0x14b952b2a00bc4ec5e149bb5fb2a973bb255f0fd3f4a42b6bd05bc3bbe51f2b1"
}, },
"src/dispute/AnchorStateRegistry.sol": { "src/dispute/AnchorStateRegistry.sol": {
"initCodeHash": "0x4e34a0d8de12cad21f37dc66755289ee38d1568a781f8ecc7ac38a0023d167ae", "initCodeHash": "0x2d831d6afc62df024eb2df22eaca3c7378171e63d87c608bb53c0020d30c3dee",
"sourceCodeHash": "0xc9a8758bdd790ea3eff1a2d7416934d34a48b4a4e5340a66bd41044b27d36952" "sourceCodeHash": "0xf1ce12bed377624e43697ae316646493e8df73a064bc4e250936964448326a70"
}, },
"src/dispute/DelayedWETH.sol": { "src/dispute/DelayedWETH.sol": {
"initCodeHash": "0xee29b653713e6c33d263cc0c24b922b7defc08a4cab8e0ee77ca25a8139ed8dd", "initCodeHash": "0x759d7f9c52b7c13ce4502f39dae3a75d130c6278240cde0b60ae84616aa2bd48",
"sourceCodeHash": "0xe6951dbc1d15c0e7dc0e88e25fe3a3d4511ac5b96a80091d5ec08e12004477af" "sourceCodeHash": "0x4406c78e0557bedb88b4ee5977acb1ef13e7bd92b7dbf79f56f8bad95c53e229"
}, },
"src/dispute/DisputeGameFactory.sol": { "src/dispute/DisputeGameFactory.sol": {
"initCodeHash": "0x35d72c68d7e408ad3f8cd7fb94e695292ab64cc7b2563609c31b315bffb713f2", "initCodeHash": "0xa728192115c5fdb08c633a0899043318289b1d413d7afeed06356008b2a5a7fa",
"sourceCodeHash": "0x0b480d83f7eb65e9a9de6feff1474382504e4a32076c769f535081ed99f52acf" "sourceCodeHash": "0x155c0334f63616ed245aadf9a94f419ef7d5e2237b3b32172484fd19890a61dc"
}, },
"src/dispute/FaultDisputeGame.sol": { "src/dispute/FaultDisputeGame.sol": {
"initCodeHash": "0x423e8488731c0b0f87b435174f412c09fbf0b17eb0b8c9a03efa37d779ec0cae", "initCodeHash": "0x423e8488731c0b0f87b435174f412c09fbf0b17eb0b8c9a03efa37d779ec0cae",
...@@ -200,8 +200,8 @@ ...@@ -200,8 +200,8 @@
"sourceCodeHash": "0xf5e29dd5c750ea935c7281ec916ba5277f5610a0a9e984e53ae5d5245b3cf2f4" "sourceCodeHash": "0xf5e29dd5c750ea935c7281ec916ba5277f5610a0a9e984e53ae5d5245b3cf2f4"
}, },
"src/universal/OptimismMintableERC20Factory.sol": { "src/universal/OptimismMintableERC20Factory.sol": {
"initCodeHash": "0xb90f9fa00ba07ade844594d0d7fa6b82458f934eb808a0538e6ff1b15a640c42", "initCodeHash": "0x2f289eb1695675c0a61ba24f30ce8b29c704fe5be93b469ebe8245f1e5e8ee5d",
"sourceCodeHash": "0x1a90221ddd0cfea197a29a3d66464c547b0ced9cffc92092c60698c89e68149c" "sourceCodeHash": "0x7f72c9293493b5e9f7854eb6768cb338aa49bf1aa6059e6a1a80bcd509b7b88f"
}, },
"src/universal/OptimismMintableERC721.sol": { "src/universal/OptimismMintableERC721.sol": {
"initCodeHash": "0xa43e7ffce142c0f2ae6ebe22decdf146dd39246830bec5cbd7903b32c2599048", "initCodeHash": "0xa43e7ffce142c0f2ae6ebe22decdf146dd39246830bec5cbd7903b32c2599048",
......
...@@ -95,8 +95,8 @@ contract DataAvailabilityChallenge is OwnableUpgradeable, ISemver { ...@@ -95,8 +95,8 @@ contract DataAvailabilityChallenge is OwnableUpgradeable, ISemver {
event BalanceChanged(address account, uint256 balance); event BalanceChanged(address account, uint256 balance);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.1-beta.4 /// @custom:semver 1.0.1-beta.5
string public constant version = "1.0.1-beta.4"; string public constant version = "1.0.1-beta.5";
/// @notice The fixed cost of resolving a challenge. /// @notice The fixed cost of resolving a challenge.
/// @dev The value is estimated by measuring the cost of resolving with `bytes(0)` /// @dev The value is estimated by measuring the cost of resolving with `bytes(0)`
...@@ -129,17 +129,9 @@ contract DataAvailabilityChallenge is OwnableUpgradeable, ISemver { ...@@ -129,17 +129,9 @@ contract DataAvailabilityChallenge is OwnableUpgradeable, ISemver {
/// @notice A mapping from challenged block numbers to challenged commitments to challenges. /// @notice A mapping from challenged block numbers to challenged commitments to challenges.
mapping(uint256 => mapping(bytes => Challenge)) internal challenges; mapping(uint256 => mapping(bytes => Challenge)) internal challenges;
/// @notice Constructs the DataAvailabilityChallenge contract. Cannot set /// @notice Constructs the DataAvailabilityChallenge contract.
/// the owner to `address(0)` due to the Ownable contract's
/// implementation, so set it to `address(0xdEaD)`.
constructor() OwnableUpgradeable() { constructor() OwnableUpgradeable() {
initialize({ _disableInitializers();
_owner: address(0xdEaD),
_challengeWindow: 0,
_resolveWindow: 0,
_bondSize: 0,
_resolverRefundPercentage: 0
});
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
...@@ -154,7 +146,7 @@ contract DataAvailabilityChallenge is OwnableUpgradeable, ISemver { ...@@ -154,7 +146,7 @@ contract DataAvailabilityChallenge is OwnableUpgradeable, ISemver {
uint256 _bondSize, uint256 _bondSize,
uint256 _resolverRefundPercentage uint256 _resolverRefundPercentage
) )
public external
initializer initializer
{ {
__Ownable_init(); __Ownable_init();
......
...@@ -30,16 +30,12 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver { ...@@ -30,16 +30,12 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver {
ISystemConfig public systemConfig; ISystemConfig public systemConfig;
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.4.1-beta.3 /// @custom:semver 2.4.1-beta.4
string public constant version = "2.4.1-beta.3"; string public constant version = "2.4.1-beta.4";
/// @notice Constructs the L1CrossDomainMessenger contract. /// @notice Constructs the L1CrossDomainMessenger contract.
constructor() CrossDomainMessenger() { constructor() {
initialize({ _disableInitializers();
_superchainConfig: ISuperchainConfig(address(0)),
_portal: IOptimismPortal(payable(address(0))),
_systemConfig: ISystemConfig(address(0))
});
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
...@@ -51,7 +47,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver { ...@@ -51,7 +47,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver {
IOptimismPortal _portal, IOptimismPortal _portal,
ISystemConfig _systemConfig ISystemConfig _systemConfig
) )
public external
initializer initializer
{ {
superchainConfig = _superchainConfig; superchainConfig = _superchainConfig;
......
...@@ -28,18 +28,18 @@ contract L1ERC721Bridge is ERC721Bridge, ISemver { ...@@ -28,18 +28,18 @@ contract L1ERC721Bridge is ERC721Bridge, ISemver {
ISuperchainConfig public superchainConfig; ISuperchainConfig public superchainConfig;
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.2.0-beta.2 /// @custom:semver 2.2.0-beta.3
string public constant version = "2.2.0-beta.2"; string public constant version = "2.2.0-beta.3";
/// @notice Constructs the L1ERC721Bridge contract. /// @notice Constructs the L1ERC721Bridge contract.
constructor() ERC721Bridge() { constructor() ERC721Bridge() {
initialize({ _messenger: ICrossDomainMessenger(address(0)), _superchainConfig: ISuperchainConfig(address(0)) }); _disableInitializers();
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
/// @param _messenger Contract of the CrossDomainMessenger on this network. /// @param _messenger Contract of the CrossDomainMessenger on this network.
/// @param _superchainConfig Contract of the SuperchainConfig contract on this network. /// @param _superchainConfig Contract of the SuperchainConfig contract on this network.
function initialize(ICrossDomainMessenger _messenger, ISuperchainConfig _superchainConfig) public initializer { function initialize(ICrossDomainMessenger _messenger, ISuperchainConfig _superchainConfig) external initializer {
superchainConfig = _superchainConfig; superchainConfig = _superchainConfig;
__ERC721Bridge_init({ _messenger: _messenger, _otherBridge: ERC721Bridge(payable(Predeploys.L2_ERC721_BRIDGE)) }); __ERC721Bridge_init({ _messenger: _messenger, _otherBridge: ERC721Bridge(payable(Predeploys.L2_ERC721_BRIDGE)) });
} }
......
...@@ -75,8 +75,8 @@ contract L1StandardBridge is StandardBridge, ISemver { ...@@ -75,8 +75,8 @@ contract L1StandardBridge is StandardBridge, ISemver {
); );
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.2.1-beta.4 /// @custom:semver 2.2.1-beta.5
string public constant version = "2.2.1-beta.4"; string public constant version = "2.2.1-beta.5";
/// @notice Address of the SuperchainConfig contract. /// @notice Address of the SuperchainConfig contract.
ISuperchainConfig public superchainConfig; ISuperchainConfig public superchainConfig;
...@@ -86,11 +86,7 @@ contract L1StandardBridge is StandardBridge, ISemver { ...@@ -86,11 +86,7 @@ contract L1StandardBridge is StandardBridge, ISemver {
/// @notice Constructs the L1StandardBridge contract. /// @notice Constructs the L1StandardBridge contract.
constructor() StandardBridge() { constructor() StandardBridge() {
initialize({ _disableInitializers();
_messenger: ICrossDomainMessenger(address(0)),
_superchainConfig: ISuperchainConfig(address(0)),
_systemConfig: ISystemConfig(address(0))
});
} }
/// @notice Initializer. /// @notice Initializer.
...@@ -101,7 +97,7 @@ contract L1StandardBridge is StandardBridge, ISemver { ...@@ -101,7 +97,7 @@ contract L1StandardBridge is StandardBridge, ISemver {
ISuperchainConfig _superchainConfig, ISuperchainConfig _superchainConfig,
ISystemConfig _systemConfig ISystemConfig _systemConfig
) )
public external
initializer initializer
{ {
superchainConfig = _superchainConfig; superchainConfig = _superchainConfig;
......
...@@ -60,21 +60,13 @@ contract L2OutputOracle is Initializable, ISemver { ...@@ -60,21 +60,13 @@ contract L2OutputOracle is Initializable, ISemver {
event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex); event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.8.1-beta.3 /// @custom:semver 1.8.1-beta.4
string public constant version = "1.8.1-beta.3"; string public constant version = "1.8.1-beta.4";
/// @notice Constructs the L2OutputOracle contract. Initializes variables to the same values as /// @notice Constructs the L2OutputOracle contract. Initializes variables to the same values as
/// in the getting-started config. /// in the getting-started config.
constructor() { constructor() {
initialize({ _disableInitializers();
_submissionInterval: 1,
_l2BlockTime: 1,
_startingBlockNumber: 0,
_startingTimestamp: 0,
_proposer: address(0),
_challenger: address(0),
_finalizationPeriodSeconds: 0
});
} }
/// @notice Initializer. /// @notice Initializer.
...@@ -95,7 +87,7 @@ contract L2OutputOracle is Initializable, ISemver { ...@@ -95,7 +87,7 @@ contract L2OutputOracle is Initializable, ISemver {
address _challenger, address _challenger,
uint256 _finalizationPeriodSeconds uint256 _finalizationPeriodSeconds
) )
public external
initializer initializer
{ {
require(_submissionInterval > 0, "L2OutputOracle: submission interval must be greater than 0"); require(_submissionInterval > 0, "L2OutputOracle: submission interval must be greater than 0");
......
...@@ -146,18 +146,14 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver { ...@@ -146,18 +146,14 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.8.1-beta.5 /// @custom:semver 2.8.1-beta.6
function version() public pure virtual returns (string memory) { function version() public pure virtual returns (string memory) {
return "2.8.1-beta.5"; return "2.8.1-beta.6";
} }
/// @notice Constructs the OptimismPortal contract. /// @notice Constructs the OptimismPortal contract.
constructor() { constructor() {
initialize({ _disableInitializers();
_l2Oracle: IL2OutputOracle(address(0)),
_systemConfig: ISystemConfig(address(0)),
_superchainConfig: ISuperchainConfig(address(0))
});
} }
/// @notice Initializer. /// @notice Initializer.
...@@ -169,7 +165,7 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver { ...@@ -169,7 +165,7 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
ISystemConfig _systemConfig, ISystemConfig _systemConfig,
ISuperchainConfig _superchainConfig ISuperchainConfig _superchainConfig
) )
public external
initializer initializer
{ {
l2Oracle = _l2Oracle; l2Oracle = _l2Oracle;
......
...@@ -183,9 +183,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -183,9 +183,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 3.11.0-beta.8 /// @custom:semver 3.11.0-beta.9
function version() public pure virtual returns (string memory) { function version() public pure virtual returns (string memory) {
return "3.11.0-beta.8"; return "3.11.0-beta.9";
} }
/// @notice Constructs the OptimismPortal contract. /// @notice Constructs the OptimismPortal contract.
...@@ -193,12 +193,7 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -193,12 +193,7 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
PROOF_MATURITY_DELAY_SECONDS = _proofMaturityDelaySeconds; PROOF_MATURITY_DELAY_SECONDS = _proofMaturityDelaySeconds;
DISPUTE_GAME_FINALITY_DELAY_SECONDS = _disputeGameFinalityDelaySeconds; DISPUTE_GAME_FINALITY_DELAY_SECONDS = _disputeGameFinalityDelaySeconds;
initialize({ _disableInitializers();
_disputeGameFactory: IDisputeGameFactory(address(0)),
_systemConfig: ISystemConfig(address(0)),
_superchainConfig: ISuperchainConfig(address(0)),
_initialRespectedGameType: GameType.wrap(0)
});
} }
/// @notice Initializer. /// @notice Initializer.
...@@ -211,7 +206,7 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -211,7 +206,7 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
ISuperchainConfig _superchainConfig, ISuperchainConfig _superchainConfig,
GameType _initialRespectedGameType GameType _initialRespectedGameType
) )
public external
initializer initializer
{ {
disputeGameFactory = _disputeGameFactory; disputeGameFactory = _disputeGameFactory;
......
...@@ -25,9 +25,9 @@ contract OptimismPortalInterop is OptimismPortal2 { ...@@ -25,9 +25,9 @@ contract OptimismPortalInterop is OptimismPortal2 {
OptimismPortal2(_proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds) OptimismPortal2(_proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds)
{ } { }
/// @custom:semver +interop-beta.5 /// @custom:semver +interop-beta.6
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop-beta.5"); return string.concat(super.version(), "+interop-beta.6");
} }
/// @notice Sets static configuration options for the L2 system. /// @notice Sets static configuration options for the L2 system.
......
...@@ -41,26 +41,19 @@ contract ProtocolVersions is OwnableUpgradeable, ISemver { ...@@ -41,26 +41,19 @@ contract ProtocolVersions is OwnableUpgradeable, ISemver {
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data); event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.1-beta.5 /// @custom:semver 1.0.1-beta.6
string public constant version = "1.0.1-beta.5"; string public constant version = "1.0.1-beta.6";
/// @notice Constructs the ProtocolVersion contract. Cannot set /// @notice Constructs the ProtocolVersion contract.
/// the owner to `address(0)` due to the Ownable contract's
/// implementation, so set it to `address(0xdEaD)`
/// A zero version is considered empty and is ignored by nodes.
constructor() { constructor() {
initialize({ _disableInitializers();
_owner: address(0xdEaD),
_required: ProtocolVersion.wrap(uint256(0)),
_recommended: ProtocolVersion.wrap(uint256(0))
});
} }
/// @notice Initializer. /// @notice Initializer.
/// @param _owner Initial owner of the contract. /// @param _owner Initial owner of the contract.
/// @param _required Required protocol version to operate on this chain. /// @param _required Required protocol version to operate on this chain.
/// @param _recommended Recommended protocol version to operate on thi chain. /// @param _recommended Recommended protocol version to operate on thi chain.
function initialize(address _owner, ProtocolVersion _required, ProtocolVersion _recommended) public initializer { function initialize(address _owner, ProtocolVersion _required, ProtocolVersion _recommended) external initializer {
__Ownable_init(); __Ownable_init();
transferOwnership(_owner); transferOwnership(_owner);
_setRequired(_required); _setRequired(_required);
......
...@@ -41,18 +41,18 @@ contract SuperchainConfig is Initializable, ISemver { ...@@ -41,18 +41,18 @@ contract SuperchainConfig is Initializable, ISemver {
event ConfigUpdate(UpdateType indexed updateType, bytes data); event ConfigUpdate(UpdateType indexed updateType, bytes data);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.1.1-beta.3 /// @custom:semver 1.1.1-beta.4
string public constant version = "1.1.1-beta.3"; string public constant version = "1.1.1-beta.4";
/// @notice Constructs the SuperchainConfig contract. /// @notice Constructs the SuperchainConfig contract.
constructor() { constructor() {
initialize({ _guardian: address(0), _paused: false }); _disableInitializers();
} }
/// @notice Initializer. /// @notice Initializer.
/// @param _guardian Address of the guardian, can pause the OptimismPortal. /// @param _guardian Address of the guardian, can pause the OptimismPortal.
/// @param _paused Initial paused status. /// @param _paused Initial paused status.
function initialize(address _guardian, bool _paused) public initializer { function initialize(address _guardian, bool _paused) external initializer {
_setGuardian(_guardian); _setGuardian(_guardian);
if (_paused) { if (_paused) {
_pause("Initializer paused"); _pause("Initializer paused");
......
...@@ -137,44 +137,17 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { ...@@ -137,44 +137,17 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken {
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data); event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.3.0-beta.7 /// @custom:semver 2.3.0-beta.8
function version() public pure virtual returns (string memory) { function version() public pure virtual returns (string memory) {
return "2.3.0-beta.7"; return "2.3.0-beta.8";
} }
/// @notice Constructs the SystemConfig contract. Cannot set /// @notice Constructs the SystemConfig contract.
/// the owner to `address(0)` due to the Ownable contract's
/// implementation, so set it to `address(0xdEaD)`
/// @dev START_BLOCK_SLOT is set to type(uint256).max here so that it will be a dead value /// @dev START_BLOCK_SLOT is set to type(uint256).max here so that it will be a dead value
/// in the singleton and is skipped by initialize when setting the start block. /// in the singleton.
constructor() { constructor() {
Storage.setUint(START_BLOCK_SLOT, type(uint256).max); Storage.setUint(START_BLOCK_SLOT, type(uint256).max);
initialize({ _disableInitializers();
_owner: address(0xdEaD),
_basefeeScalar: 0,
_blobbasefeeScalar: 0,
_batcherHash: bytes32(0),
_gasLimit: 1,
_unsafeBlockSigner: address(0),
_config: IResourceMetering.ResourceConfig({
maxResourceLimit: 1,
elasticityMultiplier: 1,
baseFeeMaxChangeDenominator: 2,
minimumBaseFee: 0,
systemTxMaxGas: 0,
maximumBaseFee: 0
}),
_batchInbox: address(0),
_addresses: SystemConfig.Addresses({
l1CrossDomainMessenger: address(0),
l1ERC721Bridge: address(0),
l1StandardBridge: address(0),
disputeGameFactory: address(0),
optimismPortal: address(0),
optimismMintableERC20Factory: address(0),
gasPayingToken: address(0)
})
});
} }
/// @notice Initializer. /// @notice Initializer.
......
...@@ -68,9 +68,9 @@ contract SystemConfigInterop is SystemConfig { ...@@ -68,9 +68,9 @@ contract SystemConfigInterop is SystemConfig {
Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager); Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager);
} }
/// @custom:semver +interop-beta.6 /// @custom:semver +interop-beta.7
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop-beta.6"); return string.concat(super.version(), "+interop-beta.7");
} }
/// @notice Internal setter for the gas paying token address, includes validation. /// @notice Internal setter for the gas paying token address, includes validation.
......
...@@ -16,8 +16,8 @@ import { ISemver } from "interfaces/universal/ISemver.sol"; ...@@ -16,8 +16,8 @@ import { ISemver } from "interfaces/universal/ISemver.sol";
/// @notice The BaseFeeVault accumulates the base fee that is paid by transactions. /// @notice The BaseFeeVault accumulates the base fee that is paid by transactions.
contract BaseFeeVault is FeeVault, ISemver { contract BaseFeeVault is FeeVault, ISemver {
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.5.0-beta.5 /// @custom:semver 1.5.0-beta.6
string public constant version = "1.5.0-beta.5"; string public constant version = "1.5.0-beta.6";
/// @notice Constructs the BaseFeeVault contract. /// @notice Constructs the BaseFeeVault contract.
/// @param _recipient Wallet that will receive the fees. /// @param _recipient Wallet that will receive the fees.
......
...@@ -20,17 +20,17 @@ import { IL1Block } from "interfaces/L2/IL1Block.sol"; ...@@ -20,17 +20,17 @@ import { IL1Block } from "interfaces/L2/IL1Block.sol";
/// L2 on the L2 side. Users are generally encouraged to use this contract instead of lower /// L2 on the L2 side. Users are generally encouraged to use this contract instead of lower
/// level message passing contracts. /// level message passing contracts.
contract L2CrossDomainMessenger is CrossDomainMessenger, ISemver { contract L2CrossDomainMessenger is CrossDomainMessenger, ISemver {
/// @custom:semver 2.1.1-beta.5 /// @custom:semver 2.1.1-beta.7
string public constant version = "2.1.1-beta.5"; string public constant version = "2.1.1-beta.7";
/// @notice Constructs the L2CrossDomainMessenger contract. /// @notice Constructs the L2CrossDomainMessenger contract.
constructor() CrossDomainMessenger() { constructor() {
initialize({ _l1CrossDomainMessenger: CrossDomainMessenger(address(0)) }); _disableInitializers();
} }
/// @notice Initializer. /// @notice Initializer.
/// @param _l1CrossDomainMessenger L1CrossDomainMessenger contract on the other network. /// @param _l1CrossDomainMessenger L1CrossDomainMessenger contract on the other network.
function initialize(CrossDomainMessenger _l1CrossDomainMessenger) public initializer { function initialize(CrossDomainMessenger _l1CrossDomainMessenger) external initializer {
__CrossDomainMessenger_init({ _otherMessenger: _l1CrossDomainMessenger }); __CrossDomainMessenger_init({ _otherMessenger: _l1CrossDomainMessenger });
} }
......
...@@ -26,17 +26,17 @@ import { ISemver } from "interfaces/universal/ISemver.sol"; ...@@ -26,17 +26,17 @@ import { ISemver } from "interfaces/universal/ISemver.sol";
/// wait for the one-week challenge period to elapse before their Optimism-native NFT /// wait for the one-week challenge period to elapse before their Optimism-native NFT
/// can be refunded on L2. /// can be refunded on L2.
contract L2ERC721Bridge is ERC721Bridge, ISemver { contract L2ERC721Bridge is ERC721Bridge, ISemver {
/// @custom:semver 1.8.0-beta.3 /// @custom:semver 1.8.0-beta.4
string public constant version = "1.8.0-beta.3"; string public constant version = "1.8.0-beta.4";
/// @notice Constructs the L2ERC721Bridge contract. /// @notice Constructs the L2ERC721Bridge contract.
constructor() ERC721Bridge() { constructor() ERC721Bridge() {
initialize({ _l1ERC721Bridge: payable(address(0)) }); _disableInitializers();
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
/// @param _l1ERC721Bridge Address of the ERC721 bridge contract on the other network. /// @param _l1ERC721Bridge Address of the ERC721 bridge contract on the other network.
function initialize(address payable _l1ERC721Bridge) public initializer { function initialize(address payable _l1ERC721Bridge) external initializer {
__ERC721Bridge_init({ __ERC721Bridge_init({
_messenger: ICrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER), _messenger: ICrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER),
_otherBridge: ERC721Bridge(_l1ERC721Bridge) _otherBridge: ERC721Bridge(_l1ERC721Bridge)
......
...@@ -58,19 +58,19 @@ contract L2StandardBridge is StandardBridge, ISemver { ...@@ -58,19 +58,19 @@ contract L2StandardBridge is StandardBridge, ISemver {
); );
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.11.1-beta.6 /// @custom:semver 1.11.1-beta.7
function version() public pure virtual returns (string memory) { function version() public pure virtual returns (string memory) {
return "1.11.1-beta.6"; return "1.11.1-beta.7";
} }
/// @notice Constructs the L2StandardBridge contract. /// @notice Constructs the L2StandardBridge contract.
constructor() StandardBridge() { constructor() StandardBridge() {
initialize({ _otherBridge: StandardBridge(payable(address(0))) }); _disableInitializers();
} }
/// @notice Initializer. /// @notice Initializer.
/// @param _otherBridge Contract for the corresponding bridge on the other chain. /// @param _otherBridge Contract for the corresponding bridge on the other chain.
function initialize(StandardBridge _otherBridge) public initializer { function initialize(StandardBridge _otherBridge) external initializer {
__StandardBridge_init({ __StandardBridge_init({
_messenger: ICrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER), _messenger: ICrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER),
_otherBridge: _otherBridge _otherBridge: _otherBridge
......
...@@ -39,9 +39,9 @@ contract L2StandardBridgeInterop is L2StandardBridge { ...@@ -39,9 +39,9 @@ contract L2StandardBridgeInterop is L2StandardBridge {
event Converted(address indexed from, address indexed to, address indexed caller, uint256 amount); event Converted(address indexed from, address indexed to, address indexed caller, uint256 amount);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver +interop-beta.6 /// @custom:semver +interop-beta.7
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop-beta.6"); return string.concat(super.version(), "+interop-beta.7");
} }
/// @notice Converts `amount` of `from` token to `to` token. /// @notice Converts `amount` of `from` token to `to` token.
......
...@@ -30,8 +30,8 @@ contract AnchorStateRegistry is Initializable, ISemver { ...@@ -30,8 +30,8 @@ contract AnchorStateRegistry is Initializable, ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.0.1-beta.5 /// @custom:semver 2.0.1-beta.6
string public constant version = "2.0.1-beta.5"; string public constant version = "2.0.1-beta.6";
/// @notice DisputeGameFactory address. /// @notice DisputeGameFactory address.
IDisputeGameFactory internal immutable DISPUTE_GAME_FACTORY; IDisputeGameFactory internal immutable DISPUTE_GAME_FACTORY;
...@@ -55,7 +55,7 @@ contract AnchorStateRegistry is Initializable, ISemver { ...@@ -55,7 +55,7 @@ contract AnchorStateRegistry is Initializable, ISemver {
StartingAnchorRoot[] memory _startingAnchorRoots, StartingAnchorRoot[] memory _startingAnchorRoots,
ISuperchainConfig _superchainConfig ISuperchainConfig _superchainConfig
) )
public external
initializer initializer
{ {
for (uint256 i = 0; i < _startingAnchorRoots.length; i++) { for (uint256 i = 0; i < _startingAnchorRoots.length; i++) {
......
...@@ -32,8 +32,8 @@ contract DelayedWETH is OwnableUpgradeable, WETH98, ISemver { ...@@ -32,8 +32,8 @@ contract DelayedWETH is OwnableUpgradeable, WETH98, ISemver {
event Unwrap(address indexed src, uint256 wad); event Unwrap(address indexed src, uint256 wad);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.2.0-beta.4 /// @custom:semver 1.2.0-beta.5
string public constant version = "1.2.0-beta.4"; string public constant version = "1.2.0-beta.5";
/// @notice Returns a withdrawal request for the given address. /// @notice Returns a withdrawal request for the given address.
mapping(address => mapping(address => WithdrawalRequest)) public withdrawals; mapping(address => mapping(address => WithdrawalRequest)) public withdrawals;
...@@ -47,13 +47,13 @@ contract DelayedWETH is OwnableUpgradeable, WETH98, ISemver { ...@@ -47,13 +47,13 @@ contract DelayedWETH is OwnableUpgradeable, WETH98, ISemver {
/// @param _delay The delay for withdrawals in seconds. /// @param _delay The delay for withdrawals in seconds.
constructor(uint256 _delay) { constructor(uint256 _delay) {
DELAY_SECONDS = _delay; DELAY_SECONDS = _delay;
initialize({ _owner: address(0), _config: ISuperchainConfig(address(0)) }); _disableInitializers();
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
/// @param _owner The address of the owner. /// @param _owner The address of the owner.
/// @param _config Address of the SuperchainConfig contract. /// @param _config Address of the SuperchainConfig contract.
function initialize(address _owner, ISuperchainConfig _config) public initializer { function initialize(address _owner, ISuperchainConfig _config) external initializer {
__Ownable_init(); __Ownable_init();
_transferOwnership(_owner); _transferOwnership(_owner);
config = _config; config = _config;
......
...@@ -49,8 +49,8 @@ contract DisputeGameFactory is OwnableUpgradeable, ISemver { ...@@ -49,8 +49,8 @@ contract DisputeGameFactory is OwnableUpgradeable, ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.1-beta.4 /// @custom:semver 1.0.1-beta.5
string public constant version = "1.0.1-beta.4"; string public constant version = "1.0.1-beta.5";
/// @notice `gameImpls` is a mapping that maps `GameType`s to their respective /// @notice `gameImpls` is a mapping that maps `GameType`s to their respective
/// `IDisputeGame` implementations. /// `IDisputeGame` implementations.
...@@ -69,12 +69,12 @@ contract DisputeGameFactory is OwnableUpgradeable, ISemver { ...@@ -69,12 +69,12 @@ contract DisputeGameFactory is OwnableUpgradeable, ISemver {
/// @notice Constructs a new DisputeGameFactory contract. /// @notice Constructs a new DisputeGameFactory contract.
constructor() OwnableUpgradeable() { constructor() OwnableUpgradeable() {
initialize(address(0)); _disableInitializers();
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
/// @param _owner The owner of the contract. /// @param _owner The owner of the contract.
function initialize(address _owner) public initializer { function initialize(address _owner) external initializer {
__Ownable_init(); __Ownable_init();
_transferOwnership(_owner); _transferOwnership(_owner);
} }
......
...@@ -51,17 +51,17 @@ contract OptimismMintableERC20Factory is ISemver, Initializable, IOptimismERC20F ...@@ -51,17 +51,17 @@ contract OptimismMintableERC20Factory is ISemver, Initializable, IOptimismERC20F
/// the OptimismMintableERC20 token contract since this contract /// the OptimismMintableERC20 token contract since this contract
/// is responsible for deploying OptimismMintableERC20 contracts. /// is responsible for deploying OptimismMintableERC20 contracts.
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.10.1-beta.7 /// @custom:semver 1.10.1-beta.8
string public constant version = "1.10.1-beta.7"; string public constant version = "1.10.1-beta.8";
/// @notice Constructs the OptimismMintableERC20Factory contract. /// @notice Constructs the OptimismMintableERC20Factory contract.
constructor() { constructor() {
initialize({ _bridge: address(0) }); _disableInitializers();
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
/// @param _bridge Address of the StandardBridge on this chain. /// @param _bridge Address of the StandardBridge on this chain.
function initialize(address _bridge) public initializer { function initialize(address _bridge) external initializer {
bridge = _bridge; bridge = _bridge;
} }
......
...@@ -33,8 +33,8 @@ contract L1CrossDomainMessenger_Test is CommonTest { ...@@ -33,8 +33,8 @@ contract L1CrossDomainMessenger_Test is CommonTest {
assertEq(address(impl.superchainConfig()), address(0)); assertEq(address(impl.superchainConfig()), address(0));
assertEq(address(impl.PORTAL()), address(0)); assertEq(address(impl.PORTAL()), address(0));
assertEq(address(impl.portal()), address(0)); assertEq(address(impl.portal()), address(0));
assertEq(address(impl.OTHER_MESSENGER()), Predeploys.L2_CROSS_DOMAIN_MESSENGER); assertEq(address(impl.OTHER_MESSENGER()), address(0));
assertEq(address(impl.otherMessenger()), Predeploys.L2_CROSS_DOMAIN_MESSENGER); assertEq(address(impl.otherMessenger()), address(0));
} }
/// @dev Tests that the proxy is initialized correctly. /// @dev Tests that the proxy is initialized correctly.
......
...@@ -72,8 +72,8 @@ contract L1ERC721Bridge_Test is CommonTest { ...@@ -72,8 +72,8 @@ contract L1ERC721Bridge_Test is CommonTest {
IL1ERC721Bridge impl = IL1ERC721Bridge(deploy.mustGetAddress("L1ERC721Bridge")); IL1ERC721Bridge impl = IL1ERC721Bridge(deploy.mustGetAddress("L1ERC721Bridge"));
assertEq(address(impl.MESSENGER()), address(0)); assertEq(address(impl.MESSENGER()), address(0));
assertEq(address(impl.messenger()), address(0)); assertEq(address(impl.messenger()), address(0));
assertEq(address(impl.OTHER_BRIDGE()), Predeploys.L2_ERC721_BRIDGE); assertEq(address(impl.OTHER_BRIDGE()), address(0));
assertEq(address(impl.otherBridge()), Predeploys.L2_ERC721_BRIDGE); assertEq(address(impl.otherBridge()), address(0));
assertEq(address(impl.superchainConfig()), address(0)); assertEq(address(impl.superchainConfig()), address(0));
} }
......
...@@ -40,8 +40,8 @@ contract L1StandardBridge_Initialize_Test is CommonTest { ...@@ -40,8 +40,8 @@ contract L1StandardBridge_Initialize_Test is CommonTest {
assertEq(address(impl.superchainConfig()), address(0)); assertEq(address(impl.superchainConfig()), address(0));
assertEq(address(impl.MESSENGER()), address(0)); assertEq(address(impl.MESSENGER()), address(0));
assertEq(address(impl.messenger()), address(0)); assertEq(address(impl.messenger()), address(0));
assertEq(address(impl.OTHER_BRIDGE()), Predeploys.L2_STANDARD_BRIDGE); assertEq(address(impl.OTHER_BRIDGE()), address(0));
assertEq(address(impl.otherBridge()), Predeploys.L2_STANDARD_BRIDGE); assertEq(address(impl.otherBridge()), address(0));
assertEq(address(l2StandardBridge), Predeploys.L2_STANDARD_BRIDGE); assertEq(address(l2StandardBridge), Predeploys.L2_STANDARD_BRIDGE);
assertEq(address(impl.systemConfig()), address(0)); assertEq(address(impl.systemConfig()), address(0));
} }
......
...@@ -49,10 +49,10 @@ contract L2OutputOracle_TestBase is CommonTest { ...@@ -49,10 +49,10 @@ contract L2OutputOracle_TestBase is CommonTest {
function test_constructor_succeeds() external { function test_constructor_succeeds() external {
IL2OutputOracle oracleImpl = IL2OutputOracle(address(new L2OutputOracle())); IL2OutputOracle oracleImpl = IL2OutputOracle(address(new L2OutputOracle()));
assertEq(oracleImpl.SUBMISSION_INTERVAL(), 1); assertEq(oracleImpl.SUBMISSION_INTERVAL(), 0);
assertEq(oracleImpl.submissionInterval(), 1); assertEq(oracleImpl.submissionInterval(), 0);
assertEq(oracleImpl.L2_BLOCK_TIME(), 1); assertEq(oracleImpl.L2_BLOCK_TIME(), 0);
assertEq(oracleImpl.l2BlockTime(), 1); assertEq(oracleImpl.l2BlockTime(), 0);
assertEq(oracleImpl.latestBlockNumber(), 0); assertEq(oracleImpl.latestBlockNumber(), 0);
assertEq(oracleImpl.startingBlockNumber(), 0); assertEq(oracleImpl.startingBlockNumber(), 0);
assertEq(oracleImpl.startingTimestamp(), 0); assertEq(oracleImpl.startingTimestamp(), 0);
......
...@@ -47,11 +47,11 @@ contract OptimismPortal_Test is CommonTest { ...@@ -47,11 +47,11 @@ contract OptimismPortal_Test is CommonTest {
assertEq(address(opImpl.l2Oracle()), address(0)); assertEq(address(opImpl.l2Oracle()), address(0));
assertEq(address(opImpl.systemConfig()), address(0)); assertEq(address(opImpl.systemConfig()), address(0));
assertEq(address(opImpl.superchainConfig()), address(0)); assertEq(address(opImpl.superchainConfig()), address(0));
assertEq(opImpl.l2Sender(), Constants.DEFAULT_L2_SENDER); assertEq(opImpl.l2Sender(), address(0));
(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) = opImpl.params(); (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) = opImpl.params();
assertEq(prevBaseFee, 1 gwei); assertEq(prevBaseFee, 0);
assertEq(prevBoughtGas, 0); assertEq(prevBoughtGas, 0);
assertEq(prevBlockNum, uint64(block.number)); assertEq(prevBlockNum, 0);
} }
/// @dev Tests that the initializer sets the correct values. /// @dev Tests that the initializer sets the correct values.
......
...@@ -53,7 +53,7 @@ contract OptimismPortal2_Test is CommonTest { ...@@ -53,7 +53,7 @@ contract OptimismPortal2_Test is CommonTest {
assertEq(address(opImpl.disputeGameFactory()), address(0)); assertEq(address(opImpl.disputeGameFactory()), address(0));
assertEq(address(opImpl.systemConfig()), address(0)); assertEq(address(opImpl.systemConfig()), address(0));
assertEq(address(opImpl.superchainConfig()), address(0)); assertEq(address(opImpl.superchainConfig()), address(0));
assertEq(opImpl.l2Sender(), Constants.DEFAULT_L2_SENDER); assertEq(opImpl.l2Sender(), address(0));
assertEq(opImpl.respectedGameType().raw(), deploy.cfg().respectedGameType()); assertEq(opImpl.respectedGameType().raw(), deploy.cfg().respectedGameType());
} }
......
...@@ -34,13 +34,13 @@ contract ProtocolVersions_Initialize_Test is ProtocolVersions_Init { ...@@ -34,13 +34,13 @@ contract ProtocolVersions_Initialize_Test is ProtocolVersions_Init {
assertEq(ProtocolVersion.unwrap(protocolVersionsImpl.required()), 0); assertEq(ProtocolVersion.unwrap(protocolVersionsImpl.required()), 0);
assertEq(ProtocolVersion.unwrap(protocolVersionsImpl.recommended()), 0); assertEq(ProtocolVersion.unwrap(protocolVersionsImpl.recommended()), 0);
assertEq(protocolVersionsImpl.owner(), address(0xdEad)); assertEq(protocolVersionsImpl.owner(), address(0));
} }
/// @dev Ensures that the events are emitted during initialization. /// @dev Ensures that the events are emitted during initialization.
function test_initialize_events_succeeds() external { function test_initialize_events_succeeds() external {
IProtocolVersions protocolVersionsImpl = IProtocolVersions(deploy.mustGetAddress("ProtocolVersions")); IProtocolVersions protocolVersionsImpl = IProtocolVersions(deploy.mustGetAddress("ProtocolVersions"));
assertEq(protocolVersionsImpl.owner(), address(0xdEad)); assertEq(protocolVersionsImpl.owner(), address(0));
// Wipe out the initialized slot so the proxy can be initialized again // Wipe out the initialized slot so the proxy can be initialized again
vm.store(address(protocolVersions), bytes32(0), bytes32(0)); vm.store(address(protocolVersions), bytes32(0), bytes32(0));
......
...@@ -48,18 +48,18 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init { ...@@ -48,18 +48,18 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init {
/// @dev Tests that constructor sets the correct values. /// @dev Tests that constructor sets the correct values.
function test_constructor_succeeds() external view { function test_constructor_succeeds() external view {
ISystemConfig impl = ISystemConfig(systemConfigImpl); ISystemConfig impl = ISystemConfig(systemConfigImpl);
assertEq(impl.owner(), address(0xdEaD)); assertEq(impl.owner(), address(0));
assertEq(impl.overhead(), 0); assertEq(impl.overhead(), 0);
assertEq(impl.scalar(), uint256(0x01) << 248); assertEq(impl.scalar(), 0);
assertEq(impl.batcherHash(), bytes32(0)); assertEq(impl.batcherHash(), bytes32(0));
assertEq(impl.gasLimit(), 1); assertEq(impl.gasLimit(), 0);
assertEq(impl.unsafeBlockSigner(), address(0)); assertEq(impl.unsafeBlockSigner(), address(0));
assertEq(impl.basefeeScalar(), 0); assertEq(impl.basefeeScalar(), 0);
assertEq(impl.blobbasefeeScalar(), 0); assertEq(impl.blobbasefeeScalar(), 0);
IResourceMetering.ResourceConfig memory actual = impl.resourceConfig(); IResourceMetering.ResourceConfig memory actual = impl.resourceConfig();
assertEq(actual.maxResourceLimit, 1); assertEq(actual.maxResourceLimit, 0);
assertEq(actual.elasticityMultiplier, 1); assertEq(actual.elasticityMultiplier, 0);
assertEq(actual.baseFeeMaxChangeDenominator, 2); assertEq(actual.baseFeeMaxChangeDenominator, 0);
assertEq(actual.minimumBaseFee, 0); assertEq(actual.minimumBaseFee, 0);
assertEq(actual.systemTxMaxGas, 0); assertEq(actual.systemTxMaxGas, 0);
assertEq(actual.maximumBaseFee, 0); assertEq(actual.maximumBaseFee, 0);
......
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