diff --git a/.semgrep/rules/sol-rules.yaml b/.semgrep/rules/sol-rules.yaml index ef272fb6fe1..cffab76b892 100644 --- a/.semgrep/rules/sol-rules.yaml +++ b/.semgrep/rules/sol-rules.yaml @@ -335,9 +335,7 @@ rules: - packages/contracts-bedrock/src/dispute/AnchorStateRegistry.sol - packages/contracts-bedrock/src/dispute/DelayedWETH.sol - packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol - - packages/contracts-bedrock/src/dispute/v2/FaultDisputeGameV2.sol - packages/contracts-bedrock/src/dispute/PermissionedDisputeGame.sol - - packages/contracts-bedrock/src/dispute/v2/PermissionedDisputeGameV2.sol - packages/contracts-bedrock/src/dispute/SuperFaultDisputeGame.sol - packages/contracts-bedrock/src/dispute/SuperPermissionedDisputeGame.sol - packages/contracts-bedrock/src/governance/MintManager.sol diff --git a/op-chain-ops/addresses/contracts.go b/op-chain-ops/addresses/contracts.go index 208dde83b5a..7efecff81c4 100644 --- a/op-chain-ops/addresses/contracts.go +++ b/op-chain-ops/addresses/contracts.go @@ -51,8 +51,8 @@ type ImplementationsContracts struct { OptimismMintableErc20FactoryImpl common.Address DisputeGameFactoryImpl common.Address AnchorStateRegistryImpl common.Address - FaultDisputeGameV2Impl common.Address - PermissionedDisputeGameV2Impl common.Address + FaultDisputeGameImpl common.Address + PermissionedDisputeGameImpl common.Address StorageSetterImpl common.Address } diff --git a/op-chain-ops/interopgen/deployments.go b/op-chain-ops/interopgen/deployments.go index 6a5e0a6143f..0cfa0254082 100644 --- a/op-chain-ops/interopgen/deployments.go +++ b/op-chain-ops/interopgen/deployments.go @@ -36,8 +36,8 @@ type Implementations struct { AnchorStateRegistryImpl common.Address `json:"AnchorStateRegistryImpl"` SuperchainConfigImpl common.Address `json:"SuperchainConfigImpl"` ProtocolVersionsImpl common.Address `json:"ProtocolVersionsImpl"` - FaultDisputeGameV2Impl common.Address `json:"FaultDisputeGameV2Impl"` - PermissionedDisputeGameV2Impl common.Address `json:"PermissionedDisputeGameV2Impl"` + FaultDisputeGameImpl common.Address `json:"FaultDisputeGameImpl"` + PermissionedDisputeGameImpl common.Address `json:"PermissionedDisputeGameImpl"` SuperFaultDisputeGameImpl common.Address `json:"SuperFaultDisputeGameImpl"` SuperPermissionedDisputeGameImpl common.Address `json:"SuperPermissionedDisputeGameImpl"` StorageSetterImpl common.Address `json:"StorageSetterImpl"` diff --git a/op-deployer/pkg/deployer/integration_test/apply_test.go b/op-deployer/pkg/deployer/integration_test/apply_test.go index 6d8d38ab7ac..d477104a129 100644 --- a/op-deployer/pkg/deployer/integration_test/apply_test.go +++ b/op-deployer/pkg/deployer/integration_test/apply_test.go @@ -546,7 +546,7 @@ func TestProofParamOverrides(t *testing.T) { return common.BigToHash(new(big.Int).SetUint64(val.(uint64))) } - pdgImpl := st.ImplementationsDeployment.PermissionedDisputeGameV2Impl + pdgImpl := st.ImplementationsDeployment.PermissionedDisputeGameImpl tests := []struct { name string caster func(t *testing.T, val any) common.Hash diff --git a/op-deployer/pkg/deployer/opcm/implementations.go b/op-deployer/pkg/deployer/opcm/implementations.go index 5438a2f2758..c36035cf07d 100644 --- a/op-deployer/pkg/deployer/opcm/implementations.go +++ b/op-deployer/pkg/deployer/opcm/implementations.go @@ -54,8 +54,8 @@ type DeployImplementationsOutput struct { AnchorStateRegistryImpl common.Address `json:"anchorStateRegistryImplAddress"` SuperchainConfigImpl common.Address `json:"superchainConfigImplAddress"` ProtocolVersionsImpl common.Address `json:"protocolVersionsImplAddress"` - FaultDisputeGameV2Impl common.Address `json:"faultDisputeGameV2ImplAddress"` - PermissionedDisputeGameV2Impl common.Address `json:"permissionedDisputeGameV2ImplAddress"` + FaultDisputeGameImpl common.Address `json:"faultDisputeGameImplAddress"` + PermissionedDisputeGameImpl common.Address `json:"permissionedDisputeGameImplAddress"` SuperFaultDisputeGameImpl common.Address `json:"superFaultDisputeGameImplAddress"` SuperPermissionedDisputeGameImpl common.Address `json:"superPermissionedDisputeGameImplAddress"` StorageSetterImpl common.Address `json:"storageSetterImplAddress"` diff --git a/op-deployer/pkg/deployer/opcm/opchain.go b/op-deployer/pkg/deployer/opcm/opchain.go index a0298c71b66..deecd0d6be9 100644 --- a/op-deployer/pkg/deployer/opcm/opchain.go +++ b/op-deployer/pkg/deployer/opcm/opchain.go @@ -110,8 +110,8 @@ type ReadImplementationAddressesOutput struct { DisputeGameFactory common.Address MipsSingleton common.Address PreimageOracleSingleton common.Address - FaultDisputeGameV2 common.Address - PermissionedDisputeGameV2 common.Address + FaultDisputeGame common.Address + PermissionedDisputeGame common.Address SuperFaultDisputeGame common.Address SuperPermissionedDisputeGame common.Address OpcmDeployer common.Address diff --git a/op-deployer/pkg/deployer/pipeline/implementations.go b/op-deployer/pkg/deployer/pipeline/implementations.go index e3a01d14dfb..6d577d64756 100644 --- a/op-deployer/pkg/deployer/pipeline/implementations.go +++ b/op-deployer/pkg/deployer/pipeline/implementations.go @@ -89,8 +89,8 @@ func DeployImplementations(env *Env, intent *state.Intent, st *state.State) erro OptimismMintableErc20FactoryImpl: dio.OptimismMintableERC20FactoryImpl, DisputeGameFactoryImpl: dio.DisputeGameFactoryImpl, AnchorStateRegistryImpl: dio.AnchorStateRegistryImpl, - FaultDisputeGameV2Impl: dio.FaultDisputeGameV2Impl, - PermissionedDisputeGameV2Impl: dio.PermissionedDisputeGameV2Impl, + FaultDisputeGameImpl: dio.FaultDisputeGameImpl, + PermissionedDisputeGameImpl: dio.PermissionedDisputeGameImpl, StorageSetterImpl: dio.StorageSetterImpl, } diff --git a/op-deployer/pkg/deployer/pipeline/opchain.go b/op-deployer/pkg/deployer/pipeline/opchain.go index 5fad788d25e..47baaa7fb99 100644 --- a/op-deployer/pkg/deployer/pipeline/opchain.go +++ b/op-deployer/pkg/deployer/pipeline/opchain.go @@ -76,8 +76,8 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm st.ImplementationsDeployment.DisputeGameFactoryImpl = impls.DisputeGameFactory st.ImplementationsDeployment.MipsImpl = impls.MipsSingleton st.ImplementationsDeployment.PreimageOracleImpl = impls.PreimageOracleSingleton - st.ImplementationsDeployment.FaultDisputeGameV2Impl = impls.FaultDisputeGameV2 - st.ImplementationsDeployment.PermissionedDisputeGameV2Impl = impls.PermissionedDisputeGameV2 + st.ImplementationsDeployment.FaultDisputeGameImpl = impls.FaultDisputeGame + st.ImplementationsDeployment.PermissionedDisputeGameImpl = impls.PermissionedDisputeGame st.ImplementationsDeployment.OpcmDeployerImpl = impls.OpcmDeployer st.ImplementationsDeployment.OpcmGameTypeAdderImpl = impls.OpcmGameTypeAdder st.ImplementationsDeployment.OpcmUpgraderImpl = impls.OpcmUpgrader @@ -158,11 +158,11 @@ func makeChainState(chainID common.Hash, impls opcm.ReadImplementationAddressesO opChainContracts.DelayedWethPermissionedGameProxy = dco.DelayedWETHPermissionedGameProxy opChainContracts.DelayedWethPermissionlessGameProxy = dco.DelayedWETHPermissionlessGameProxy - if (impls.PermissionedDisputeGameV2 != common.Address{}) { - opChainContracts.PermissionedDisputeGameImpl = impls.PermissionedDisputeGameV2 + if (impls.PermissionedDisputeGame != common.Address{}) { + opChainContracts.PermissionedDisputeGameImpl = impls.PermissionedDisputeGame } - if (impls.FaultDisputeGameV2 != common.Address{}) { - opChainContracts.FaultDisputeGameImpl = impls.FaultDisputeGameV2 + if (impls.FaultDisputeGame != common.Address{}) { + opChainContracts.FaultDisputeGameImpl = impls.FaultDisputeGame } return &state.ChainState{ diff --git a/op-e2e/bindings/opcontractsmanager.go b/op-e2e/bindings/opcontractsmanager.go index 794bd1597df..5c8dcecdb7a 100644 --- a/op-e2e/bindings/opcontractsmanager.go +++ b/op-e2e/bindings/opcontractsmanager.go @@ -53,15 +53,11 @@ type OPContractsManagerAddGameOutput struct { // OPContractsManagerBlueprints is an auto generated low-level Go binding around an user-defined struct. type OPContractsManagerBlueprints struct { - AddressManager common.Address - Proxy common.Address - ProxyAdmin common.Address - L1ChugSplashProxy common.Address - ResolvedDelegateProxy common.Address - PermissionedDisputeGame1 common.Address - PermissionedDisputeGame2 common.Address - PermissionlessDisputeGame1 common.Address - PermissionlessDisputeGame2 common.Address + AddressManager common.Address + Proxy common.Address + ProxyAdmin common.Address + L1ChugSplashProxy common.Address + ResolvedDelegateProxy common.Address } // OPContractsManagerDeployInput is an auto generated low-level Go binding around an user-defined struct. @@ -79,6 +75,7 @@ type OPContractsManagerDeployInput struct { DisputeSplitDepth *big.Int DisputeClockExtension uint64 DisputeMaxClockDuration uint64 + UseCustomGasToken bool } // OPContractsManagerDeployOutput is an auto generated low-level Go binding around an user-defined struct. @@ -116,8 +113,8 @@ type OPContractsManagerImplementations struct { AnchorStateRegistryImpl common.Address DelayedWETHImpl common.Address MipsImpl common.Address - FaultDisputeGameV2Impl common.Address - PermissionedDisputeGameV2Impl common.Address + FaultDisputeGameImpl common.Address + PermissionedDisputeGameImpl common.Address SuperFaultDisputeGameImpl common.Address SuperPermissionedDisputeGameImpl common.Address } @@ -196,8 +193,8 @@ type Proposal struct { // OPContractsManagerMetaData contains all meta data concerning the OPContractsManager contract. var OPContractsManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_opcmGameTypeAdder\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerGameTypeAdder\"},{\"name\":\"_opcmDeployer\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerDeployer\"},{\"name\":\"_opcmUpgrader\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerUpgrader\"},{\"name\":\"_opcmInteropMigrator\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerInteropMigrator\"},{\"name\":\"_opcmStandardValidator\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerStandardValidator\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"},{\"name\":\"_protocolVersions\",\"type\":\"address\",\"internalType\":\"contractIProtocolVersions\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addGameType\",\"inputs\":[{\"name\":\"_gameConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.AddGameInput[]\",\"components\":[{\"name\":\"saltMixer\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"delayedWETH\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"},{\"name\":\"disputeGameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"disputeAbsolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"disputeMaxGameDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeSplitDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeClockExtension\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"disputeMaxClockDuration\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"initialBond\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"vm\",\"type\":\"address\",\"internalType\":\"contractIBigStepper\"},{\"name\":\"permissioned\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.AddGameOutput[]\",\"components\":[{\"name\":\"delayedWETH\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"},{\"name\":\"faultDisputeGame\",\"type\":\"address\",\"internalType\":\"contractIFaultDisputeGame\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blueprints\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.Blueprints\",\"components\":[{\"name\":\"addressManager\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proxyAdmin\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ChugSplashProxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"resolvedDelegateProxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionedDisputeGame1\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionedDisputeGame2\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionlessDisputeGame1\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionlessDisputeGame2\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"chainIdToBatchInboxAddress\",\"inputs\":[{\"name\":\"_l2ChainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deploy\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.DeployInput\",\"components\":[{\"name\":\"roles\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.Roles\",\"components\":[{\"name\":\"opChainProxyAdminOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfigOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"batcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"unsafeBlockSigner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"basefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"blobBasefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"l2ChainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startingAnchorRoot\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"saltMixer\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"disputeGameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"disputeAbsolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"disputeMaxGameDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeSplitDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeClockExtension\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"disputeMaxClockDuration\",\"type\":\"uint64\",\"internalType\":\"Duration\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.DeployOutput\",\"components\":[{\"name\":\"opChainProxyAdmin\",\"type\":\"address\",\"internalType\":\"contractIProxyAdmin\"},{\"name\":\"addressManager\",\"type\":\"address\",\"internalType\":\"contractIAddressManager\"},{\"name\":\"l1ERC721BridgeProxy\",\"type\":\"address\",\"internalType\":\"contractIL1ERC721Bridge\"},{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"optimismMintableERC20FactoryProxy\",\"type\":\"address\",\"internalType\":\"contractIOptimismMintableERC20Factory\"},{\"name\":\"l1StandardBridgeProxy\",\"type\":\"address\",\"internalType\":\"contractIL1StandardBridge\"},{\"name\":\"l1CrossDomainMessengerProxy\",\"type\":\"address\",\"internalType\":\"contractIL1CrossDomainMessenger\"},{\"name\":\"ethLockboxProxy\",\"type\":\"address\",\"internalType\":\"contractIETHLockbox\"},{\"name\":\"optimismPortalProxy\",\"type\":\"address\",\"internalType\":\"contractIOptimismPortal2\"},{\"name\":\"disputeGameFactoryProxy\",\"type\":\"address\",\"internalType\":\"contractIDisputeGameFactory\"},{\"name\":\"anchorStateRegistryProxy\",\"type\":\"address\",\"internalType\":\"contractIAnchorStateRegistry\"},{\"name\":\"faultDisputeGame\",\"type\":\"address\",\"internalType\":\"contractIFaultDisputeGame\"},{\"name\":\"permissionedDisputeGame\",\"type\":\"address\",\"internalType\":\"contractIPermissionedDisputeGame\"},{\"name\":\"delayedWETHPermissionedGameProxy\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"},{\"name\":\"delayedWETHPermissionlessGameProxy\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"devFeatureBitmap\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"implementations\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.Implementations\",\"components\":[{\"name\":\"superchainConfigImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"protocolVersionsImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721BridgeImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortalImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortalInteropImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"ethLockboxImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfigImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20FactoryImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1CrossDomainMessengerImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridgeImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"disputeGameFactoryImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"anchorStateRegistryImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delayedWETHImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"mipsImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"faultDisputeGameV2Impl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionedDisputeGameV2Impl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"superFaultDisputeGameImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"superPermissionedDisputeGameImpl\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isDevFeatureEnabled\",\"inputs\":[{\"name\":\"_feature\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"migrate\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerInteropMigrator.MigrateInput\",\"components\":[{\"name\":\"usePermissionlessGame\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"startingAnchorRoot\",\"type\":\"tuple\",\"internalType\":\"structProposal\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"Hash\"},{\"name\":\"l2SequenceNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"gameParameters\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerInteropMigrator.GameParameters\",\"components\":[{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxGameDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"splitDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"initBond\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"clockExtension\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"maxClockDuration\",\"type\":\"uint64\",\"internalType\":\"Duration\"}]},{\"name\":\"opChainConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.OpChainConfig[]\",\"components\":[{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"opcmDeployer\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerDeployer\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmGameTypeAdder\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerGameTypeAdder\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmInteropMigrator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerInteropMigrator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmStandardValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerStandardValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmUpgrader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerUpgrader\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolVersions\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProtocolVersions\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updatePrestate\",\"inputs\":[{\"name\":\"_prestateUpdateInputs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.UpdatePrestateInput[]\",\"components\":[{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgrade\",\"inputs\":[{\"name\":\"_opChainConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.OpChainConfig[]\",\"components\":[{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeSuperchainConfig\",\"inputs\":[{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validate\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInput\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"absolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validate\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInputDev\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateWithOverrides\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInput\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"absolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"_overrides\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationOverrides\",\"components\":[{\"name\":\"l1PAOMultisig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateWithOverrides\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInputDev\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"_overrides\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationOverrides\",\"components\":[{\"name\":\"l1PAOMultisig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"error\",\"name\":\"AddressHasNoCode\",\"inputs\":[{\"name\":\"who\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AddressNotFound\",\"inputs\":[{\"name\":\"who\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AlreadyReleased\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidChainId\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDevFeatureAccess\",\"inputs\":[{\"name\":\"devFeature\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidGameConfigs\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoleAddress\",\"inputs\":[{\"name\":\"role\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"InvalidStartingAnchorRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"LatestReleaseNotSet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyDelegatecall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrestateNotSet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrestateRequired\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SuperchainConfigMismatch\",\"inputs\":[{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"}]},{\"type\":\"error\",\"name\":\"SuperchainProxyAdminMismatch\",\"inputs\":[]}]", - Bin: "0x6101806040523480156200001257600080fd5b5060405162002e0238038062002e02833981016040819052620000359162000306565b60405163b6a4cd2160e01b81526001600160a01b03838116600483015287169063b6a4cd219060240160006040518083038186803b1580156200007757600080fd5b505afa1580156200008c573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0384811660048301528916925063b6a4cd21915060240160006040518083038186803b158015620000d257600080fd5b505afa158015620000e7573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b038a811660048301528916925063b6a4cd21915060240160006040518083038186803b1580156200012d57600080fd5b505afa15801562000142573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b03891660048201819052925063b6a4cd21915060240160006040518083038186803b1580156200018757600080fd5b505afa1580156200019c573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0388811660048301528916925063b6a4cd21915060240160006040518083038186803b158015620001e257600080fd5b505afa158015620001f7573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0387811660048301528916925063b6a4cd21915060240160006040518083038186803b1580156200023d57600080fd5b505afa15801562000252573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0386811660048301528916925063b6a4cd21915060240160006040518083038186803b1580156200029857600080fd5b505afa158015620002ad573d6000803e3d6000fd5b5050506001600160a01b039788166080525094861660a05292851660c05290841660e05283166101005282166101205216610140523061016052620003b1565b6001600160a01b03811681146200030357600080fd5b50565b600080600080600080600060e0888a0312156200032257600080fd5b87516200032f81620002ed565b60208901519097506200034281620002ed565b60408901519096506200035581620002ed565b60608901519095506200036881620002ed565b60808901519094506200037b81620002ed565b60a08901519093506200038e81620002ed565b60c0890151909250620003a181620002ed565b8091505092959891949750929550565b60805160a05160c05160e0516101005161012051610140516101605161295f620004a3600039600081816108170152818161091701528181610c7b01528181610e400152610f3e0152600061034f0152600081816102600152610af20152600081816103d4015281816104890152818161078a01528181610c3801526110600152600081816101fb01526108e101526000818161019701528181610f0f0152611008015260008181610328015281816105130152818161062b015281816106de01528181610abb01528181610b920152610db50152600081816103fb015281816109e30152610d45015261295f6000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063613e827b116100e3578063b51f9c2b1161008c578063c993f27c11610066578063c993f27c1461041d578063cbeda5a714610430578063f3edcbe11461044357600080fd5b8063b51f9c2b146103ba578063ba7903db146103cf578063becbdf4a146103f657600080fd5b806378ecabce116100bd57806378ecabce146103715780638970ac4414610394578063b23cc044146103a757600080fd5b8063613e827b14610303578063622d56f1146103235780636624856a1461034a57600080fd5b8063318b1b801161014557806354fd4d501161011f57806354fd4d501461029557806358084273146102ce578063604aa628146102e357600080fd5b8063318b1b801461024857806335e80ab31461025b57806341fe53851461028257600080fd5b80631481a724116101765780631481a724146101f65780631d8a4e921461021d57806330e9012c1461023357600080fd5b806303dbe68c146101925780630e9d5cb9146101d6575b600080fd5b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101e96101e436600461131b565b610456565b6040516101cd91906113be565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b61022561050f565b6040519081526020016101cd565b61023b610598565b6040516101cd91906113d1565b6101b9610256366004611539565b6106ac565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6101e9610290366004611552565b610757565b60408051808201909152600581527f352e342e3000000000000000000000000000000000000000000000000000000060208201526101e9565b6102e16102dc36600461158a565b61080d565b005b6102f66102f136600461169d565b61090b565b6040516101cd9190611832565b61031661031136600461188e565b610a1e565b6040516101cd91906118ca565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b61038461037f366004611539565b610b60565b60405190151581526020016101cd565b6101e96103a2366004611a8a565b610c05565b6102e16103b5366004611b6e565b610c71565b6103c2610d6a565b6040516101cd9190611bb7565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6102e161042b366004611c33565b610e36565b6102e161043e366004611b6e565b610f34565b6101e9610451366004611c50565b61102d565b6040517f0e9d5cb90000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630e9d5cb9906104c290879087908790600401611c7d565b600060405180830381865afa1580156104df573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105079190810190611cdf565b949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d8a4e926040518163ffffffff1660e01b8152600401602060405180830381865afa15801561056f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105939190611d56565b905090565b6040805161024081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166330e9012c6040518163ffffffff1660e01b815260040161024060405180830381865afa158015610688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105939190611d7a565b6040517f318b1b80000000000000000000000000000000000000000000000000000000008152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063318b1b8090602401602060405180830381865afa15801561072d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107519190611ed2565b92915050565b6040517f41fe53850000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906341fe5385906107c19086908690600401611eef565b600060405180830381865afa1580156107de573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108069190810190611cdf565b9392505050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361086f576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816040516024016108829190612001565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f580842730000000000000000000000000000000000000000000000000000000017905290506109067f000000000000000000000000000000000000000000000000000000000000000082611097565b505050565b60606001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361096f576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260405160240161098291906120f4565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f604aa6280000000000000000000000000000000000000000000000000000000017905290506000610a087f000000000000000000000000000000000000000000000000000000000000000083611097565b9050808060200190518101906105079190612229565b604080516101e081018252600080825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082015290517fb2e48a3f0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b2e48a3f90610b1c9085907f0000000000000000000000000000000000000000000000000000000000000000903390600401612412565b6101e0604051808303816000875af1158015610b3c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075191906125c7565b6040517f78ecabce000000000000000000000000000000000000000000000000000000008152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906378ecabce90602401602060405180830381865afa158015610be1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075191906126de565b6040517f8970ac440000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638970ac44906104c2908790879087906004016126fb565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610cd3576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081604051602401610ce6919061276c565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb23cc0440000000000000000000000000000000000000000000000000000000017905290506109067f000000000000000000000000000000000000000000000000000000000000000082611097565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b51f9c2b6040518163ffffffff1660e01b815260040161012060405180830381865afa158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059391906127d7565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610e98576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038216602482015260009060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc993f27c0000000000000000000000000000000000000000000000000000000017905290506109067f000000000000000000000000000000000000000000000000000000000000000082611097565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610f96576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081604051602401610fa99190612882565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbeda5a70000000000000000000000000000000000000000000000000000000017905290506109067f000000000000000000000000000000000000000000000000000000000000000082611097565b6040517ff3edcbe10000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f3edcbe1906107c190869086906004016128e1565b6060600080846001600160a01b0316846040516110b49190612936565b600060405180830381855af49150503d80600081146110ef576040519150601f19603f3d011682016040523d82523d6000602084013e6110f4565b606091505b50915091508161050757805160208201fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561115857611158611106565b60405290565b604051610180810167ffffffffffffffff8111828210171561115857611158611106565b604051610240810167ffffffffffffffff8111828210171561115857611158611106565b6040516101e0810167ffffffffffffffff8111828210171561115857611158611106565b604051610120810167ffffffffffffffff8111828210171561115857611158611106565b604051601f8201601f1916810167ffffffffffffffff8111828210171561121757611217611106565b604052919050565b6001600160a01b038116811461123457600080fd5b50565b80356112428161121f565b919050565b60006080828403121561125957600080fd5b6040516080810181811067ffffffffffffffff8211171561127c5761127c611106565b604052905080823561128d8161121f565b80825250602083013560208201526040830135604082015260608301356112b38161121f565b6060919091015292915050565b801515811461123457600080fd5b8035611242816112c0565b6000604082840312156112eb57600080fd5b6112f3611135565b905081356113008161121f565b815260208201356113108161121f565b602082015292915050565b600080600060e0848603121561133057600080fd5b61133a8585611247565b9250608084013561134a816112c0565b91506113598560a086016112d9565b90509250925092565b60005b8381101561137d578181015183820152602001611365565b8381111561138c576000848401525b50505050565b600081518084526113aa816020860160208601611362565b601f01601f19169290920160200192915050565b6020815260006108066020830184611392565b81516001600160a01b03168152610240810160208301516113fd60208401826001600160a01b03169052565b50604083015161141860408401826001600160a01b03169052565b50606083015161143360608401826001600160a01b03169052565b50608083015161144e60808401826001600160a01b03169052565b5060a083015161146960a08401826001600160a01b03169052565b5060c083015161148460c08401826001600160a01b03169052565b5060e083015161149f60e08401826001600160a01b03169052565b50610100838101516001600160a01b0390811691840191909152610120808501518216908401526101408085015182169084015261016080850151821690840152610180808501518216908401526101a0808501518216908401526101c0808501518216908401526101e080850151821690840152610200808501518216908401526102208085015191821681850152905b505092915050565b60006020828403121561154b57600080fd5b5035919050565b60008060a0838503121561156557600080fd5b61156f8484611247565b9150608083013561157f816112c0565b809150509250929050565b60006020828403121561159c57600080fd5b813567ffffffffffffffff8111156115b357600080fd5b8201610160818503121561080657600080fd5b600067ffffffffffffffff8211156115e0576115e0611106565b5060051b60200190565b600067ffffffffffffffff82111561160457611604611106565b50601f01601f191660200190565b600082601f83011261162357600080fd5b8135611636611631826115ea565b6111ee565b81815284602083860101111561164b57600080fd5b816020850160208301376000918101602001919091529392505050565b803563ffffffff8116811461124257600080fd5b67ffffffffffffffff8116811461123457600080fd5b80356112428161167c565b600060208083850312156116b057600080fd5b823567ffffffffffffffff808211156116c857600080fd5b818501915085601f8301126116dc57600080fd5b81356116ea611631826115c6565b81815260059190911b8301840190848101908883111561170957600080fd5b8585015b83811015611825578035858111156117255760008081fd5b8601610180818c03601f190181131561173e5760008081fd5b61174661115e565b89830135888111156117585760008081fd5b6117668e8c83870101611612565b8252506040611776818501611237565b8b8301526060611787818601611237565b828401526080915061179a828601611668565b818401525060a0808501358284015260c0915081850135818401525060e0808501358284015261010091506117d0828601611692565b908301526101206117e2858201611692565b828401526101409150818501358184015250610160611802818601611237565b828401526118118486016112ce565b90830152508552505091860191860161170d565b5098975050505050505050565b602080825282518282018190526000919060409081850190868401855b8281101561188157815180516001600160a01b039081168652908701511686850152928401929085019060010161184f565b5091979650505050505050565b6000602082840312156118a057600080fd5b813567ffffffffffffffff8111156118b757600080fd5b8201610240818503121561080657600080fd5b81516001600160a01b031681526101e0810160208301516118f660208401826001600160a01b03169052565b50604083015161191160408401826001600160a01b03169052565b50606083015161192c60608401826001600160a01b03169052565b50608083015161194760808401826001600160a01b03169052565b5060a083015161196260a08401826001600160a01b03169052565b5060c083015161197d60c08401826001600160a01b03169052565b5060e083015161199860e08401826001600160a01b03169052565b50610100838101516001600160a01b0390811691840191909152610120808501518216908401526101408085015182169084015261016080850151821690840152610180808501518216908401526101a0808501518216908401526101c0808501519182168185015290611531565b600060a08284031215611a1957600080fd5b60405160a0810181811067ffffffffffffffff82111715611a3c57611a3c611106565b6040529050808235611a4d8161121f565b808252506020830135602082015260408301356040820152606083013560608201526080830135611a7d8161121f565b6080919091015292915050565b60008060006101008486031215611aa057600080fd5b611aaa8585611a07565b925060a0840135611aba816112c0565b91506113598560c086016112d9565b6000611ad7611631846115c6565b83815290506020808201906060808602850187811115611af657600080fd5b855b81811015611b625782818a031215611b105760008081fd5b6040805184810181811067ffffffffffffffff82111715611b3357611b33611106565b82528235611b408161121f565b8152828601358682015281830135918101919091528552938301938201611af8565b50505050509392505050565b600060208284031215611b8057600080fd5b813567ffffffffffffffff811115611b9757600080fd5b8201601f81018413611ba857600080fd5b61050784823560208401611ac9565b81516001600160a01b03908116825260208084015182169083015260408084015182169083015260608084015182169083015260808084015182169083015260a08084015182169083015260c08084015182169083015260e0808401518216908301526101008084015191821681840152610120830191611531565b600060208284031215611c4557600080fd5b81356108068161121f565b60008060c08385031215611c6357600080fd5b611c6d8484611a07565b915060a083013561157f816112c0565b60e08101611cb5828680516001600160a01b039081168352602080830151908401526040808301519084015260609182015116910152565b831515608083015282516001600160a01b0390811660a084015260208401511660c0830152610507565b600060208284031215611cf157600080fd5b815167ffffffffffffffff811115611d0857600080fd5b8201601f81018413611d1957600080fd5b8051611d27611631826115ea565b818152856020838501011115611d3c57600080fd5b611d4d826020830160208601611362565b95945050505050565b600060208284031215611d6857600080fd5b5051919050565b80516112428161121f565b60006102408284031215611d8d57600080fd5b611d95611182565b611d9e83611d6f565b8152611dac60208401611d6f565b6020820152611dbd60408401611d6f565b6040820152611dce60608401611d6f565b6060820152611ddf60808401611d6f565b6080820152611df060a08401611d6f565b60a0820152611e0160c08401611d6f565b60c0820152611e1260e08401611d6f565b60e0820152610100611e25818501611d6f565b90820152610120611e37848201611d6f565b90820152610140611e49848201611d6f565b90820152610160611e5b848201611d6f565b90820152610180611e6d848201611d6f565b908201526101a0611e7f848201611d6f565b908201526101c0611e91848201611d6f565b908201526101e0611ea3848201611d6f565b90820152610200611eb5848201611d6f565b90820152610220611ec7848201611d6f565b908201529392505050565b600060208284031215611ee457600080fd5b81516108068161121f565b60a08101611f27828580516001600160a01b039081168352602080830151908401526040808301519084015260609182015116910152565b82151560808301529392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611f6b57600080fd5b830160208101925035905067ffffffffffffffff811115611f8b57600080fd5b606081023603821315611f9d57600080fd5b9250929050565b8183526000602080850194508260005b85811015611ff6578135611fc78161121f565b6001600160a01b0316875281830135838801526040808301359088015260609687019690910190600101611fb4565b509495945050505050565b6020815260008235612012816112c0565b8015156020840152506020830135604083015260408301356060830152606083013561203d8161121f565b6001600160a01b0380821660808501526080850135915061205d8261121f565b80821660a0850152505060a083013560c083015260c083013560e083015261010060e0840135818401528084013590506120968161167c565b61012067ffffffffffffffff8216818501526120b3818601611692565b9150506101406120ce8185018367ffffffffffffffff169052565b6120da81860186611f36565b6101608681015292509050611d4d61018085018383611fa4565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561221b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08984030185528151610180815181865261216082870182611392565b9150508882015161217b8a8701826001600160a01b03169052565b50878201516001600160a01b03908116868a015260608084015163ffffffff16908701526080808401519087015260a0808401519087015260c0808401519087015260e08084015167ffffffffffffffff908116918801919091526101008085015190911690870152610120808401519087015261014080840151909116908601526101609182015115159190940152938601939086019060010161211b565b509098975050505050505050565b6000602080838503121561223c57600080fd5b825167ffffffffffffffff81111561225357600080fd5b8301601f8101851361226457600080fd5b8051612272611631826115c6565b81815260069190911b8201830190838101908783111561229157600080fd5b928401925b828410156122e757604084890312156122af5760008081fd5b6122b7611135565b84516122c28161121f565b8152848601516122d18161121f565b8187015282526040939093019290840190612296565b979650505050505050565b80356122fd8161121f565b6001600160a01b0390811683526020820135906123198261121f565b90811660208401526040820135906123308261121f565b90811660408401526060820135906123478261121f565b908116606084015260808201359061235e8261121f565b908116608084015260a0820135906123758261121f565b80821660a085015250505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126123b857600080fd5b830160208101925035905067ffffffffffffffff8111156123d857600080fd5b803603821315611f9d57600080fd5b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6060815261242360608201856122f2565b600061243160c08601611668565b6101206124458185018363ffffffff169052565b61245160e08801611668565b91506101406124678186018463ffffffff169052565b61016092506101008801358386015261248282890189612383565b9250610240610180818189015261249e6102a0890186856123e7565b94506124ac848c018c612383565b945092506101a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa089870301818a01526124e78686866123e7565b95506124f4878d01611692565b96506101c09450612510858a018867ffffffffffffffff169052565b61251b828d01611668565b96506101e09350612533848a018863ffffffff169052565b6102009650808c0135878a01525050610220838b013581890152828b013582890152612560868c01611692565b67ffffffffffffffff81166102608a0152955061257e818c01611692565b95505050505061259b61028085018367ffffffffffffffff169052565b6001600160a01b038616602085015291506125b39050565b6001600160a01b0383166040830152610507565b60006101e082840312156125da57600080fd5b6125e26111a6565b6125eb83611d6f565b81526125f960208401611d6f565b602082015261260a60408401611d6f565b604082015261261b60608401611d6f565b606082015261262c60808401611d6f565b608082015261263d60a08401611d6f565b60a082015261264e60c08401611d6f565b60c082015261265f60e08401611d6f565b60e0820152610100612672818501611d6f565b90820152610120612684848201611d6f565b90820152610140612696848201611d6f565b908201526101606126a8848201611d6f565b908201526101806126ba848201611d6f565b908201526101a06126cc848201611d6f565b908201526101c0611ec7848201611d6f565b6000602082840312156126f057600080fd5b8151610806816112c0565b610100810161274282866001600160a01b03808251168352602082015160208401526040820151604084015260608201516060840152806080830151166080840152505050565b83151560a083015282516001600160a01b0390811660c084015260208401511660e0830152610507565b6020808252825182820181905260009190848201906040850190845b818110156127cb576127b883855180516001600160a01b0316825260208082015190830152604090810151910152565b9284019260609290920191600101612788565b50909695505050505050565b600061012082840312156127ea57600080fd5b6127f26111ca565b6127fb83611d6f565b815261280960208401611d6f565b602082015261281a60408401611d6f565b604082015261282b60608401611d6f565b606082015261283c60808401611d6f565b608082015261284d60a08401611d6f565b60a082015261285e60c08401611d6f565b60c082015261286f60e08401611d6f565b60e0820152610100611ec7818501611d6f565b6020808252825182820181905260009190848201906040850190845b818110156127cb576128ce83855180516001600160a01b0316825260208082015190830152604090810151910152565b928401926060929092019160010161289e565b60c0810161292782856001600160a01b03808251168352602082015160208401526040820151604084015260608201516060840152806080830151166080840152505050565b82151560a08301529392505050565b60008251612948818460208701611362565b919091019291505056fea164736f6c634300080f000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_opcmGameTypeAdder\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerGameTypeAdder\"},{\"name\":\"_opcmDeployer\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerDeployer\"},{\"name\":\"_opcmUpgrader\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerUpgrader\"},{\"name\":\"_opcmInteropMigrator\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerInteropMigrator\"},{\"name\":\"_opcmStandardValidator\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerStandardValidator\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"},{\"name\":\"_protocolVersions\",\"type\":\"address\",\"internalType\":\"contractIProtocolVersions\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addGameType\",\"inputs\":[{\"name\":\"_gameConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.AddGameInput[]\",\"components\":[{\"name\":\"saltMixer\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"delayedWETH\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"},{\"name\":\"disputeGameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"disputeAbsolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"disputeMaxGameDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeSplitDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeClockExtension\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"disputeMaxClockDuration\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"initialBond\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"vm\",\"type\":\"address\",\"internalType\":\"contractIBigStepper\"},{\"name\":\"permissioned\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.AddGameOutput[]\",\"components\":[{\"name\":\"delayedWETH\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"},{\"name\":\"faultDisputeGame\",\"type\":\"address\",\"internalType\":\"contractIFaultDisputeGame\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blueprints\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.Blueprints\",\"components\":[{\"name\":\"addressManager\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proxyAdmin\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ChugSplashProxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"resolvedDelegateProxy\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"chainIdToBatchInboxAddress\",\"inputs\":[{\"name\":\"_l2ChainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deploy\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.DeployInput\",\"components\":[{\"name\":\"roles\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.Roles\",\"components\":[{\"name\":\"opChainProxyAdminOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfigOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"batcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"unsafeBlockSigner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"basefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"blobBasefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"l2ChainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startingAnchorRoot\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"saltMixer\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"disputeGameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"disputeAbsolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"disputeMaxGameDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeSplitDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"disputeClockExtension\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"disputeMaxClockDuration\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"useCustomGasToken\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.DeployOutput\",\"components\":[{\"name\":\"opChainProxyAdmin\",\"type\":\"address\",\"internalType\":\"contractIProxyAdmin\"},{\"name\":\"addressManager\",\"type\":\"address\",\"internalType\":\"contractIAddressManager\"},{\"name\":\"l1ERC721BridgeProxy\",\"type\":\"address\",\"internalType\":\"contractIL1ERC721Bridge\"},{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"optimismMintableERC20FactoryProxy\",\"type\":\"address\",\"internalType\":\"contractIOptimismMintableERC20Factory\"},{\"name\":\"l1StandardBridgeProxy\",\"type\":\"address\",\"internalType\":\"contractIL1StandardBridge\"},{\"name\":\"l1CrossDomainMessengerProxy\",\"type\":\"address\",\"internalType\":\"contractIL1CrossDomainMessenger\"},{\"name\":\"ethLockboxProxy\",\"type\":\"address\",\"internalType\":\"contractIETHLockbox\"},{\"name\":\"optimismPortalProxy\",\"type\":\"address\",\"internalType\":\"contractIOptimismPortal2\"},{\"name\":\"disputeGameFactoryProxy\",\"type\":\"address\",\"internalType\":\"contractIDisputeGameFactory\"},{\"name\":\"anchorStateRegistryProxy\",\"type\":\"address\",\"internalType\":\"contractIAnchorStateRegistry\"},{\"name\":\"faultDisputeGame\",\"type\":\"address\",\"internalType\":\"contractIFaultDisputeGame\"},{\"name\":\"permissionedDisputeGame\",\"type\":\"address\",\"internalType\":\"contractIPermissionedDisputeGame\"},{\"name\":\"delayedWETHPermissionedGameProxy\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"},{\"name\":\"delayedWETHPermissionlessGameProxy\",\"type\":\"address\",\"internalType\":\"contractIDelayedWETH\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"devFeatureBitmap\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"implementations\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManager.Implementations\",\"components\":[{\"name\":\"superchainConfigImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"protocolVersionsImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721BridgeImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortalImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortalInteropImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"ethLockboxImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfigImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20FactoryImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1CrossDomainMessengerImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridgeImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"disputeGameFactoryImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"anchorStateRegistryImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delayedWETHImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"mipsImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"faultDisputeGameImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"permissionedDisputeGameImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"superFaultDisputeGameImpl\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"superPermissionedDisputeGameImpl\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isDevFeatureEnabled\",\"inputs\":[{\"name\":\"_feature\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"migrate\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerInteropMigrator.MigrateInput\",\"components\":[{\"name\":\"usePermissionlessGame\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"startingAnchorRoot\",\"type\":\"tuple\",\"internalType\":\"structProposal\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"Hash\"},{\"name\":\"l2SequenceNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"gameParameters\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerInteropMigrator.GameParameters\",\"components\":[{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxGameDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"splitDepth\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"initBond\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"clockExtension\",\"type\":\"uint64\",\"internalType\":\"Duration\"},{\"name\":\"maxClockDuration\",\"type\":\"uint64\",\"internalType\":\"Duration\"}]},{\"name\":\"opChainConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.OpChainConfig[]\",\"components\":[{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"opcmDeployer\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerDeployer\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmGameTypeAdder\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerGameTypeAdder\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmInteropMigrator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerInteropMigrator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmStandardValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerStandardValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"opcmUpgrader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOPContractsManagerUpgrader\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolVersions\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProtocolVersions\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updatePrestate\",\"inputs\":[{\"name\":\"_prestateUpdateInputs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.UpdatePrestateInput[]\",\"components\":[{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgrade\",\"inputs\":[{\"name\":\"_opChainConfigs\",\"type\":\"tuple[]\",\"internalType\":\"structOPContractsManager.OpChainConfig[]\",\"components\":[{\"name\":\"systemConfigProxy\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeSuperchainConfig\",\"inputs\":[{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validate\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInput\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"absolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validate\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInputDev\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateWithOverrides\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInput\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"absolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"_overrides\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationOverrides\",\"components\":[{\"name\":\"l1PAOMultisig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateWithOverrides\",\"inputs\":[{\"name\":\"_input\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationInputDev\",\"components\":[{\"name\":\"sysCfg\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"},{\"name\":\"cannonPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"cannonKonaPrestate\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2ChainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_allowFailure\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"_overrides\",\"type\":\"tuple\",\"internalType\":\"structOPContractsManagerStandardValidator.ValidationOverrides\",\"components\":[{\"name\":\"l1PAOMultisig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"challenger\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"error\",\"name\":\"AddressHasNoCode\",\"inputs\":[{\"name\":\"who\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AddressNotFound\",\"inputs\":[{\"name\":\"who\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AlreadyReleased\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidChainId\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDevFeatureAccess\",\"inputs\":[{\"name\":\"devFeature\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidGameConfigs\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoleAddress\",\"inputs\":[{\"name\":\"role\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"InvalidStartingAnchorRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"LatestReleaseNotSet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OPContractsManager_V2Enabled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyDelegatecall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrestateNotSet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrestateRequired\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SuperchainConfigMismatch\",\"inputs\":[{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"contractISystemConfig\"}]},{\"type\":\"error\",\"name\":\"SuperchainProxyAdminMismatch\",\"inputs\":[]}]", + Bin: "0x6101806040523480156200001257600080fd5b5060405162002e0a38038062002e0a833981016040819052620000359162000306565b60405163b6a4cd2160e01b81526001600160a01b03838116600483015287169063b6a4cd219060240160006040518083038186803b1580156200007757600080fd5b505afa1580156200008c573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0384811660048301528916925063b6a4cd21915060240160006040518083038186803b158015620000d257600080fd5b505afa158015620000e7573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b038a811660048301528916925063b6a4cd21915060240160006040518083038186803b1580156200012d57600080fd5b505afa15801562000142573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b03891660048201819052925063b6a4cd21915060240160006040518083038186803b1580156200018757600080fd5b505afa1580156200019c573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0388811660048301528916925063b6a4cd21915060240160006040518083038186803b158015620001e257600080fd5b505afa158015620001f7573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0387811660048301528916925063b6a4cd21915060240160006040518083038186803b1580156200023d57600080fd5b505afa15801562000252573d6000803e3d6000fd5b505060405163b6a4cd2160e01b81526001600160a01b0386811660048301528916925063b6a4cd21915060240160006040518083038186803b1580156200029857600080fd5b505afa158015620002ad573d6000803e3d6000fd5b5050506001600160a01b039788166080525094861660a05292851660c05290841660e05283166101005282166101205216610140523061016052620003b1565b6001600160a01b03811681146200030357600080fd5b50565b600080600080600080600060e0888a0312156200032257600080fd5b87516200032f81620002ed565b60208901519097506200034281620002ed565b60408901519096506200035581620002ed565b60608901519095506200036881620002ed565b60808901519094506200037b81620002ed565b60a08901519093506200038e81620002ed565b60c0890151909250620003a181620002ed565b8091505092959891949750929550565b60805160a05160c05160e05161010051610120516101405161016051612967620004a3600039600081816108610152818161096901528181610ce101528181610e8f0152610f950152600061032f0152600081816102600152610b50015260008181610416015281816104cb015281816107cc01528181610c9601526110b70152600081816101fb015261092b01526000818161019701528181610f5e015261105f015260008181610308015281816105550152818161066d0152818161072001528181610b2101528181610bf00152610dfd01526000818161043d01528181610a350152610dab01526129676000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063622d56f1116100e3578063b51f9c2b1161008c578063c993f27c11610066578063c993f27c1461045f578063cbeda5a714610472578063f3edcbe11461048557600080fd5b8063b51f9c2b146103ba578063ba7903db14610411578063becbdf4a1461043857600080fd5b806378ecabce116100bd57806378ecabce146103715780638970ac4414610394578063b23cc044146103a757600080fd5b8063622d56f1146103035780636624856a1461032a5780636ab5f6611461035157600080fd5b8063318b1b801161014557806354fd4d501161011f57806354fd4d501461029557806358084273146102ce578063604aa628146102e357600080fd5b8063318b1b801461024857806335e80ab31461025b57806341fe53851461028257600080fd5b80631481a724116101765780631481a724146101f65780631d8a4e921461021d57806330e9012c1461023357600080fd5b806303dbe68c146101925780630e9d5cb9146101d6575b600080fd5b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101e96101e4366004611393565b610498565b6040516101cd9190611436565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b610225610551565b6040519081526020016101cd565b61023b6105da565b6040516101cd9190611449565b6101b96102563660046115b1565b6106ee565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6101e96102903660046115ca565b610799565b60408051808201909152600581527f362e312e3000000000000000000000000000000000000000000000000000000060208201526101e9565b6102e16102dc366004611602565b61084f565b005b6102f66102f1366004611715565b610955565b6040516101cd91906118aa565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b61036461035f366004611906565b610a70565b6040516101cd9190611942565b61038461037f3660046115b1565b610bbe565b60405190151581526020016101cd565b6101e96103a2366004611b02565b610c63565b6102e16103b5366004611be6565b610ccf565b6103c2610dd0565b6040516101cd919081516001600160a01b039081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6101b97f000000000000000000000000000000000000000000000000000000000000000081565b6102e161046d366004611c2f565b610e7d565b6102e1610480366004611be6565b610f83565b6101e9610493366004611c4c565b611084565b6040517f0e9d5cb90000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630e9d5cb99061050490879087908790600401611c79565b600060405180830381865afa158015610521573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105499190810190611cdb565b949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d8a4e926040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d59190611d52565b905090565b6040805161024081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166330e9012c6040518163ffffffff1660e01b815260040161024060405180830381865afa1580156106ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d59190611d76565b6040517f318b1b80000000000000000000000000000000000000000000000000000000008152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063318b1b8090602401602060405180830381865afa15801561076f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107939190611ece565b92915050565b6040517f41fe53850000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906341fe5385906108039086908690600401611eeb565b600060405180830381865afa158015610820573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108489190810190611cdb565b9392505050565b6108576110ee565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036108b9576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816040516024016108cc9190611ffd565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f580842730000000000000000000000000000000000000000000000000000000017905290506109507f000000000000000000000000000000000000000000000000000000000000000082611133565b505050565b606061095f6110ee565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036109c1576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040516024016109d491906120f0565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f604aa6280000000000000000000000000000000000000000000000000000000017905290506000610a5a7f000000000000000000000000000000000000000000000000000000000000000083611133565b9050808060200190518101906105499190612225565b604080516101e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c0810191909152610af16110ee565b6040517fcefe12230000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cefe122390610b7a9085907f000000000000000000000000000000000000000000000000000000000000000090339060040161240e565b6101e0604051808303816000875af1158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079391906125e2565b6040517f78ecabce000000000000000000000000000000000000000000000000000000008152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906378ecabce90602401602060405180830381865afa158015610c3f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079391906126f9565b6040517f8970ac440000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638970ac449061050490879087908790600401612716565b610cd76110ee565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610d39576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081604051602401610d4c9190612787565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb23cc0440000000000000000000000000000000000000000000000000000000017905290506109507f000000000000000000000000000000000000000000000000000000000000000082611133565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b51f9c2b6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610e59573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d591906127f2565b610e856110ee565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ee7576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038216602482015260009060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc993f27c0000000000000000000000000000000000000000000000000000000017905290506109507f000000000000000000000000000000000000000000000000000000000000000082611133565b610f8b6110ee565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610fed576040517f0a57d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081604051602401611000919061288a565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbeda5a70000000000000000000000000000000000000000000000000000000017905290506109507f000000000000000000000000000000000000000000000000000000000000000082611133565b6040517ff3edcbe10000000000000000000000000000000000000000000000000000000081526060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f3edcbe19061080390869086906004016128e9565b6110fa62010000610bbe565b15611131576040517fe232d67700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6060600080846001600160a01b031684604051611150919061293e565b600060405180830381855af49150503d806000811461118b576040519150601f19603f3d011682016040523d82523d6000602084013e611190565b606091505b50915091508161054957805160208201fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156111f4576111f46111a2565b60405290565b604051610180810167ffffffffffffffff811182821017156111f4576111f46111a2565b604051610240810167ffffffffffffffff811182821017156111f4576111f46111a2565b6040516101e0810167ffffffffffffffff811182821017156111f4576111f46111a2565b604051601f8201601f1916810167ffffffffffffffff8111828210171561128f5761128f6111a2565b604052919050565b6001600160a01b03811681146112ac57600080fd5b50565b80356112ba81611297565b919050565b6000608082840312156112d157600080fd5b6040516080810181811067ffffffffffffffff821117156112f4576112f46111a2565b604052905080823561130581611297565b808252506020830135602082015260408301356040820152606083013561132b81611297565b6060919091015292915050565b80151581146112ac57600080fd5b80356112ba81611338565b60006040828403121561136357600080fd5b61136b6111d1565b9050813561137881611297565b8152602082013561138881611297565b602082015292915050565b600080600060e084860312156113a857600080fd5b6113b285856112bf565b925060808401356113c281611338565b91506113d18560a08601611351565b90509250925092565b60005b838110156113f55781810151838201526020016113dd565b83811115611404576000848401525b50505050565b600081518084526114228160208601602086016113da565b601f01601f19169290920160200192915050565b602081526000610848602083018461140a565b81516001600160a01b031681526102408101602083015161147560208401826001600160a01b03169052565b50604083015161149060408401826001600160a01b03169052565b5060608301516114ab60608401826001600160a01b03169052565b5060808301516114c660808401826001600160a01b03169052565b5060a08301516114e160a08401826001600160a01b03169052565b5060c08301516114fc60c08401826001600160a01b03169052565b5060e083015161151760e08401826001600160a01b03169052565b50610100838101516001600160a01b0390811691840191909152610120808501518216908401526101408085015182169084015261016080850151821690840152610180808501518216908401526101a0808501518216908401526101c0808501518216908401526101e080850151821690840152610200808501518216908401526102208085015191821681850152905b505092915050565b6000602082840312156115c357600080fd5b5035919050565b60008060a083850312156115dd57600080fd5b6115e784846112bf565b915060808301356115f781611338565b809150509250929050565b60006020828403121561161457600080fd5b813567ffffffffffffffff81111561162b57600080fd5b8201610160818503121561084857600080fd5b600067ffffffffffffffff821115611658576116586111a2565b5060051b60200190565b600067ffffffffffffffff82111561167c5761167c6111a2565b50601f01601f191660200190565b600082601f83011261169b57600080fd5b81356116ae6116a982611662565b611266565b8181528460208386010111156116c357600080fd5b816020850160208301376000918101602001919091529392505050565b803563ffffffff811681146112ba57600080fd5b67ffffffffffffffff811681146112ac57600080fd5b80356112ba816116f4565b6000602080838503121561172857600080fd5b823567ffffffffffffffff8082111561174057600080fd5b818501915085601f83011261175457600080fd5b81356117626116a98261163e565b81815260059190911b8301840190848101908883111561178157600080fd5b8585015b8381101561189d5780358581111561179d5760008081fd5b8601610180818c03601f19018113156117b65760008081fd5b6117be6111fa565b89830135888111156117d05760008081fd5b6117de8e8c8387010161168a565b82525060406117ee8185016112af565b8b83015260606117ff8186016112af565b82840152608091506118128286016116e0565b818401525060a0808501358284015260c0915081850135818401525060e08085013582840152610100915061184882860161170a565b9083015261012061185a85820161170a565b82840152610140915081850135818401525061016061187a8186016112af565b82840152611889848601611346565b908301525085525050918601918601611785565b5098975050505050505050565b602080825282518282018190526000919060409081850190868401855b828110156118f957815180516001600160a01b03908116865290870151168685015292840192908501906001016118c7565b5091979650505050505050565b60006020828403121561191857600080fd5b813567ffffffffffffffff81111561192f57600080fd5b8201610260818503121561084857600080fd5b81516001600160a01b031681526101e08101602083015161196e60208401826001600160a01b03169052565b50604083015161198960408401826001600160a01b03169052565b5060608301516119a460608401826001600160a01b03169052565b5060808301516119bf60808401826001600160a01b03169052565b5060a08301516119da60a08401826001600160a01b03169052565b5060c08301516119f560c08401826001600160a01b03169052565b5060e0830151611a1060e08401826001600160a01b03169052565b50610100838101516001600160a01b0390811691840191909152610120808501518216908401526101408085015182169084015261016080850151821690840152610180808501518216908401526101a0808501518216908401526101c08085015191821681850152906115a9565b600060a08284031215611a9157600080fd5b60405160a0810181811067ffffffffffffffff82111715611ab457611ab46111a2565b6040529050808235611ac581611297565b808252506020830135602082015260408301356040820152606083013560608201526080830135611af581611297565b6080919091015292915050565b60008060006101008486031215611b1857600080fd5b611b228585611a7f565b925060a0840135611b3281611338565b91506113d18560c08601611351565b6000611b4f6116a98461163e565b83815290506020808201906060808602850187811115611b6e57600080fd5b855b81811015611bda5782818a031215611b885760008081fd5b6040805184810181811067ffffffffffffffff82111715611bab57611bab6111a2565b82528235611bb881611297565b8152828601358682015281830135918101919091528552938301938201611b70565b50505050509392505050565b600060208284031215611bf857600080fd5b813567ffffffffffffffff811115611c0f57600080fd5b8201601f81018413611c2057600080fd5b61054984823560208401611b41565b600060208284031215611c4157600080fd5b813561084881611297565b60008060c08385031215611c5f57600080fd5b611c698484611a7f565b915060a08301356115f781611338565b60e08101611cb1828680516001600160a01b039081168352602080830151908401526040808301519084015260609182015116910152565b831515608083015282516001600160a01b0390811660a084015260208401511660c0830152610549565b600060208284031215611ced57600080fd5b815167ffffffffffffffff811115611d0457600080fd5b8201601f81018413611d1557600080fd5b8051611d236116a982611662565b818152856020838501011115611d3857600080fd5b611d498260208301602086016113da565b95945050505050565b600060208284031215611d6457600080fd5b5051919050565b80516112ba81611297565b60006102408284031215611d8957600080fd5b611d9161121e565b611d9a83611d6b565b8152611da860208401611d6b565b6020820152611db960408401611d6b565b6040820152611dca60608401611d6b565b6060820152611ddb60808401611d6b565b6080820152611dec60a08401611d6b565b60a0820152611dfd60c08401611d6b565b60c0820152611e0e60e08401611d6b565b60e0820152610100611e21818501611d6b565b90820152610120611e33848201611d6b565b90820152610140611e45848201611d6b565b90820152610160611e57848201611d6b565b90820152610180611e69848201611d6b565b908201526101a0611e7b848201611d6b565b908201526101c0611e8d848201611d6b565b908201526101e0611e9f848201611d6b565b90820152610200611eb1848201611d6b565b90820152610220611ec3848201611d6b565b908201529392505050565b600060208284031215611ee057600080fd5b815161084881611297565b60a08101611f23828580516001600160a01b039081168352602080830151908401526040808301519084015260609182015116910152565b82151560808301529392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611f6757600080fd5b830160208101925035905067ffffffffffffffff811115611f8757600080fd5b606081023603821315611f9957600080fd5b9250929050565b8183526000602080850194508260005b85811015611ff2578135611fc381611297565b6001600160a01b0316875281830135838801526040808301359088015260609687019690910190600101611fb0565b509495945050505050565b602081526000823561200e81611338565b8015156020840152506020830135604083015260408301356060830152606083013561203981611297565b6001600160a01b0380821660808501526080850135915061205982611297565b80821660a0850152505060a083013560c083015260c083013560e083015261010060e084013581840152808401359050612092816116f4565b61012067ffffffffffffffff8216818501526120af81860161170a565b9150506101406120ca8185018367ffffffffffffffff169052565b6120d681860186611f32565b6101608681015292509050611d4961018085018383611fa0565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015612217577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08984030185528151610180815181865261215c8287018261140a565b915050888201516121778a8701826001600160a01b03169052565b50878201516001600160a01b03908116868a015260608084015163ffffffff16908701526080808401519087015260a0808401519087015260c0808401519087015260e08084015167ffffffffffffffff9081169188019190915261010080850151909116908701526101208084015190870152610140808401519091169086015261016091820151151591909401529386019390860190600101612117565b509098975050505050505050565b6000602080838503121561223857600080fd5b825167ffffffffffffffff81111561224f57600080fd5b8301601f8101851361226057600080fd5b805161226e6116a98261163e565b81815260069190911b8201830190838101908783111561228d57600080fd5b928401925b828410156122e357604084890312156122ab5760008081fd5b6122b36111d1565b84516122be81611297565b8152848601516122cd81611297565b8187015282526040939093019290840190612292565b979650505050505050565b80356122f981611297565b6001600160a01b03908116835260208201359061231582611297565b908116602084015260408201359061232c82611297565b908116604084015260608201359061234382611297565b908116606084015260808201359061235a82611297565b908116608084015260a08201359061237182611297565b80821660a085015250505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126123b457600080fd5b830160208101925035905067ffffffffffffffff8111156123d457600080fd5b803603821315611f9957600080fd5b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6060815261241f60608201856122ee565b600061242d60c086016116e0565b6101206124418185018363ffffffff169052565b61244d60e088016116e0565b91506101406124638186018463ffffffff169052565b61016092506101008801358386015261247e8289018961237f565b9250610260610180818189015261249a6102c0890186856123e3565b94506124a8848c018c61237f565b945092506101a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa089870301818a01526124e38686866123e3565b95506124f0878d0161170a565b96506101c0945061250c858a018867ffffffffffffffff169052565b612517828d016116e0565b96506101e0935061252f848a018863ffffffff169052565b6102009650808c0135878a01525050610220838b0135818901526102409350828b013584890152612561868c0161170a565b67ffffffffffffffff811689840152955061257d818c0161170a565b955050505061259961028086018467ffffffffffffffff169052565b6125a4818901611346565b9250506125b66102a085018315159052565b6001600160a01b038616602085015291506125ce9050565b6001600160a01b0383166040830152610549565b60006101e082840312156125f557600080fd5b6125fd611242565b61260683611d6b565b815261261460208401611d6b565b602082015261262560408401611d6b565b604082015261263660608401611d6b565b606082015261264760808401611d6b565b608082015261265860a08401611d6b565b60a082015261266960c08401611d6b565b60c082015261267a60e08401611d6b565b60e082015261010061268d818501611d6b565b9082015261012061269f848201611d6b565b908201526101406126b1848201611d6b565b908201526101606126c3848201611d6b565b908201526101806126d5848201611d6b565b908201526101a06126e7848201611d6b565b908201526101c0611ec3848201611d6b565b60006020828403121561270b57600080fd5b815161084881611338565b610100810161275d82866001600160a01b03808251168352602082015160208401526040820151604084015260608201516060840152806080830151166080840152505050565b83151560a083015282516001600160a01b0390811660c084015260208401511660e0830152610549565b6020808252825182820181905260009190848201906040850190845b818110156127e6576127d383855180516001600160a01b0316825260208082015190830152604090810151910152565b92840192606092909201916001016127a3565b50909695505050505050565b600060a0828403121561280457600080fd5b60405160a0810181811067ffffffffffffffff82111715612827576128276111a2565b604052825161283581611297565b8152602083015161284581611297565b6020820152604083015161285881611297565b6040820152606083015161286b81611297565b6060820152608083015161287e81611297565b60808201529392505050565b6020808252825182820181905260009190848201906040850190845b818110156127e6576128d683855180516001600160a01b0316825260208082015190830152604090810151910152565b92840192606092909201916001016128a6565b60c0810161292f82856001600160a01b03808251168352602082015160208401526040820151604084015260608201516060840152806080830151166080840152505050565b82151560a08301529392505050565b600082516129508184602087016113da565b919091019291505056fea164736f6c634300080f000a", } // OPContractsManagerABI is the input ABI used to generate the binding from. @@ -369,7 +366,7 @@ func (_OPContractsManager *OPContractsManagerTransactorRaw) Transact(opts *bind. // Blueprints is a free data retrieval call binding the contract method 0xb51f9c2b. // -// Solidity: function blueprints() view returns((address,address,address,address,address,address,address,address,address)) +// Solidity: function blueprints() view returns((address,address,address,address,address)) func (_OPContractsManager *OPContractsManagerCaller) Blueprints(opts *bind.CallOpts) (OPContractsManagerBlueprints, error) { var out []interface{} err := _OPContractsManager.contract.Call(opts, &out, "blueprints") @@ -386,14 +383,14 @@ func (_OPContractsManager *OPContractsManagerCaller) Blueprints(opts *bind.CallO // Blueprints is a free data retrieval call binding the contract method 0xb51f9c2b. // -// Solidity: function blueprints() view returns((address,address,address,address,address,address,address,address,address)) +// Solidity: function blueprints() view returns((address,address,address,address,address)) func (_OPContractsManager *OPContractsManagerSession) Blueprints() (OPContractsManagerBlueprints, error) { return _OPContractsManager.Contract.Blueprints(&_OPContractsManager.CallOpts) } // Blueprints is a free data retrieval call binding the contract method 0xb51f9c2b. // -// Solidity: function blueprints() view returns((address,address,address,address,address,address,address,address,address)) +// Solidity: function blueprints() view returns((address,address,address,address,address)) func (_OPContractsManager *OPContractsManagerCallerSession) Blueprints() (OPContractsManagerBlueprints, error) { return _OPContractsManager.Contract.Blueprints(&_OPContractsManager.CallOpts) } @@ -915,23 +912,23 @@ func (_OPContractsManager *OPContractsManagerTransactorSession) AddGameType(_gam return _OPContractsManager.Contract.AddGameType(&_OPContractsManager.TransactOpts, _gameConfigs) } -// Deploy is a paid mutator transaction binding the contract method 0x613e827b. +// Deploy is a paid mutator transaction binding the contract method 0x6ab5f661. // -// Solidity: function deploy(((address,address,address,address,address,address),uint32,uint32,uint256,bytes,string,uint64,uint32,bytes32,uint256,uint256,uint64,uint64) _input) returns((address,address,address,address,address,address,address,address,address,address,address,address,address,address,address)) +// Solidity: function deploy(((address,address,address,address,address,address),uint32,uint32,uint256,bytes,string,uint64,uint32,bytes32,uint256,uint256,uint64,uint64,bool) _input) returns((address,address,address,address,address,address,address,address,address,address,address,address,address,address,address)) func (_OPContractsManager *OPContractsManagerTransactor) Deploy(opts *bind.TransactOpts, _input OPContractsManagerDeployInput) (*types.Transaction, error) { return _OPContractsManager.contract.Transact(opts, "deploy", _input) } -// Deploy is a paid mutator transaction binding the contract method 0x613e827b. +// Deploy is a paid mutator transaction binding the contract method 0x6ab5f661. // -// Solidity: function deploy(((address,address,address,address,address,address),uint32,uint32,uint256,bytes,string,uint64,uint32,bytes32,uint256,uint256,uint64,uint64) _input) returns((address,address,address,address,address,address,address,address,address,address,address,address,address,address,address)) +// Solidity: function deploy(((address,address,address,address,address,address),uint32,uint32,uint256,bytes,string,uint64,uint32,bytes32,uint256,uint256,uint64,uint64,bool) _input) returns((address,address,address,address,address,address,address,address,address,address,address,address,address,address,address)) func (_OPContractsManager *OPContractsManagerSession) Deploy(_input OPContractsManagerDeployInput) (*types.Transaction, error) { return _OPContractsManager.Contract.Deploy(&_OPContractsManager.TransactOpts, _input) } -// Deploy is a paid mutator transaction binding the contract method 0x613e827b. +// Deploy is a paid mutator transaction binding the contract method 0x6ab5f661. // -// Solidity: function deploy(((address,address,address,address,address,address),uint32,uint32,uint256,bytes,string,uint64,uint32,bytes32,uint256,uint256,uint64,uint64) _input) returns((address,address,address,address,address,address,address,address,address,address,address,address,address,address,address)) +// Solidity: function deploy(((address,address,address,address,address,address),uint32,uint32,uint256,bytes,string,uint64,uint32,bytes32,uint256,uint256,uint64,uint64,bool) _input) returns((address,address,address,address,address,address,address,address,address,address,address,address,address,address,address)) func (_OPContractsManager *OPContractsManagerTransactorSession) Deploy(_input OPContractsManagerDeployInput) (*types.Transaction, error) { return _OPContractsManager.Contract.Deploy(&_OPContractsManager.TransactOpts, _input) } diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index bd424fb9e90..4ec852f419a 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -22,9 +22,7 @@ additional_compiler_profiles = [ ] compilation_restrictions = [ { paths = "src/dispute/FaultDisputeGame.sol", optimizer_runs = 5000 }, - { paths = "src/dispute/v2/FaultDisputeGameV2.sol", optimizer_runs = 5000 }, { paths = "src/dispute/PermissionedDisputeGame.sol", optimizer_runs = 5000 }, - { paths = "src/dispute/v2/PermissionedDisputeGameV2.sol", optimizer_runs = 5000 }, { paths = "src/dispute/SuperFaultDisputeGame.sol", optimizer_runs = 5000 }, { paths = "src/dispute/SuperPermissionedDisputeGame.sol", optimizer_runs = 5000 }, { paths = "src/L1/OPContractsManager.sol", optimizer_runs = 5000 }, @@ -156,9 +154,7 @@ additional_compiler_profiles = [ ] compilation_restrictions = [ { paths = "src/dispute/FaultDisputeGame.sol", optimizer_runs = 0 }, - { paths = "src/dispute/v2/FaultDisputeGameV2.sol", optimizer_runs = 0 }, { paths = "src/dispute/PermissionedDisputeGame.sol", optimizer_runs = 0 }, - { paths = "src/dispute/v2/PermissionedDisputeGameV2.sol", optimizer_runs = 0 }, { paths = "src/dispute/SuperFaultDisputeGame.sol", optimizer_runs = 0 }, { paths = "src/dispute/SuperPermissionedDisputeGame.sol", optimizer_runs = 0 }, { paths = "src/L1/OPContractsManager.sol", optimizer_runs = 0 }, diff --git a/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol b/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol index c3a799ecb0e..ecdbaa92ea0 100644 --- a/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol +++ b/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol @@ -210,8 +210,8 @@ interface IOPContractsManager { address anchorStateRegistryImpl; address delayedWETHImpl; address mipsImpl; - address faultDisputeGameV2Impl; - address permissionedDisputeGameV2Impl; + address faultDisputeGameImpl; + address permissionedDisputeGameImpl; address superFaultDisputeGameImpl; address superPermissionedDisputeGameImpl; } diff --git a/packages/contracts-bedrock/interfaces/L1/opcm/IOPContractsManagerContainer.sol b/packages/contracts-bedrock/interfaces/L1/opcm/IOPContractsManagerContainer.sol index e75f3ba8c2b..03ba33e9fce 100644 --- a/packages/contracts-bedrock/interfaces/L1/opcm/IOPContractsManagerContainer.sol +++ b/packages/contracts-bedrock/interfaces/L1/opcm/IOPContractsManagerContainer.sol @@ -25,8 +25,8 @@ interface IOPContractsManagerContainer { address anchorStateRegistryImpl; address delayedWETHImpl; address mipsImpl; - address faultDisputeGameV2Impl; - address permissionedDisputeGameV2Impl; + address faultDisputeGameImpl; + address permissionedDisputeGameImpl; address superFaultDisputeGameImpl; address superPermissionedDisputeGameImpl; address storageSetterImpl; diff --git a/packages/contracts-bedrock/interfaces/dispute/IFaultDisputeGame.sol b/packages/contracts-bedrock/interfaces/dispute/IFaultDisputeGame.sol index cba277a4a26..3ce628c543d 100644 --- a/packages/contracts-bedrock/interfaces/dispute/IFaultDisputeGame.sol +++ b/packages/contracts-bedrock/interfaces/dispute/IFaultDisputeGame.sol @@ -6,7 +6,7 @@ import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; import { IBigStepper } from "interfaces/dispute/IBigStepper.sol"; import { Types } from "src/libraries/Types.sol"; -import { GameType, Claim, Position, Clock, Hash, Duration, BondDistributionMode } from "src/dispute/lib/Types.sol"; +import { Claim, Position, Clock, Hash, Duration, BondDistributionMode } from "src/dispute/lib/Types.sol"; interface IFaultDisputeGame is IDisputeGame { struct ClaimData { @@ -27,16 +27,10 @@ interface IFaultDisputeGame is IDisputeGame { } struct GameConstructorParams { - GameType gameType; - Claim absolutePrestate; uint256 maxGameDepth; uint256 splitDepth; Duration clockExtension; Duration maxClockDuration; - IBigStepper vm; - IDelayedWETH weth; - IAnchorStateRegistry anchorStateRegistry; - uint256 l2ChainId; } error AlreadyInitialized(); @@ -79,7 +73,6 @@ interface IFaultDisputeGame is IDisputeGame { error InvalidBondDistributionMode(); error GameNotFinalized(); error GameNotResolved(); - error ReservedGameType(); error GamePaused(); event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant); event GameClosed(BondDistributionMode bondDistributionMode); diff --git a/packages/contracts-bedrock/interfaces/dispute/IPermissionedDisputeGame.sol b/packages/contracts-bedrock/interfaces/dispute/IPermissionedDisputeGame.sol index 92dc3ddeeec..c2f6013235a 100644 --- a/packages/contracts-bedrock/interfaces/dispute/IPermissionedDisputeGame.sol +++ b/packages/contracts-bedrock/interfaces/dispute/IPermissionedDisputeGame.sol @@ -68,7 +68,6 @@ interface IPermissionedDisputeGame is IDisputeGame { error InvalidBondDistributionMode(); error GameNotFinalized(); error GameNotResolved(); - error ReservedGameType(); error GamePaused(); event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant); event GameClosed(BondDistributionMode bondDistributionMode); @@ -132,13 +131,11 @@ interface IPermissionedDisputeGame is IDisputeGame { error BadAuth(); - function proposer() external view returns (address proposer_); - function challenger() external view returns (address challenger_); + function proposer() external pure returns (address proposer_); + function challenger() external pure returns (address challenger_); function __constructor__( - IFaultDisputeGame.GameConstructorParams memory _params, - address _proposer, - address _challenger + IFaultDisputeGame.GameConstructorParams memory _params ) external; } diff --git a/packages/contracts-bedrock/interfaces/dispute/v2/IFaultDisputeGameV2.sol b/packages/contracts-bedrock/interfaces/dispute/v2/IFaultDisputeGameV2.sol deleted file mode 100644 index 35d896a1cb2..00000000000 --- a/packages/contracts-bedrock/interfaces/dispute/v2/IFaultDisputeGameV2.sol +++ /dev/null @@ -1,137 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; -import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; -import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; -import { IBigStepper } from "interfaces/dispute/IBigStepper.sol"; -import { Types } from "src/libraries/Types.sol"; -import { Claim, Position, Clock, Hash, Duration, BondDistributionMode } from "src/dispute/lib/Types.sol"; - -interface IFaultDisputeGameV2 is IDisputeGame { - struct ClaimData { - uint32 parentIndex; - address counteredBy; - address claimant; - uint128 bond; - Claim claim; - Position position; - Clock clock; - } - - struct ResolutionCheckpoint { - bool initialCheckpointComplete; - uint32 subgameIndex; - Position leftmostPosition; - address counteredBy; - } - - struct GameConstructorParams { - uint256 maxGameDepth; - uint256 splitDepth; - Duration clockExtension; - Duration maxClockDuration; - } - - error AlreadyInitialized(); - error AnchorRootNotFound(); - error BadExtraData(); - error BlockNumberMatches(); - error BondTransferFailed(); - error CannotDefendRootClaim(); - error ClaimAboveSplit(); - error ClaimAlreadyExists(); - error ClaimAlreadyResolved(); - error ClockNotExpired(); - error ClockTimeExceeded(); - error ContentLengthMismatch(); - error DuplicateStep(); - error EmptyItem(); - error GameDepthExceeded(); - error GameNotInProgress(); - error IncorrectBondAmount(); - error InvalidChallengePeriod(); - error InvalidClockExtension(); - error InvalidDataRemainder(); - error InvalidDisputedClaimIndex(); - error InvalidHeader(); - error InvalidHeaderRLP(); - error InvalidLocalIdent(); - error InvalidOutputRootProof(); - error InvalidParent(); - error InvalidPrestate(); - error InvalidSplitDepth(); - error L2BlockNumberChallenged(); - error MaxDepthTooLarge(); - error NoCreditToClaim(); - error OutOfOrderResolution(); - error UnexpectedList(); - error UnexpectedRootClaim(Claim rootClaim); - error UnexpectedString(); - error UnknownChainId(); - error ValidStep(); - error InvalidBondDistributionMode(); - error GameNotFinalized(); - error GameNotResolved(); - error GamePaused(); - event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant); - event GameClosed(BondDistributionMode bondDistributionMode); - - function absolutePrestate() external view returns (Claim absolutePrestate_); - function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) external; - function anchorStateRegistry() external view returns (IAnchorStateRegistry registry_); - function attack(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable; - function bondDistributionMode() external view returns (BondDistributionMode); - function challengeRootL2Block(Types.OutputRootProof memory _outputRootProof, bytes memory _headerRLP) external; - function claimCredit(address _recipient) external; - function claimData(uint256) - external - view // nosemgrep - returns ( - uint32 parentIndex, - address counteredBy, - address claimant, - uint128 bond, - Claim claim, - Position position, - Clock clock - ); - function claimDataLen() external view returns (uint256 len_); - function claims(Hash) external view returns (bool); - function clockExtension() external view returns (Duration clockExtension_); - function closeGame() external; - function credit(address _recipient) external view returns (uint256 credit_); - function defend(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable; - function getChallengerDuration(uint256 _claimIndex) external view returns (Duration duration_); - function getNumToResolve(uint256 _claimIndex) external view returns (uint256 numRemainingChildren_); - function getRequiredBond(Position _position) external view returns (uint256 requiredBond_); - function hasUnlockedCredit(address) external view returns (bool); - function l2BlockNumber() external pure returns (uint256 l2BlockNumber_); - function l2BlockNumberChallenged() external view returns (bool); - function l2BlockNumberChallenger() external view returns (address); - function l2ChainId() external view returns (uint256 l2ChainId_); - function maxClockDuration() external view returns (Duration maxClockDuration_); - function maxGameDepth() external view returns (uint256 maxGameDepth_); - function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable; - function normalModeCredit(address) external view returns (uint256); - function refundModeCredit(address) external view returns (uint256); - function rootClaimByChainId(uint256 _chainId) external pure returns (Claim rootClaim_); - function resolutionCheckpoints(uint256) - external - view - returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); // nosemgrep - function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external; - function resolvedSubgames(uint256) external view returns (bool); - function splitDepth() external view returns (uint256 splitDepth_); - function startingBlockNumber() external view returns (uint256 startingBlockNumber_); - function startingOutputRoot() external view returns (Hash root, uint256 l2SequenceNumber); // nosemgrep - function startingRootHash() external view returns (Hash startingRootHash_); - function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external; - function subgames(uint256, uint256) external view returns (uint256); - function version() external pure returns (string memory); - function vm() external view returns (IBigStepper vm_); - function wasRespectedGameTypeWhenCreated() external view returns (bool); - function weth() external view returns (IDelayedWETH weth_); - - function __constructor__(GameConstructorParams memory _params) external; -} diff --git a/packages/contracts-bedrock/interfaces/dispute/v2/IPermissionedDisputeGameV2.sol b/packages/contracts-bedrock/interfaces/dispute/v2/IPermissionedDisputeGameV2.sol deleted file mode 100644 index 52419eea9d3..00000000000 --- a/packages/contracts-bedrock/interfaces/dispute/v2/IPermissionedDisputeGameV2.sol +++ /dev/null @@ -1,141 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import { Types } from "src/libraries/Types.sol"; -import { Claim, Position, Clock, Hash, Duration, BondDistributionMode } from "src/dispute/lib/Types.sol"; - -import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; -import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; -import { IBigStepper } from "interfaces/dispute/IBigStepper.sol"; -import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; -import { IFaultDisputeGameV2 } from "interfaces/dispute/v2/IFaultDisputeGameV2.sol"; - -interface IPermissionedDisputeGameV2 is IDisputeGame { - struct ClaimData { - uint32 parentIndex; - address counteredBy; - address claimant; - uint128 bond; - Claim claim; - Position position; - Clock clock; - } - - struct ResolutionCheckpoint { - bool initialCheckpointComplete; - uint32 subgameIndex; - Position leftmostPosition; - address counteredBy; - } - - error AlreadyInitialized(); - error AnchorRootNotFound(); - error BadExtraData(); - error BlockNumberMatches(); - error BondTransferFailed(); - error CannotDefendRootClaim(); - error ClaimAboveSplit(); - error ClaimAlreadyExists(); - error ClaimAlreadyResolved(); - error ClockNotExpired(); - error ClockTimeExceeded(); - error ContentLengthMismatch(); - error DuplicateStep(); - error EmptyItem(); - error GameDepthExceeded(); - error GameNotInProgress(); - error IncorrectBondAmount(); - error InvalidChallengePeriod(); - error InvalidClockExtension(); - error InvalidDataRemainder(); - error InvalidDisputedClaimIndex(); - error InvalidHeader(); - error InvalidHeaderRLP(); - error InvalidLocalIdent(); - error InvalidOutputRootProof(); - error InvalidParent(); - error InvalidPrestate(); - error InvalidSplitDepth(); - error L2BlockNumberChallenged(); - error MaxDepthTooLarge(); - error NoCreditToClaim(); - error OutOfOrderResolution(); - error UnexpectedList(); - error UnexpectedRootClaim(Claim rootClaim); - error UnexpectedString(); - error UnknownChainId(); - error ValidStep(); - error InvalidBondDistributionMode(); - error GameNotFinalized(); - error GameNotResolved(); - error GamePaused(); - event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant); - event GameClosed(BondDistributionMode bondDistributionMode); - - function absolutePrestate() external view returns (Claim absolutePrestate_); - function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) external; - function anchorStateRegistry() external view returns (IAnchorStateRegistry registry_); - function attack(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable; - function bondDistributionMode() external view returns (BondDistributionMode); - function challengeRootL2Block(Types.OutputRootProof memory _outputRootProof, bytes memory _headerRLP) external; - function claimCredit(address _recipient) external; - function claimData(uint256) - external - view // nosemgrep - returns ( - uint32 parentIndex, - address counteredBy, - address claimant, - uint128 bond, - Claim claim, - Position position, - Clock clock - ); - function claimDataLen() external view returns (uint256 len_); - function claims(Hash) external view returns (bool); - function clockExtension() external view returns (Duration clockExtension_); - function closeGame() external; - function credit(address _recipient) external view returns (uint256 credit_); - function defend(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable; - function getChallengerDuration(uint256 _claimIndex) external view returns (Duration duration_); - function getNumToResolve(uint256 _claimIndex) external view returns (uint256 numRemainingChildren_); - function getRequiredBond(Position _position) external view returns (uint256 requiredBond_); - function hasUnlockedCredit(address) external view returns (bool); - function initialize() external payable; - function l2BlockNumber() external pure returns (uint256 l2BlockNumber_); - function l2BlockNumberChallenged() external view returns (bool); - function l2BlockNumberChallenger() external view returns (address); - function l2ChainId() external view returns (uint256 l2ChainId_); - function maxClockDuration() external view returns (Duration maxClockDuration_); - function maxGameDepth() external view returns (uint256 maxGameDepth_); - function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable; - function normalModeCredit(address) external view returns (uint256); - function refundModeCredit(address) external view returns (uint256); - function rootClaimByChainId(uint256 _chainId) external pure returns (Claim rootClaim_); - function resolutionCheckpoints(uint256) - external - view - returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); // nosemgrep - function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external; - function resolvedSubgames(uint256) external view returns (bool); - function splitDepth() external view returns (uint256 splitDepth_); - function startingBlockNumber() external view returns (uint256 startingBlockNumber_); - function startingOutputRoot() external view returns (Hash root, uint256 l2SequenceNumber); // nosemgrep - function startingRootHash() external view returns (Hash startingRootHash_); - function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external; - function subgames(uint256, uint256) external view returns (uint256); - function version() external pure returns (string memory); - function vm() external view returns (IBigStepper vm_); - function wasRespectedGameTypeWhenCreated() external view returns (bool); - function weth() external view returns (IDelayedWETH weth_); - - error BadAuth(); - - function proposer() external pure returns (address proposer_); - function challenger() external pure returns (address challenger_); - - function __constructor__( - IFaultDisputeGameV2.GameConstructorParams memory _params - ) - external; -} diff --git a/packages/contracts-bedrock/scripts/checks/test-validation/exclusions.toml b/packages/contracts-bedrock/scripts/checks/test-validation/exclusions.toml index eb7d2bd537f..dec5d1c1674 100644 --- a/packages/contracts-bedrock/scripts/checks/test-validation/exclusions.toml +++ b/packages/contracts-bedrock/scripts/checks/test-validation/exclusions.toml @@ -49,7 +49,6 @@ src_validation = [ # infrastructure beyond standard harnesses or different setup contracts patterns. contract_name_validation = [ "test/dispute/FaultDisputeGame.t.sol", # Contains contracts not matching FaultDisputeGame base name - "test/dispute/v2/FaultDisputeGameV2.t.sol", # Contains contracts not matching FaultDisputeGameV2 base name "test/dispute/SuperFaultDisputeGame.t.sol", # Contains contracts not matching SuperFaultDisputeGame base name "test/L1/ResourceMetering.t.sol", # Contains contracts not matching ResourceMetering base name "test/L1/OPContractsManagerStandardValidator.t.sol", # Contains contracts not matching OPContractsManagerStandardValidator base name diff --git a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol index 72f4b6db35f..da4df8094fa 100644 --- a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol @@ -309,7 +309,7 @@ contract Deploy is Deployer { } artifacts.save("DelayedWETHImpl", address(dio.delayedWETHImpl)); artifacts.save("PreimageOracle", address(dio.preimageOracleSingleton)); - artifacts.save("PermissionedDisputeGame", address(dio.permissionedDisputeGameV2Impl)); + artifacts.save("PermissionedDisputeGame", address(dio.permissionedDisputeGameImpl)); // Get a contract set from the implementation addresses which were just deployed. Types.ContractSet memory impls = ChainAssertions.dioToContractSet(dio); diff --git a/packages/contracts-bedrock/scripts/deploy/DeployDisputeGame.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployDisputeGame.s.sol index 5096d78f3a7..6e57c6c0344 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployDisputeGame.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployDisputeGame.s.sol @@ -8,14 +8,12 @@ import { Script } from "forge-std/Script.sol"; import { DeployUtils } from "scripts/libraries/DeployUtils.sol"; // Libraries -import { GameType, Claim, Duration } from "src/dispute/lib/Types.sol"; +import { GameType, Duration } from "src/dispute/lib/Types.sol"; import { LibString } from "@solady/utils/LibString.sol"; // Interfaces import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; -import { IFaultDisputeGameV2 } from "interfaces/dispute/v2/IFaultDisputeGameV2.sol"; -import { IPermissionedDisputeGameV2 } from "interfaces/dispute/v2/IPermissionedDisputeGameV2.sol"; import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IBigStepper } from "interfaces/dispute/IBigStepper.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; @@ -56,19 +54,13 @@ contract DeployDisputeGame is Script { assertValidOutput(_input, output_); } - function deployDisputeGameImplV1(Input memory _input, Output memory _output) internal { + function deployDisputeGameImplV2(Input memory _input, Output memory _output) internal { // Shove the arguments into a struct to avoid stack-too-deep errors. IFaultDisputeGame.GameConstructorParams memory args = IFaultDisputeGame.GameConstructorParams({ - gameType: _input.gameType, - absolutePrestate: Claim.wrap(_input.absolutePrestate), maxGameDepth: _input.maxGameDepth, splitDepth: _input.splitDepth, clockExtension: Duration.wrap(_input.clockExtension), - maxClockDuration: Duration.wrap(_input.maxClockDuration), - vm: _input.vmAddress, - weth: _input.delayedWethProxy, - anchorStateRegistry: _input.anchorStateRegistryProxy, - l2ChainId: _input.l2ChainId + maxClockDuration: Duration.wrap((_input.maxClockDuration)) }); // PermissionedDisputeGame is used as the type here because it is a superset of @@ -87,44 +79,7 @@ contract DeployDisputeGame is Script { impl = IPermissionedDisputeGame( DeployUtils.createDeterministic({ _name: "PermissionedDisputeGame", - _args: DeployUtils.encodeConstructor( - abi.encodeCall(IPermissionedDisputeGame.__constructor__, (args, _input.proposer, _input.challenger)) - ), - _salt: DeployUtils.DEFAULT_SALT - }) - ); - } - - vm.label(address(impl), string.concat(_input.gameKind, "Impl")); - _output.disputeGameImpl = impl; - } - - function deployDisputeGameImplV2(Input memory _input, Output memory _output) internal { - // Shove the arguments into a struct to avoid stack-too-deep errors. - IFaultDisputeGameV2.GameConstructorParams memory args = IFaultDisputeGameV2.GameConstructorParams({ - maxGameDepth: _input.maxGameDepth, - splitDepth: _input.splitDepth, - clockExtension: Duration.wrap(_input.clockExtension), - maxClockDuration: Duration.wrap((_input.maxClockDuration)) - }); - - // PermissionedDisputeGame is used as the type here because it is a superset of - // FaultDisputeGame. If the user requests to deploy a FaultDisputeGame, the user will get a - // FaultDisputeGame (and not a PermissionedDisputeGame). - IPermissionedDisputeGame impl; - if (LibString.eq(_input.gameKind, "FaultDisputeGame")) { - impl = IPermissionedDisputeGame( - DeployUtils.createDeterministic({ - _name: "FaultDisputeGameV2", - _args: DeployUtils.encodeConstructor(abi.encodeCall(IFaultDisputeGameV2.__constructor__, (args))), - _salt: DeployUtils.DEFAULT_SALT - }) - ); - } else { - impl = IPermissionedDisputeGame( - DeployUtils.createDeterministic({ - _name: "PermissionedDisputeGameV2", - _args: DeployUtils.encodeConstructor(abi.encodeCall(IPermissionedDisputeGameV2.__constructor__, (args))), + _args: DeployUtils.encodeConstructor(abi.encodeCall(IPermissionedDisputeGame.__constructor__, (args))), _salt: DeployUtils.DEFAULT_SALT }) ); diff --git a/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol index c65048e8600..4c30f0cb822 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol @@ -15,10 +15,10 @@ import { IPreimageOracle } from "interfaces/cannon/IPreimageOracle.sol"; import { IMIPS64 } from "interfaces/cannon/IMIPS64.sol"; import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; -import { IFaultDisputeGameV2 } from "interfaces/dispute/v2/IFaultDisputeGameV2.sol"; +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; import { ISuperFaultDisputeGame } from "interfaces/dispute/ISuperFaultDisputeGame.sol"; import { ISuperPermissionedDisputeGame } from "interfaces/dispute/ISuperPermissionedDisputeGame.sol"; -import { IPermissionedDisputeGameV2 } from "interfaces/dispute/v2/IPermissionedDisputeGameV2.sol"; +import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; import { Duration } from "src/dispute/lib/Types.sol"; import { IOPContractsManager, @@ -98,8 +98,8 @@ contract DeployImplementations is Script { IAnchorStateRegistry anchorStateRegistryImpl; ISuperchainConfig superchainConfigImpl; IProtocolVersions protocolVersionsImpl; - IFaultDisputeGameV2 faultDisputeGameV2Impl; - IPermissionedDisputeGameV2 permissionedDisputeGameV2Impl; + IFaultDisputeGame faultDisputeGameImpl; + IPermissionedDisputeGame permissionedDisputeGameImpl; ISuperFaultDisputeGame superFaultDisputeGameImpl; ISuperPermissionedDisputeGame superPermissionedDisputeGameImpl; IStorageSetter storageSetterImpl; @@ -134,8 +134,8 @@ contract DeployImplementations is Script { deployMipsSingleton(_input, output_); deployDisputeGameFactoryImpl(output_); deployAnchorStateRegistryImpl(_input, output_); - deployFaultDisputeGameV2Impl(_input, output_); - deployPermissionedDisputeGameV2Impl(_input, output_); + deployFaultDisputeGameImpl(_input, output_); + deployPermissionedDisputeGameImpl(_input, output_); if (DevFeatures.isDevFeatureEnabled(_input.devFeatureBitmap, DevFeatures.OPTIMISM_PORTAL_INTEROP)) { deploySuperFaultDisputeGameImpl(_input, output_); deploySuperPermissionedDisputeGameImpl(_input, output_); @@ -175,8 +175,8 @@ contract DeployImplementations is Script { anchorStateRegistryImpl: address(_output.anchorStateRegistryImpl), delayedWETHImpl: address(_output.delayedWETHImpl), mipsImpl: address(_output.mipsSingleton), - faultDisputeGameV2Impl: address(_output.faultDisputeGameV2Impl), - permissionedDisputeGameV2Impl: address(_output.permissionedDisputeGameV2Impl), + faultDisputeGameImpl: address(_output.faultDisputeGameImpl), + permissionedDisputeGameImpl: address(_output.permissionedDisputeGameImpl), superFaultDisputeGameImpl: address(_output.superFaultDisputeGameImpl), superPermissionedDisputeGameImpl: address(_output.superPermissionedDisputeGameImpl) }); @@ -231,8 +231,8 @@ contract DeployImplementations is Script { anchorStateRegistryImpl: address(_output.anchorStateRegistryImpl), delayedWETHImpl: address(_output.delayedWETHImpl), mipsImpl: address(_output.mipsSingleton), - faultDisputeGameV2Impl: address(_output.faultDisputeGameV2Impl), - permissionedDisputeGameV2Impl: address(_output.permissionedDisputeGameV2Impl), + faultDisputeGameImpl: address(_output.faultDisputeGameImpl), + permissionedDisputeGameImpl: address(_output.permissionedDisputeGameImpl), superFaultDisputeGameImpl: address(_output.superFaultDisputeGameImpl), superPermissionedDisputeGameImpl: address(_output.superPermissionedDisputeGameImpl), storageSetterImpl: address(_output.storageSetterImpl) @@ -568,40 +568,40 @@ contract DeployImplementations is Script { _output.anchorStateRegistryImpl = impl; } - function deployFaultDisputeGameV2Impl(Input memory _input, Output memory _output) private { - IFaultDisputeGameV2.GameConstructorParams memory params; + function deployFaultDisputeGameImpl(Input memory _input, Output memory _output) private { + IFaultDisputeGame.GameConstructorParams memory params; params.maxGameDepth = _input.faultGameV2MaxGameDepth; params.splitDepth = _input.faultGameV2SplitDepth; params.clockExtension = Duration.wrap(uint64(_input.faultGameV2ClockExtension)); params.maxClockDuration = Duration.wrap(uint64(_input.faultGameV2MaxClockDuration)); - IFaultDisputeGameV2 impl = IFaultDisputeGameV2( + IFaultDisputeGame impl = IFaultDisputeGame( DeployUtils.createDeterministic({ - _name: "FaultDisputeGameV2", - _args: DeployUtils.encodeConstructor(abi.encodeCall(IFaultDisputeGameV2.__constructor__, (params))), + _name: "FaultDisputeGame", + _args: DeployUtils.encodeConstructor(abi.encodeCall(IFaultDisputeGame.__constructor__, (params))), _salt: _salt }) ); - vm.label(address(impl), "FaultDisputeGameV2Impl"); - _output.faultDisputeGameV2Impl = impl; + vm.label(address(impl), "FaultDisputeGameImpl"); + _output.faultDisputeGameImpl = impl; } - function deployPermissionedDisputeGameV2Impl(Input memory _input, Output memory _output) private { - IFaultDisputeGameV2.GameConstructorParams memory params; + function deployPermissionedDisputeGameImpl(Input memory _input, Output memory _output) private { + IFaultDisputeGame.GameConstructorParams memory params; params.maxGameDepth = _input.faultGameV2MaxGameDepth; params.splitDepth = _input.faultGameV2SplitDepth; params.clockExtension = Duration.wrap(uint64(_input.faultGameV2ClockExtension)); params.maxClockDuration = Duration.wrap(uint64(_input.faultGameV2MaxClockDuration)); - IPermissionedDisputeGameV2 impl = IPermissionedDisputeGameV2( + IPermissionedDisputeGame impl = IPermissionedDisputeGame( DeployUtils.createDeterministic({ - _name: "PermissionedDisputeGameV2", - _args: DeployUtils.encodeConstructor(abi.encodeCall(IPermissionedDisputeGameV2.__constructor__, (params))), + _name: "PermissionedDisputeGame", + _args: DeployUtils.encodeConstructor(abi.encodeCall(IPermissionedDisputeGame.__constructor__, (params))), _salt: _salt }) ); - vm.label(address(impl), "PermissionedDisputeGameV2Impl"); - _output.permissionedDisputeGameV2Impl = impl; + vm.label(address(impl), "PermissionedDisputeGameImpl"); + _output.permissionedDisputeGameImpl = impl; } function deploySuperFaultDisputeGameImpl(Input memory _input, Output memory _output) private { @@ -767,8 +767,8 @@ contract DeployImplementations is Script { opcmImplementations.anchorStateRegistryImpl = _implementations.anchorStateRegistryImpl; opcmImplementations.delayedWETHImpl = _implementations.delayedWETHImpl; opcmImplementations.mipsImpl = _implementations.mipsImpl; - opcmImplementations.faultDisputeGameImpl = _implementations.faultDisputeGameV2Impl; - opcmImplementations.permissionedDisputeGameImpl = _implementations.permissionedDisputeGameV2Impl; + opcmImplementations.faultDisputeGameImpl = _implementations.faultDisputeGameImpl; + opcmImplementations.permissionedDisputeGameImpl = _implementations.permissionedDisputeGameImpl; IOPContractsManagerStandardValidator impl = IOPContractsManagerStandardValidator( DeployUtils.createDeterministic({ @@ -841,8 +841,8 @@ contract DeployImplementations is Script { opcmImplementations.anchorStateRegistryImpl = _implementations.anchorStateRegistryImpl; opcmImplementations.delayedWETHImpl = _implementations.delayedWETHImpl; opcmImplementations.mipsImpl = _implementations.mipsImpl; - opcmImplementations.faultDisputeGameImpl = _implementations.faultDisputeGameV2Impl; - opcmImplementations.permissionedDisputeGameImpl = _implementations.permissionedDisputeGameV2Impl; + opcmImplementations.faultDisputeGameImpl = _implementations.faultDisputeGameImpl; + opcmImplementations.permissionedDisputeGameImpl = _implementations.permissionedDisputeGameImpl; IOPContractsManagerStandardValidator impl = IOPContractsManagerStandardValidator( DeployUtils.createDeterministic({ @@ -971,8 +971,8 @@ contract DeployImplementations is Script { address(_output.disputeGameFactoryImpl), address(_output.anchorStateRegistryImpl), address(_output.ethLockboxImpl), - address(_output.faultDisputeGameV2Impl), - address(_output.permissionedDisputeGameV2Impl) + address(_output.faultDisputeGameImpl), + address(_output.permissionedDisputeGameImpl) ); if (DevFeatures.isDevFeatureEnabled(_input.devFeatureBitmap, DevFeatures.OPTIMISM_PORTAL_INTEROP)) { diff --git a/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol index 62f06706e4a..b2f549d3792 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol @@ -345,12 +345,12 @@ contract DeployOPChain is Script { if (isDevFeatureOpcmV2Enabled(_i.opcm)) { // OPCM v2: use implementations from v2 contract IOPContractsManagerV2 opcmV2 = IOPContractsManagerV2(_i.opcm); - expectedPDGImpl = opcmV2.implementations().permissionedDisputeGameV2Impl; + expectedPDGImpl = opcmV2.implementations().permissionedDisputeGameImpl; } else { // OPCM v1: use implementations from v1 contract IOPContractsManager opcm = IOPContractsManager(_i.opcm); // With v2 game contracts enabled, we use the predeployed pdg implementation - expectedPDGImpl = opcm.implementations().permissionedDisputeGameV2Impl; + expectedPDGImpl = opcm.implementations().permissionedDisputeGameImpl; } ChainAssertions.checkDisputeGameFactory( diff --git a/packages/contracts-bedrock/scripts/deploy/ReadImplementationAddresses.s.sol b/packages/contracts-bedrock/scripts/deploy/ReadImplementationAddresses.s.sol index 3fb08277fca..3b45a88268f 100644 --- a/packages/contracts-bedrock/scripts/deploy/ReadImplementationAddresses.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/ReadImplementationAddresses.s.sol @@ -38,8 +38,8 @@ contract ReadImplementationAddresses is Script { address disputeGameFactory; address mipsSingleton; address preimageOracleSingleton; - address faultDisputeGameV2; - address permissionedDisputeGameV2; + address faultDisputeGame; + address permissionedDisputeGame; address superFaultDisputeGame; address superPermissionedDisputeGame; address opcmDeployer; @@ -85,8 +85,8 @@ contract ReadImplementationAddresses is Script { output_.ethLockbox = impls.ethLockboxImpl; output_.anchorStateRegistry = impls.anchorStateRegistryImpl; output_.optimismPortalInterop = impls.optimismPortalInteropImpl; - output_.faultDisputeGameV2 = impls.faultDisputeGameV2Impl; - output_.permissionedDisputeGameV2 = impls.permissionedDisputeGameV2Impl; + output_.faultDisputeGame = impls.faultDisputeGameImpl; + output_.permissionedDisputeGame = impls.permissionedDisputeGameImpl; output_.superFaultDisputeGame = impls.superFaultDisputeGameImpl; output_.superPermissionedDisputeGame = impls.superPermissionedDisputeGameImpl; } else { @@ -104,8 +104,8 @@ contract ReadImplementationAddresses is Script { output_.ethLockbox = impls.ethLockboxImpl; output_.anchorStateRegistry = impls.anchorStateRegistryImpl; output_.optimismPortalInterop = impls.optimismPortalInteropImpl; - output_.faultDisputeGameV2 = impls.faultDisputeGameV2Impl; - output_.permissionedDisputeGameV2 = impls.permissionedDisputeGameV2Impl; + output_.faultDisputeGame = impls.faultDisputeGameImpl; + output_.permissionedDisputeGame = impls.permissionedDisputeGameImpl; output_.superFaultDisputeGame = impls.superFaultDisputeGameImpl; output_.superPermissionedDisputeGame = impls.superPermissionedDisputeGameImpl; } diff --git a/packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol b/packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol index 989ef73c9d3..62c7b46908c 100644 --- a/packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol @@ -118,8 +118,8 @@ contract VerifyOPCM is Script { fieldNameOverrides["optimismPortalInteropImpl"] = "OptimismPortalInterop"; fieldNameOverrides["mipsImpl"] = "MIPS64"; fieldNameOverrides["ethLockboxImpl"] = "ETHLockbox"; - fieldNameOverrides["faultDisputeGameV2Impl"] = "FaultDisputeGameV2"; - fieldNameOverrides["permissionedDisputeGameV2Impl"] = "PermissionedDisputeGameV2"; + fieldNameOverrides["faultDisputeGameImpl"] = "FaultDisputeGame"; + fieldNameOverrides["permissionedDisputeGameImpl"] = "PermissionedDisputeGame"; fieldNameOverrides["permissionlessDisputeGame1"] = "FaultDisputeGame"; fieldNameOverrides["permissionlessDisputeGame2"] = "FaultDisputeGame"; fieldNameOverrides["permissionedDisputeGame1"] = "PermissionedDisputeGame"; @@ -655,21 +655,6 @@ contract VerifyOPCM is Script { return DevFeatures.isDevFeatureEnabled(bitmap, DevFeatures.OPTIMISM_PORTAL_INTEROP); } - /// @notice Checks if a contract is a V1 dispute game implementation. - /// @param _contractName The name to check. - /// @return True if this is a V1 dispute game. - function _isV1DisputeGameImplementation(string memory _contractName) internal pure returns (bool) { - return LibString.eq(_contractName, "FaultDisputeGame") || LibString.eq(_contractName, "PermissionedDisputeGame"); - } - - /// @notice Checks if a contract is a V2 dispute game implementation. - /// @param _contractName The name to check. - /// @return True if this is a V2 dispute game. - function _isV2DisputeGameImplementation(string memory _contractName) internal pure returns (bool) { - return LibString.eq(_contractName, "FaultDisputeGameV2") - || LibString.eq(_contractName, "PermissionedDisputeGameV2"); - } - /// @notice Checks if a contract is a Super dispute game implementation. /// @param _contractName The name to check. /// @return True if this is a V2 dispute game. diff --git a/packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json b/packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json index 57107a1de6f..b8f49cbc518 100644 --- a/packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json +++ b/packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json @@ -3,16 +3,6 @@ "inputs": [ { "components": [ - { - "internalType": "GameType", - "name": "gameType", - "type": "uint32" - }, - { - "internalType": "Claim", - "name": "absolutePrestate", - "type": "bytes32" - }, { "internalType": "uint256", "name": "maxGameDepth", @@ -32,26 +22,6 @@ "internalType": "Duration", "name": "maxClockDuration", "type": "uint64" - }, - { - "internalType": "contract IBigStepper", - "name": "vm", - "type": "address" - }, - { - "internalType": "contract IDelayedWETH", - "name": "weth", - "type": "address" - }, - { - "internalType": "contract IAnchorStateRegistry", - "name": "anchorStateRegistry", - "type": "address" - }, - { - "internalType": "uint256", - "name": "l2ChainId", - "type": "uint256" } ], "internalType": "struct FaultDisputeGame.GameConstructorParams", @@ -72,7 +42,7 @@ "type": "bytes32" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -108,7 +78,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -402,7 +372,7 @@ "type": "bytes" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -415,7 +385,7 @@ "type": "uint32" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -563,7 +533,7 @@ "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -797,7 +767,7 @@ "type": "bytes32" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -945,7 +915,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -971,7 +941,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -1205,11 +1175,6 @@ "name": "OutOfOrderResolution", "type": "error" }, - { - "inputs": [], - "name": "ReservedGameType", - "type": "error" - }, { "inputs": [], "name": "UnexpectedList", diff --git a/packages/contracts-bedrock/snapshots/abi/FaultDisputeGameV2.json b/packages/contracts-bedrock/snapshots/abi/FaultDisputeGameV2.json deleted file mode 100644 index 92cc0f80814..00000000000 --- a/packages/contracts-bedrock/snapshots/abi/FaultDisputeGameV2.json +++ /dev/null @@ -1,1209 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "maxGameDepth", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "splitDepth", - "type": "uint256" - }, - { - "internalType": "Duration", - "name": "clockExtension", - "type": "uint64" - }, - { - "internalType": "Duration", - "name": "maxClockDuration", - "type": "uint64" - } - ], - "internalType": "struct FaultDisputeGameV2.GameConstructorParams", - "name": "_params", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "absolutePrestate", - "outputs": [ - { - "internalType": "Claim", - "name": "absolutePrestate_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_ident", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_execLeafIdx", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_partOffset", - "type": "uint256" - } - ], - "name": "addLocalData", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "anchorStateRegistry", - "outputs": [ - { - "internalType": "contract IAnchorStateRegistry", - "name": "registry_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "_disputed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_parentIndex", - "type": "uint256" - }, - { - "internalType": "Claim", - "name": "_claim", - "type": "bytes32" - } - ], - "name": "attack", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "bondDistributionMode", - "outputs": [ - { - "internalType": "enum BondDistributionMode", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "version", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "stateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "messagePasserStorageRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "latestBlockhash", - "type": "bytes32" - } - ], - "internalType": "struct Types.OutputRootProof", - "name": "_outputRootProof", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "_headerRLP", - "type": "bytes" - } - ], - "name": "challengeRootL2Block", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - } - ], - "name": "claimCredit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "claimData", - "outputs": [ - { - "internalType": "uint32", - "name": "parentIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "counteredBy", - "type": "address" - }, - { - "internalType": "address", - "name": "claimant", - "type": "address" - }, - { - "internalType": "uint128", - "name": "bond", - "type": "uint128" - }, - { - "internalType": "Claim", - "name": "claim", - "type": "bytes32" - }, - { - "internalType": "Position", - "name": "position", - "type": "uint128" - }, - { - "internalType": "Clock", - "name": "clock", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "claimDataLen", - "outputs": [ - { - "internalType": "uint256", - "name": "len_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Hash", - "name": "", - "type": "bytes32" - } - ], - "name": "claims", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "clockExtension", - "outputs": [ - { - "internalType": "Duration", - "name": "clockExtension_", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "closeGame", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "createdAt", - "outputs": [ - { - "internalType": "Timestamp", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - } - ], - "name": "credit", - "outputs": [ - { - "internalType": "uint256", - "name": "credit_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "_disputed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_parentIndex", - "type": "uint256" - }, - { - "internalType": "Claim", - "name": "_claim", - "type": "bytes32" - } - ], - "name": "defend", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "extraData", - "outputs": [ - { - "internalType": "bytes", - "name": "extraData_", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "gameCreator", - "outputs": [ - { - "internalType": "address", - "name": "creator_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "gameData", - "outputs": [ - { - "internalType": "GameType", - "name": "gameType_", - "type": "uint32" - }, - { - "internalType": "Claim", - "name": "rootClaim_", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "extraData_", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "gameType", - "outputs": [ - { - "internalType": "GameType", - "name": "gameType_", - "type": "uint32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - } - ], - "name": "getChallengerDuration", - "outputs": [ - { - "internalType": "Duration", - "name": "duration_", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - } - ], - "name": "getNumToResolve", - "outputs": [ - { - "internalType": "uint256", - "name": "numRemainingChildren_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Position", - "name": "_position", - "type": "uint128" - } - ], - "name": "getRequiredBond", - "outputs": [ - { - "internalType": "uint256", - "name": "requiredBond_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "hasUnlockedCredit", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "l1Head", - "outputs": [ - { - "internalType": "Hash", - "name": "l1Head_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "l2BlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "l2BlockNumber_", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "l2BlockNumberChallenged", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2BlockNumberChallenger", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2ChainId", - "outputs": [ - { - "internalType": "uint256", - "name": "l2ChainId_", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "l2SequenceNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "l2SequenceNumber_", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "maxClockDuration", - "outputs": [ - { - "internalType": "Duration", - "name": "maxClockDuration_", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxGameDepth", - "outputs": [ - { - "internalType": "uint256", - "name": "maxGameDepth_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "_disputed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_challengeIndex", - "type": "uint256" - }, - { - "internalType": "Claim", - "name": "_claim", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "_isAttack", - "type": "bool" - } - ], - "name": "move", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "normalModeCredit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "refundModeCredit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "resolutionCheckpoints", - "outputs": [ - { - "internalType": "bool", - "name": "initialCheckpointComplete", - "type": "bool" - }, - { - "internalType": "uint32", - "name": "subgameIndex", - "type": "uint32" - }, - { - "internalType": "Position", - "name": "leftmostPosition", - "type": "uint128" - }, - { - "internalType": "address", - "name": "counteredBy", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "resolve", - "outputs": [ - { - "internalType": "enum GameStatus", - "name": "status_", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_numToResolve", - "type": "uint256" - } - ], - "name": "resolveClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resolvedAt", - "outputs": [ - { - "internalType": "Timestamp", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "resolvedSubgames", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rootClaim", - "outputs": [ - { - "internalType": "Claim", - "name": "rootClaim_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - } - ], - "name": "rootClaimByChainId", - "outputs": [ - { - "internalType": "Claim", - "name": "rootClaim_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "splitDepth", - "outputs": [ - { - "internalType": "uint256", - "name": "splitDepth_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "startingBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "startingBlockNumber_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "startingOutputRoot", - "outputs": [ - { - "internalType": "Hash", - "name": "root", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "l2SequenceNumber", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "startingRootHash", - "outputs": [ - { - "internalType": "Hash", - "name": "startingRootHash_", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "enum GameStatus", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isAttack", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "_stateData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_proof", - "type": "bytes" - } - ], - "name": "step", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "subgames", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "vm", - "outputs": [ - { - "internalType": "contract IBigStepper", - "name": "vm_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "wasRespectedGameTypeWhenCreated", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "weth", - "outputs": [ - { - "internalType": "contract IDelayedWETH", - "name": "weth_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "enum BondDistributionMode", - "name": "bondDistributionMode", - "type": "uint8" - } - ], - "name": "GameClosed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "parentIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "Claim", - "name": "claim", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "claimant", - "type": "address" - } - ], - "name": "Move", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum GameStatus", - "name": "status", - "type": "uint8" - } - ], - "name": "Resolved", - "type": "event" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [], - "name": "AnchorRootNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "BadExtraData", - "type": "error" - }, - { - "inputs": [], - "name": "BlockNumberMatches", - "type": "error" - }, - { - "inputs": [], - "name": "BondTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "CannotDefendRootClaim", - "type": "error" - }, - { - "inputs": [], - "name": "ClaimAboveSplit", - "type": "error" - }, - { - "inputs": [], - "name": "ClaimAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "ClaimAlreadyResolved", - "type": "error" - }, - { - "inputs": [], - "name": "ClockNotExpired", - "type": "error" - }, - { - "inputs": [], - "name": "ClockTimeExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "ContentLengthMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "DuplicateStep", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyItem", - "type": "error" - }, - { - "inputs": [], - "name": "GameDepthExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "GameNotFinalized", - "type": "error" - }, - { - "inputs": [], - "name": "GameNotInProgress", - "type": "error" - }, - { - "inputs": [], - "name": "GameNotResolved", - "type": "error" - }, - { - "inputs": [], - "name": "GamePaused", - "type": "error" - }, - { - "inputs": [], - "name": "IncorrectBondAmount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidBondDistributionMode", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidChallengePeriod", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidClockExtension", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidDataRemainder", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidDisputedClaimIndex", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidHeader", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidHeaderRLP", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidLocalIdent", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidOutputRootProof", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidParent", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidPrestate", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidSplitDepth", - "type": "error" - }, - { - "inputs": [], - "name": "L2BlockNumberChallenged", - "type": "error" - }, - { - "inputs": [], - "name": "MaxDepthTooLarge", - "type": "error" - }, - { - "inputs": [], - "name": "NoCreditToClaim", - "type": "error" - }, - { - "inputs": [], - "name": "OutOfOrderResolution", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedList", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "rootClaim", - "type": "bytes32" - } - ], - "name": "UnexpectedRootClaim", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedString", - "type": "error" - }, - { - "inputs": [], - "name": "UnknownChainId", - "type": "error" - }, - { - "inputs": [], - "name": "ValidStep", - "type": "error" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json index 07ce75d6ff8..3b5c00dccc2 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json @@ -483,12 +483,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContainer.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContainer.json index 3552e0c8e4e..7907cfda080 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContainer.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContainer.json @@ -107,12 +107,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { @@ -275,12 +275,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContractsContainer.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContractsContainer.json index 0014bbfb7ce..f6732e88a1f 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContractsContainer.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerContractsContainer.json @@ -107,12 +107,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { @@ -283,12 +283,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json index 08c026dbfc7..f7813afc55c 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json @@ -396,12 +396,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json index 60a7aed15bb..4aec132f131 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json @@ -279,12 +279,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInteropMigrator.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInteropMigrator.json index 3e06c679ab7..fcc2d4ad2f6 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInteropMigrator.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInteropMigrator.json @@ -186,12 +186,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json index 29f55b0bbc7..b232081b693 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json @@ -186,12 +186,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUtils.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUtils.json index 5f234403fa0..15ff939789a 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUtils.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUtils.json @@ -297,12 +297,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerV2.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerV2.json index f2d5fae6137..105d1e007e1 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerV2.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerV2.json @@ -393,12 +393,12 @@ }, { "internalType": "address", - "name": "faultDisputeGameV2Impl", + "name": "faultDisputeGameImpl", "type": "address" }, { "internalType": "address", - "name": "permissionedDisputeGameV2Impl", + "name": "permissionedDisputeGameImpl", "type": "address" }, { diff --git a/packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGame.json b/packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGame.json index f9718eac61d..3fca5ff30a7 100644 --- a/packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGame.json +++ b/packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGame.json @@ -3,16 +3,6 @@ "inputs": [ { "components": [ - { - "internalType": "GameType", - "name": "gameType", - "type": "uint32" - }, - { - "internalType": "Claim", - "name": "absolutePrestate", - "type": "bytes32" - }, { "internalType": "uint256", "name": "maxGameDepth", @@ -32,41 +22,11 @@ "internalType": "Duration", "name": "maxClockDuration", "type": "uint64" - }, - { - "internalType": "contract IBigStepper", - "name": "vm", - "type": "address" - }, - { - "internalType": "contract IDelayedWETH", - "name": "weth", - "type": "address" - }, - { - "internalType": "contract IAnchorStateRegistry", - "name": "anchorStateRegistry", - "type": "address" - }, - { - "internalType": "uint256", - "name": "l2ChainId", - "type": "uint256" } ], "internalType": "struct FaultDisputeGame.GameConstructorParams", "name": "_params", "type": "tuple" - }, - { - "internalType": "address", - "name": "_proposer", - "type": "address" - }, - { - "internalType": "address", - "name": "_challenger", - "type": "address" } ], "stateMutability": "nonpayable", @@ -82,7 +42,7 @@ "type": "bytes32" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -118,7 +78,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -207,7 +167,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -425,7 +385,7 @@ "type": "bytes" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -438,7 +398,7 @@ "type": "uint32" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -586,7 +546,7 @@ "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -685,7 +645,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -833,7 +793,7 @@ "type": "bytes32" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -981,7 +941,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -1007,7 +967,7 @@ "type": "address" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -1246,11 +1206,6 @@ "name": "OutOfOrderResolution", "type": "error" }, - { - "inputs": [], - "name": "ReservedGameType", - "type": "error" - }, { "inputs": [], "name": "UnexpectedList", diff --git a/packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGameV2.json b/packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGameV2.json deleted file mode 100644 index fb9900ca2d4..00000000000 --- a/packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGameV2.json +++ /dev/null @@ -1,1240 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "maxGameDepth", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "splitDepth", - "type": "uint256" - }, - { - "internalType": "Duration", - "name": "clockExtension", - "type": "uint64" - }, - { - "internalType": "Duration", - "name": "maxClockDuration", - "type": "uint64" - } - ], - "internalType": "struct FaultDisputeGameV2.GameConstructorParams", - "name": "_params", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "absolutePrestate", - "outputs": [ - { - "internalType": "Claim", - "name": "absolutePrestate_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_ident", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_execLeafIdx", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_partOffset", - "type": "uint256" - } - ], - "name": "addLocalData", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "anchorStateRegistry", - "outputs": [ - { - "internalType": "contract IAnchorStateRegistry", - "name": "registry_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "_disputed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_parentIndex", - "type": "uint256" - }, - { - "internalType": "Claim", - "name": "_claim", - "type": "bytes32" - } - ], - "name": "attack", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "bondDistributionMode", - "outputs": [ - { - "internalType": "enum BondDistributionMode", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "version", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "stateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "messagePasserStorageRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "latestBlockhash", - "type": "bytes32" - } - ], - "internalType": "struct Types.OutputRootProof", - "name": "_outputRootProof", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "_headerRLP", - "type": "bytes" - } - ], - "name": "challengeRootL2Block", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "challenger", - "outputs": [ - { - "internalType": "address", - "name": "challenger_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - } - ], - "name": "claimCredit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "claimData", - "outputs": [ - { - "internalType": "uint32", - "name": "parentIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "counteredBy", - "type": "address" - }, - { - "internalType": "address", - "name": "claimant", - "type": "address" - }, - { - "internalType": "uint128", - "name": "bond", - "type": "uint128" - }, - { - "internalType": "Claim", - "name": "claim", - "type": "bytes32" - }, - { - "internalType": "Position", - "name": "position", - "type": "uint128" - }, - { - "internalType": "Clock", - "name": "clock", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "claimDataLen", - "outputs": [ - { - "internalType": "uint256", - "name": "len_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Hash", - "name": "", - "type": "bytes32" - } - ], - "name": "claims", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "clockExtension", - "outputs": [ - { - "internalType": "Duration", - "name": "clockExtension_", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "closeGame", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "createdAt", - "outputs": [ - { - "internalType": "Timestamp", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - } - ], - "name": "credit", - "outputs": [ - { - "internalType": "uint256", - "name": "credit_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "_disputed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_parentIndex", - "type": "uint256" - }, - { - "internalType": "Claim", - "name": "_claim", - "type": "bytes32" - } - ], - "name": "defend", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "extraData", - "outputs": [ - { - "internalType": "bytes", - "name": "extraData_", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "gameCreator", - "outputs": [ - { - "internalType": "address", - "name": "creator_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "gameData", - "outputs": [ - { - "internalType": "GameType", - "name": "gameType_", - "type": "uint32" - }, - { - "internalType": "Claim", - "name": "rootClaim_", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "extraData_", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "gameType", - "outputs": [ - { - "internalType": "GameType", - "name": "gameType_", - "type": "uint32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - } - ], - "name": "getChallengerDuration", - "outputs": [ - { - "internalType": "Duration", - "name": "duration_", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - } - ], - "name": "getNumToResolve", - "outputs": [ - { - "internalType": "uint256", - "name": "numRemainingChildren_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Position", - "name": "_position", - "type": "uint128" - } - ], - "name": "getRequiredBond", - "outputs": [ - { - "internalType": "uint256", - "name": "requiredBond_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "hasUnlockedCredit", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "l1Head", - "outputs": [ - { - "internalType": "Hash", - "name": "l1Head_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "l2BlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "l2BlockNumber_", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "l2BlockNumberChallenged", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2BlockNumberChallenger", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2ChainId", - "outputs": [ - { - "internalType": "uint256", - "name": "l2ChainId_", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "l2SequenceNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "l2SequenceNumber_", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "maxClockDuration", - "outputs": [ - { - "internalType": "Duration", - "name": "maxClockDuration_", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxGameDepth", - "outputs": [ - { - "internalType": "uint256", - "name": "maxGameDepth_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "_disputed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_challengeIndex", - "type": "uint256" - }, - { - "internalType": "Claim", - "name": "_claim", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "_isAttack", - "type": "bool" - } - ], - "name": "move", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "normalModeCredit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proposer", - "outputs": [ - { - "internalType": "address", - "name": "proposer_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "refundModeCredit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "resolutionCheckpoints", - "outputs": [ - { - "internalType": "bool", - "name": "initialCheckpointComplete", - "type": "bool" - }, - { - "internalType": "uint32", - "name": "subgameIndex", - "type": "uint32" - }, - { - "internalType": "Position", - "name": "leftmostPosition", - "type": "uint128" - }, - { - "internalType": "address", - "name": "counteredBy", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "resolve", - "outputs": [ - { - "internalType": "enum GameStatus", - "name": "status_", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_numToResolve", - "type": "uint256" - } - ], - "name": "resolveClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resolvedAt", - "outputs": [ - { - "internalType": "Timestamp", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "resolvedSubgames", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rootClaim", - "outputs": [ - { - "internalType": "Claim", - "name": "rootClaim_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - } - ], - "name": "rootClaimByChainId", - "outputs": [ - { - "internalType": "Claim", - "name": "rootClaim_", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "splitDepth", - "outputs": [ - { - "internalType": "uint256", - "name": "splitDepth_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "startingBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "startingBlockNumber_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "startingOutputRoot", - "outputs": [ - { - "internalType": "Hash", - "name": "root", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "l2SequenceNumber", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "startingRootHash", - "outputs": [ - { - "internalType": "Hash", - "name": "startingRootHash_", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "status", - "outputs": [ - { - "internalType": "enum GameStatus", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_claimIndex", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_isAttack", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "_stateData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_proof", - "type": "bytes" - } - ], - "name": "step", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "subgames", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "vm", - "outputs": [ - { - "internalType": "contract IBigStepper", - "name": "vm_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "wasRespectedGameTypeWhenCreated", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "weth", - "outputs": [ - { - "internalType": "contract IDelayedWETH", - "name": "weth_", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "enum BondDistributionMode", - "name": "bondDistributionMode", - "type": "uint8" - } - ], - "name": "GameClosed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "parentIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "Claim", - "name": "claim", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "claimant", - "type": "address" - } - ], - "name": "Move", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum GameStatus", - "name": "status", - "type": "uint8" - } - ], - "name": "Resolved", - "type": "event" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [], - "name": "AnchorRootNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "BadAuth", - "type": "error" - }, - { - "inputs": [], - "name": "BadExtraData", - "type": "error" - }, - { - "inputs": [], - "name": "BlockNumberMatches", - "type": "error" - }, - { - "inputs": [], - "name": "BondTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "CannotDefendRootClaim", - "type": "error" - }, - { - "inputs": [], - "name": "ClaimAboveSplit", - "type": "error" - }, - { - "inputs": [], - "name": "ClaimAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "ClaimAlreadyResolved", - "type": "error" - }, - { - "inputs": [], - "name": "ClockNotExpired", - "type": "error" - }, - { - "inputs": [], - "name": "ClockTimeExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "ContentLengthMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "DuplicateStep", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyItem", - "type": "error" - }, - { - "inputs": [], - "name": "GameDepthExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "GameNotFinalized", - "type": "error" - }, - { - "inputs": [], - "name": "GameNotInProgress", - "type": "error" - }, - { - "inputs": [], - "name": "GameNotResolved", - "type": "error" - }, - { - "inputs": [], - "name": "GamePaused", - "type": "error" - }, - { - "inputs": [], - "name": "IncorrectBondAmount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidBondDistributionMode", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidChallengePeriod", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidClockExtension", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidDataRemainder", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidDisputedClaimIndex", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidHeader", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidHeaderRLP", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidLocalIdent", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidOutputRootProof", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidParent", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidPrestate", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidSplitDepth", - "type": "error" - }, - { - "inputs": [], - "name": "L2BlockNumberChallenged", - "type": "error" - }, - { - "inputs": [], - "name": "MaxDepthTooLarge", - "type": "error" - }, - { - "inputs": [], - "name": "NoCreditToClaim", - "type": "error" - }, - { - "inputs": [], - "name": "OutOfOrderResolution", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedList", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "Claim", - "name": "rootClaim", - "type": "bytes32" - } - ], - "name": "UnexpectedRootClaim", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedString", - "type": "error" - }, - { - "inputs": [], - "name": "UnknownChainId", - "type": "error" - }, - { - "inputs": [], - "name": "ValidStep", - "type": "error" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/semver-lock.json b/packages/contracts-bedrock/snapshots/semver-lock.json index 3a98d960daf..c4ea092ede5 100644 --- a/packages/contracts-bedrock/snapshots/semver-lock.json +++ b/packages/contracts-bedrock/snapshots/semver-lock.json @@ -24,8 +24,8 @@ "sourceCodeHash": "0xfca613b5d055ffc4c3cbccb0773ddb9030abedc1aa6508c9e2e7727cc0cd617b" }, "src/L1/OPContractsManager.sol:OPContractsManager": { - "initCodeHash": "0xdbf23ba71f865d1c3086a10b48f8faaa21ed0d689fdd14ec9ad988f8f013b5c3", - "sourceCodeHash": "0x048f592543a93c05085919f6a1670600ead00991e8370ae83fea1665ca09a5b4" + "initCodeHash": "0x2cce72de2764fc3af4ebaad27f22a6bcb205864b1ed444a3a859de13cbe65110", + "sourceCodeHash": "0x1e65fbb3f6482d87ae0e0bc1034ba161a7b138084f0eb068942330bc39240dc3" }, "src/L1/OPContractsManagerStandardValidator.sol:OPContractsManagerStandardValidator": { "initCodeHash": "0xdec828fdb9f9bb7a35ca03d851b041fcd088681957642e949b5d320358d9b9a1", @@ -192,16 +192,16 @@ "sourceCodeHash": "0xdebf2ab3af4d5549c40e9dd9db6b2458af286f323b6891f3b0c4e89f3c8928db" }, "src/dispute/DisputeGameFactory.sol:DisputeGameFactory": { - "initCodeHash": "0x820e876839f94564a9d5d1fa131781c40126aed76fbbd348f49f318ae3e12aae", - "sourceCodeHash": "0xf19216b7943479af87a01ab8935e68561853e8e333d09719c917228bc7a01a3a" + "initCodeHash": "0xb7ef378c93102b733ec5e96f6448cdae0057b24be05ac99512fd155c0d7d3512", + "sourceCodeHash": "0xb6a8606b6849a28ee413d257a02732794e75165f40810ad1e0721204fce4ba36" }, "src/dispute/FaultDisputeGame.sol:FaultDisputeGame": { - "initCodeHash": "0x57b01ba6873a49b3adafe58d05e0e0c4f342281181682f9f7ecd30752395b4ad", - "sourceCodeHash": "0x04111af652e4a059b591da704a7d7a15dcb46a75be05fd7cad6b88c1b7a1ac1b" + "initCodeHash": "0x2806f9c9f0babb80be2a0c40382d265d598632dc6c1902db7f5f8f214d233f2f", + "sourceCodeHash": "0xf92368ee087f58ea25cd4fec205098e7d83dbfc3b0a7033989e841b9fa30924a" }, "src/dispute/PermissionedDisputeGame.sol:PermissionedDisputeGame": { - "initCodeHash": "0xcd7a262ac008a2de347e459902ca7039c1c980eb312106b9cc2c1f3190ae0840", - "sourceCodeHash": "0x618013c7ad9742f59445f355f7b26347ee1727c9e6616218a6f3443f1b4bb8e0" + "initCodeHash": "0xfbb451f1a0bf22bb96242db527371dd0b0c3435208f9e074441ec0aacbf414bd", + "sourceCodeHash": "0x3cd249d2e07e055a021e15d3f5cb4a7d2290a9b3c28eae60a007529435c97665" }, "src/dispute/SuperFaultDisputeGame.sol:SuperFaultDisputeGame": { "initCodeHash": "0xb5ce71bc56109055cd0dc71fc63015443bbdb29c5975e049802cd1b5188f06ca", @@ -211,17 +211,9 @@ "initCodeHash": "0xa080730728e812e8b02d03b5857b23d16ade46f1656f26f22274835a3100edd7", "sourceCodeHash": "0x314b6e0412f698ce3531e8176ce8e5b8a3976cc3fa9d7ecb1f3278612f90ed4e" }, - "src/dispute/v2/FaultDisputeGameV2.sol:FaultDisputeGameV2": { - "initCodeHash": "0x2806f9c9f0babb80be2a0c40382d265d598632dc6c1902db7f5f8f214d233f2f", - "sourceCodeHash": "0x1ac7a6aa4adafe2058046f06a425c662369f756a89be956b5a222647d99fabe8" - }, - "src/dispute/v2/PermissionedDisputeGameV2.sol:PermissionedDisputeGameV2": { - "initCodeHash": "0xfbb451f1a0bf22bb96242db527371dd0b0c3435208f9e074441ec0aacbf414bd", - "sourceCodeHash": "0x92bb886203246108435408762fab6e56fe223c2ed5ae85b5b792653cead4ec7a" - }, "src/dispute/zk/OptimisticZkGame.sol:OptimisticZkGame": { - "initCodeHash": "0x6eff352a513e3ce2ac5c53e4094985bf2ae1acad3992d73d6564c95aca3aebf1", - "sourceCodeHash": "0x998796b0286830629cd50eeb003eec571680cd171f4ad80bd5cad53aca756909" + "initCodeHash": "0xb362901fedfed4a467b0f3563af7e72f7a15b5eea396273cf9efde975741dae7", + "sourceCodeHash": "0x95ffef6a63315730c089038b21d780a6dfec0887b87c1528b6a3329c2c838271" }, "src/legacy/DeployerWhitelist.sol:DeployerWhitelist": { "initCodeHash": "0x2e0ef4c341367eb59cc6c25190c64eff441d3fe130189da91d4d126f6bdbc9b5", diff --git a/packages/contracts-bedrock/snapshots/storageLayout/FaultDisputeGameV2.json b/packages/contracts-bedrock/snapshots/storageLayout/FaultDisputeGameV2.json deleted file mode 100644 index efae9aab937..00000000000 --- a/packages/contracts-bedrock/snapshots/storageLayout/FaultDisputeGameV2.json +++ /dev/null @@ -1,121 +0,0 @@ -[ - { - "bytes": "8", - "label": "createdAt", - "offset": 0, - "slot": "0", - "type": "Timestamp" - }, - { - "bytes": "8", - "label": "resolvedAt", - "offset": 8, - "slot": "0", - "type": "Timestamp" - }, - { - "bytes": "1", - "label": "status", - "offset": 16, - "slot": "0", - "type": "enum GameStatus" - }, - { - "bytes": "1", - "label": "initialized", - "offset": 17, - "slot": "0", - "type": "bool" - }, - { - "bytes": "1", - "label": "l2BlockNumberChallenged", - "offset": 18, - "slot": "0", - "type": "bool" - }, - { - "bytes": "20", - "label": "l2BlockNumberChallenger", - "offset": 0, - "slot": "1", - "type": "address" - }, - { - "bytes": "32", - "label": "claimData", - "offset": 0, - "slot": "2", - "type": "struct FaultDisputeGameV2.ClaimData[]" - }, - { - "bytes": "32", - "label": "normalModeCredit", - "offset": 0, - "slot": "3", - "type": "mapping(address => uint256)" - }, - { - "bytes": "32", - "label": "claims", - "offset": 0, - "slot": "4", - "type": "mapping(Hash => bool)" - }, - { - "bytes": "32", - "label": "subgames", - "offset": 0, - "slot": "5", - "type": "mapping(uint256 => uint256[])" - }, - { - "bytes": "32", - "label": "resolvedSubgames", - "offset": 0, - "slot": "6", - "type": "mapping(uint256 => bool)" - }, - { - "bytes": "32", - "label": "resolutionCheckpoints", - "offset": 0, - "slot": "7", - "type": "mapping(uint256 => struct FaultDisputeGameV2.ResolutionCheckpoint)" - }, - { - "bytes": "64", - "label": "startingOutputRoot", - "offset": 0, - "slot": "8", - "type": "struct Proposal" - }, - { - "bytes": "1", - "label": "wasRespectedGameTypeWhenCreated", - "offset": 0, - "slot": "10", - "type": "bool" - }, - { - "bytes": "32", - "label": "refundModeCredit", - "offset": 0, - "slot": "11", - "type": "mapping(address => uint256)" - }, - { - "bytes": "32", - "label": "hasUnlockedCredit", - "offset": 0, - "slot": "12", - "type": "mapping(address => bool)" - }, - { - "bytes": "1", - "label": "bondDistributionMode", - "offset": 0, - "slot": "13", - "type": "enum BondDistributionMode" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/storageLayout/PermissionedDisputeGameV2.json b/packages/contracts-bedrock/snapshots/storageLayout/PermissionedDisputeGameV2.json deleted file mode 100644 index efae9aab937..00000000000 --- a/packages/contracts-bedrock/snapshots/storageLayout/PermissionedDisputeGameV2.json +++ /dev/null @@ -1,121 +0,0 @@ -[ - { - "bytes": "8", - "label": "createdAt", - "offset": 0, - "slot": "0", - "type": "Timestamp" - }, - { - "bytes": "8", - "label": "resolvedAt", - "offset": 8, - "slot": "0", - "type": "Timestamp" - }, - { - "bytes": "1", - "label": "status", - "offset": 16, - "slot": "0", - "type": "enum GameStatus" - }, - { - "bytes": "1", - "label": "initialized", - "offset": 17, - "slot": "0", - "type": "bool" - }, - { - "bytes": "1", - "label": "l2BlockNumberChallenged", - "offset": 18, - "slot": "0", - "type": "bool" - }, - { - "bytes": "20", - "label": "l2BlockNumberChallenger", - "offset": 0, - "slot": "1", - "type": "address" - }, - { - "bytes": "32", - "label": "claimData", - "offset": 0, - "slot": "2", - "type": "struct FaultDisputeGameV2.ClaimData[]" - }, - { - "bytes": "32", - "label": "normalModeCredit", - "offset": 0, - "slot": "3", - "type": "mapping(address => uint256)" - }, - { - "bytes": "32", - "label": "claims", - "offset": 0, - "slot": "4", - "type": "mapping(Hash => bool)" - }, - { - "bytes": "32", - "label": "subgames", - "offset": 0, - "slot": "5", - "type": "mapping(uint256 => uint256[])" - }, - { - "bytes": "32", - "label": "resolvedSubgames", - "offset": 0, - "slot": "6", - "type": "mapping(uint256 => bool)" - }, - { - "bytes": "32", - "label": "resolutionCheckpoints", - "offset": 0, - "slot": "7", - "type": "mapping(uint256 => struct FaultDisputeGameV2.ResolutionCheckpoint)" - }, - { - "bytes": "64", - "label": "startingOutputRoot", - "offset": 0, - "slot": "8", - "type": "struct Proposal" - }, - { - "bytes": "1", - "label": "wasRespectedGameTypeWhenCreated", - "offset": 0, - "slot": "10", - "type": "bool" - }, - { - "bytes": "32", - "label": "refundModeCredit", - "offset": 0, - "slot": "11", - "type": "mapping(address => uint256)" - }, - { - "bytes": "32", - "label": "hasUnlockedCredit", - "offset": 0, - "slot": "12", - "type": "mapping(address => bool)" - }, - { - "bytes": "1", - "label": "bondDistributionMode", - "offset": 0, - "slot": "13", - "type": "enum BondDistributionMode" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/src/L1/OPContractsManager.sol b/packages/contracts-bedrock/src/L1/OPContractsManager.sol index 85332af9532..7d66423f0dc 100644 --- a/packages/contracts-bedrock/src/L1/OPContractsManager.sol +++ b/packages/contracts-bedrock/src/L1/OPContractsManager.sol @@ -225,31 +225,6 @@ abstract contract OPContractsManagerBase { if (_who.code.length == 0) revert OPContractsManager.AddressHasNoCode(_who); } - function encodePermissionlessFDGConstructor(IFaultDisputeGame.GameConstructorParams memory _params) - internal - view - virtual - returns (bytes memory) - { - bytes memory dataWithSelector = abi.encodeCall(IFaultDisputeGame.__constructor__, (_params)); - return Bytes.slice(dataWithSelector, 4); - } - - function encodePermissionedFDGConstructor( - IFaultDisputeGame.GameConstructorParams memory _params, - address _proposer, - address _challenger - ) - internal - view - virtual - returns (bytes memory) - { - bytes memory dataWithSelector = - abi.encodeCall(IPermissionedDisputeGame.__constructor__, (_params, _proposer, _challenger)); - return Bytes.slice(dataWithSelector, 4); - } - function encodePermissionlessSuperFDGConstructor(ISuperFaultDisputeGame.GameConstructorParams memory _params) internal view @@ -272,12 +247,7 @@ abstract contract OPContractsManagerBase { return _disputeGameFactory.gameImpls(_gameType); } - /// @notice Retrieves the Anchor State Registry for a given v1 game - function getAnchorStateRegistryV1(IFaultDisputeGame _disputeGame) internal view returns (IAnchorStateRegistry) { - return _disputeGame.anchorStateRegistry(); - } - - /// @notice Retrieves the Anchor State Registry for a given v1 or v2 game + /// @notice Retrieves the Anchor State Registry for a given game function getAnchorStateRegistry( IDisputeGameFactory _disputeGameFactory, IDisputeGame _disputeGame, @@ -300,12 +270,7 @@ abstract contract OPContractsManagerBase { return _disputeGame.l2ChainId(); } - /// @notice Retrieves the proposer address for a given v1 game - function getProposerV1(IPermissionedDisputeGame _disputeGame) internal view returns (address) { - return _disputeGame.proposer(); - } - - /// @notice Retrieves the proposer address for a given v1 or v2 game + /// @notice Retrieves the proposer address for a given game function getProposer( IDisputeGameFactory _disputeGameFactory, IDisputeGame _disputeGame, @@ -323,12 +288,7 @@ abstract contract OPContractsManagerBase { } } - /// @notice Retrieves the challenger address for a given v1 game - function getChallengerV1(IPermissionedDisputeGame _disputeGame) internal view returns (address) { - return _disputeGame.challenger(); - } - - /// @notice Retrieves the challenger address of a given v1 or v2 game + /// @notice Retrieves the challenger address of a given game function getChallenger( IDisputeGameFactory _disputeGameFactory, IDisputeGame _disputeGame, @@ -351,7 +311,7 @@ abstract contract OPContractsManagerBase { /// @param _input The deployment input data containing all necessary parameters /// @param _implementation The implementation addresses struct /// @param _output The deployment output containing proxy addresses - function _registerPermissionedGameV2( + function _registerPermissionedGame( OPContractsManager.DeployInput calldata _input, OPContractsManager.Implementations memory _implementation, OPContractsManager.DeployOutput memory _output @@ -370,7 +330,7 @@ abstract contract OPContractsManagerBase { setDGFImplementation( _output.disputeGameFactoryProxy, GameTypes.PERMISSIONED_CANNON, - IDisputeGame(_implementation.permissionedDisputeGameV2Impl), + IDisputeGame(_implementation.permissionedDisputeGameImpl), gameArgs ); } @@ -385,38 +345,7 @@ abstract contract OPContractsManagerBase { return IAnchorStateRegistry(IOptimismPortal(payable(_systemConfig.optimismPortal())).anchorStateRegistry()); } - /// @notice Retrieves the constructor params for a given v1 game. - function getGameConstructorParams(IFaultDisputeGame _disputeGame) - internal - view - returns (IFaultDisputeGame.GameConstructorParams memory) - { - // Grab the game type first, it'll determine if we need to pull the L2 chain ID from the - // contract or if we just return zero (Super games). - GameType gameType = _disputeGame.gameType(); - uint256 l2ChainId = getL2ChainId(_disputeGame); - - // Return the constructor params. - return IFaultDisputeGame.GameConstructorParams({ - gameType: gameType, - absolutePrestate: _disputeGame.absolutePrestate(), - maxGameDepth: _disputeGame.maxGameDepth(), - splitDepth: _disputeGame.splitDepth(), - clockExtension: _disputeGame.clockExtension(), - maxClockDuration: _disputeGame.maxClockDuration(), - vm: _disputeGame.vm(), - weth: getWETHV1(_disputeGame), - anchorStateRegistry: getAnchorStateRegistryV1(_disputeGame), - l2ChainId: l2ChainId - }); - } - - /// @notice Retrieves the DelayedWETH address for a given v1 game - function getWETHV1(IFaultDisputeGame _disputeGame) internal view returns (IDelayedWETH) { - return _disputeGame.weth(); - } - - /// @notice Retrieves the DelayedWETH for a given v1 or v2 game + /// @notice Retrieves the DelayedWETH for a given game function getWETH( IDisputeGameFactory _disputeGameFactory, IDisputeGame _disputeGame, @@ -434,7 +363,7 @@ abstract contract OPContractsManagerBase { } } - /// @notice Retrieves the BigStepper VM for a given v1 or v2 game + /// @notice Retrieves the BigStepper VM for a given game function getVM( IDisputeGameFactory _disputeGameFactory, IDisputeGame _disputeGame, @@ -497,13 +426,13 @@ abstract contract OPContractsManagerBase { if (_gameType.raw() == GameTypes.SUPER_PERMISSIONED_CANNON.raw()) { return getImplementations().superPermissionedDisputeGameImpl; } else if (_gameType.raw() == GameTypes.PERMISSIONED_CANNON.raw()) { - return getImplementations().permissionedDisputeGameV2Impl; + return getImplementations().permissionedDisputeGameImpl; } else if ( _gameType.raw() == GameTypes.SUPER_CANNON.raw() || _gameType.raw() == GameTypes.SUPER_CANNON_KONA.raw() ) { return getImplementations().superFaultDisputeGameImpl; } else if (_gameType.raw() == GameTypes.CANNON.raw() || _gameType.raw() == GameTypes.CANNON_KONA.raw()) { - return getImplementations().faultDisputeGameV2Impl; + return getImplementations().faultDisputeGameImpl; } else { revert OPContractsManager_InvalidGameType(); } @@ -904,7 +833,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { // All chains have the PermissionedDisputeGame, grab that. IDisputeGame permissionedDisputeGame = getGameImplementation(dgf, GameTypes.PERMISSIONED_CANNON); - setNewPermissionedGameImplV2({ + setNewPermissionedGameImpl({ _impls: _impls, _l2ChainId: _l2ChainId, _disputeGame: permissionedDisputeGame, @@ -925,7 +854,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { Claim cannonPrestate = _opChainConfig.cannonPrestate.raw() != bytes32(0) ? _opChainConfig.cannonPrestate : getAbsolutePrestate(disputeGameFactory, address(permissionlessDisputeGame), GameTypes.CANNON); - setNewPermissionlessGameImplV2({ + setNewPermissionlessGameImpl({ _impls: _impls, _l2ChainId: _l2ChainId, _newAbsolutePrestate: cannonPrestate, @@ -936,7 +865,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { }); if (_opChainConfig.cannonKonaPrestate.raw() != bytes32(0)) { - setNewPermissionlessGameImplV2({ + setNewPermissionlessGameImpl({ _impls: _impls, _l2ChainId: _l2ChainId, _newAbsolutePrestate: _opChainConfig.cannonKonaPrestate, @@ -995,7 +924,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { /// @param _newDelayedWeth The new delayed WETH implementation /// @param _newAnchorStateRegistryProxy The new anchor state registry proxy /// @param _opChainConfig The OP chain configuration - function setNewPermissionedGameImplV2( + function setNewPermissionedGameImpl( OPContractsManager.Implementations memory _impls, uint256 _l2ChainId, IDisputeGame _disputeGame, @@ -1022,7 +951,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { revert OPContractsManager.PrestateNotSet(); } - IDisputeGame newGame = IDisputeGame(_impls.permissionedDisputeGameV2Impl); + IDisputeGame newGame = IDisputeGame(_impls.permissionedDisputeGameImpl); bytes memory gameArgs = LibGameArgs.encode( LibGameArgs.GameArgs({ absolutePrestate: absolutePrestate.raw(), @@ -1049,7 +978,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { /// @param _newDelayedWeth The new delayed WETH implementation /// @param _newAnchorStateRegistryProxy The new anchor state registry proxy /// @param _disputeGameFactory The dispute game factory proxy - function setNewPermissionlessGameImplV2( + function setNewPermissionlessGameImpl( OPContractsManager.Implementations memory _impls, uint256 _l2ChainId, Claim _newAbsolutePrestate, @@ -1065,7 +994,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { revert OPContractsManager.PrestateNotSet(); } - IDisputeGame newGame = IDisputeGame(_impls.faultDisputeGameV2Impl); + IDisputeGame newGame = IDisputeGame(_impls.faultDisputeGameImpl); bytes memory gameArgs = LibGameArgs.encode( LibGameArgs.GameArgs({ absolutePrestate: _newAbsolutePrestate.raw(), @@ -1092,10 +1021,10 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { { bytes memory gameArgsBytes = _dgf.gameArgs(_gameType); if (gameArgsBytes.length == 0) { - // assume we're dealing with v1 fdgs + // Game without CWIA args - read directly from contract return IFaultDisputeGame(_disputeGame).absolutePrestate(); } else { - // v2 dispute game + // Game with CWIA args - decode from game args LibGameArgs.GameArgs memory gameArgs = LibGameArgs.decode(gameArgsBytes); return Claim.wrap(gameArgs.absolutePrestate); } @@ -1299,7 +1228,7 @@ contract OPContractsManagerDeployer is OPContractsManagerBase { data ); // Extracted to helper function to avoid stack too deep error - _registerPermissionedGameV2(_input, implementation, output); + _registerPermissionedGame(_input, implementation, output); transferOwnership(address(output.disputeGameFactoryProxy), address(_input.roles.opChainProxyAdminOwner)); @@ -1935,8 +1864,8 @@ contract OPContractsManager is ISemver { address anchorStateRegistryImpl; address delayedWETHImpl; address mipsImpl; - address faultDisputeGameV2Impl; - address permissionedDisputeGameV2Impl; + address faultDisputeGameImpl; + address permissionedDisputeGameImpl; address superFaultDisputeGameImpl; address superPermissionedDisputeGameImpl; } @@ -1977,9 +1906,9 @@ contract OPContractsManager is ISemver { // -------- Constants and Variables -------- - /// @custom:semver 6.0.1 + /// @custom:semver 6.1.0 function version() public pure virtual returns (string memory) { - return "6.0.1"; + return "6.1.0"; } OPContractsManagerGameTypeAdder public immutable opcmGameTypeAdder; diff --git a/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerContainer.sol b/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerContainer.sol index 01bbeeebcee..5d3419bdbea 100644 --- a/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerContainer.sol +++ b/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerContainer.sol @@ -36,8 +36,8 @@ contract OPContractsManagerContainer { address anchorStateRegistryImpl; address delayedWETHImpl; address mipsImpl; - address faultDisputeGameV2Impl; - address permissionedDisputeGameV2Impl; + address faultDisputeGameImpl; + address permissionedDisputeGameImpl; address superFaultDisputeGameImpl; address superPermissionedDisputeGameImpl; address storageSetterImpl; diff --git a/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerUtils.sol b/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerUtils.sol index 246b740103e..b392b2171c2 100644 --- a/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerUtils.sol +++ b/packages/contracts-bedrock/src/L1/opcm/OPContractsManagerUtils.sol @@ -341,11 +341,11 @@ contract OPContractsManagerUtils { function getGameImpl(GameType _gameType) public view returns (IDisputeGame) { IOPContractsManagerContainer.Implementations memory impls = implementations(); if (_gameType.raw() == GameTypes.CANNON.raw()) { - return IDisputeGame(impls.faultDisputeGameV2Impl); + return IDisputeGame(impls.faultDisputeGameImpl); } else if (_gameType.raw() == GameTypes.PERMISSIONED_CANNON.raw()) { - return IDisputeGame(impls.permissionedDisputeGameV2Impl); + return IDisputeGame(impls.permissionedDisputeGameImpl); } else if (_gameType.raw() == GameTypes.CANNON_KONA.raw()) { - return IDisputeGame(impls.faultDisputeGameV2Impl); + return IDisputeGame(impls.faultDisputeGameImpl); } else if (_gameType.raw() == GameTypes.SUPER_CANNON.raw()) { return IDisputeGame(impls.superFaultDisputeGameImpl); } else if (_gameType.raw() == GameTypes.SUPER_PERMISSIONED_CANNON.raw()) { diff --git a/packages/contracts-bedrock/src/dispute/DisputeGameFactory.sol b/packages/contracts-bedrock/src/dispute/DisputeGameFactory.sol index eb92ca52224..db1fecaf173 100644 --- a/packages/contracts-bedrock/src/dispute/DisputeGameFactory.sol +++ b/packages/contracts-bedrock/src/dispute/DisputeGameFactory.sol @@ -56,8 +56,8 @@ contract DisputeGameFactory is ProxyAdminOwnedBase, ReinitializableBase, Ownable } /// @notice Semantic version. - /// @custom:semver 1.4.0 - string public constant version = "1.4.0"; + /// @custom:semver 1.5.0 + string public constant version = "1.5.0"; /// @notice `gameImpls` is a mapping that maps `GameType`s to their respective /// `IDisputeGame` implementations. diff --git a/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol b/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol index 97f4e0506ec..5681ef3e2ad 100644 --- a/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol +++ b/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol @@ -56,7 +56,6 @@ import { GameNotFinalized, InvalidBondDistributionMode, GameNotResolved, - ReservedGameType, GamePaused, BadExtraData, UnknownChainId @@ -98,16 +97,10 @@ contract FaultDisputeGame is Clone, ISemver { /// @notice Parameters for creating a new FaultDisputeGame. We place this into a struct to /// avoid stack-too-deep errors when compiling without the optimizer enabled. struct GameConstructorParams { - GameType gameType; - Claim absolutePrestate; uint256 maxGameDepth; uint256 splitDepth; Duration clockExtension; Duration maxClockDuration; - IBigStepper vm; - IDelayedWETH weth; - IAnchorStateRegistry anchorStateRegistry; - uint256 l2ChainId; } //////////////////////////////////////////////////////////////// @@ -131,10 +124,6 @@ contract FaultDisputeGame is Clone, ISemver { // State Vars // //////////////////////////////////////////////////////////////// - /// @notice The absolute prestate of the instruction trace. This is a constant that is defined - /// by the program that is being used to execute the trace. - Claim internal immutable ABSOLUTE_PRESTATE; - /// @notice The max depth of the game. uint256 internal immutable MAX_GAME_DEPTH; @@ -145,21 +134,6 @@ contract FaultDisputeGame is Clone, ISemver { /// @notice The maximum duration that may accumulate on a team's chess clock before they may no longer respond. Duration internal immutable MAX_CLOCK_DURATION; - /// @notice An onchain VM that performs single instruction steps on a fault proof program trace. - IBigStepper internal immutable VM; - - /// @notice The game type ID. - GameType internal immutable GAME_TYPE; - - /// @notice WETH contract for holding ETH. - IDelayedWETH internal immutable WETH; - - /// @notice The anchor state registry. - IAnchorStateRegistry internal immutable ANCHOR_STATE_REGISTRY; - - /// @notice The chain ID of the L2 network this contract argues about. - uint256 internal immutable L2_CHAIN_ID; - /// @notice The duration of the clock extension. Will be doubled if the grandchild is the root claim of an execution /// trace bisection subgame. Duration internal immutable CLOCK_EXTENSION; @@ -173,9 +147,9 @@ contract FaultDisputeGame is Clone, ISemver { uint256 internal constant HEADER_BLOCK_NUMBER_INDEX = 8; /// @notice Semantic version. - /// @custom:semver 1.9.0 + /// @custom:semver 2.3.0 function version() public pure virtual returns (string memory) { - return "1.9.0"; + return "2.3.0"; } /// @notice The starting timestamp of the game @@ -246,40 +220,21 @@ contract FaultDisputeGame is Clone, ISemver { // The split depth cannot be 0 or 1 to stay in bounds of clock extension arithmetic. if (_params.splitDepth < 2) revert InvalidSplitDepth(); - // The PreimageOracle challenge period must fit into uint64 so we can safely use it here. - // Runtime check was added instead of changing the ABI since the contract is already - // deployed in production. We perform the same check within the PreimageOracle for the - // benefit of developers but also perform this check here defensively. - if (_params.vm.oracle().challengePeriod() > type(uint64).max) revert InvalidChallengePeriod(); - - // Determine the maximum clock extension which is either the split depth extension or the - // maximum game depth extension depending on the configuration of these contracts. + // Validate clock extension bounds that don't require VM access. + // The split depth extension is always clockExtension * 2. uint256 splitDepthExtension = uint256(_params.clockExtension.raw()) * 2; - uint256 maxGameDepthExtension = - uint256(_params.clockExtension.raw()) + uint256(_params.vm.oracle().challengePeriod()); - uint256 maxClockExtension = Math.max(splitDepthExtension, maxGameDepthExtension); - // The maximum clock extension must fit into a uint64. - if (maxClockExtension > type(uint64).max) revert InvalidClockExtension(); - - // The maximum clock extension may not be greater than the maximum clock duration. - if (uint64(maxClockExtension) > _params.maxClockDuration.raw()) revert InvalidClockExtension(); + // The split depth extension must fit into a uint64. + if (splitDepthExtension > type(uint64).max) revert InvalidClockExtension(); - // Block type(uint32).max from being used as a game type so that it can be used in the - // OptimismPortal respected game type trick. - if (_params.gameType.raw() == type(uint32).max) revert ReservedGameType(); + // The split depth extension may not be greater than the maximum clock duration. + if (uint64(splitDepthExtension) > _params.maxClockDuration.raw()) revert InvalidClockExtension(); // Set up initial game state. - GAME_TYPE = _params.gameType; - ABSOLUTE_PRESTATE = _params.absolutePrestate; MAX_GAME_DEPTH = _params.maxGameDepth; SPLIT_DEPTH = _params.splitDepth; CLOCK_EXTENSION = _params.clockExtension; MAX_CLOCK_DURATION = _params.maxClockDuration; - VM = _params.vm; - WETH = _params.weth; - ANCHOR_STATE_REGISTRY = _params.anchorStateRegistry; - L2_CHAIN_ID = _params.l2ChainId; } /// @notice Initializes the contract. @@ -299,8 +254,15 @@ contract FaultDisputeGame is Clone, ISemver { // INVARIANT: The game must not have already been initialized. if (initialized) revert AlreadyInitialized(); + // Revert if the calldata size is not the expected length. + // + // This is to prevent adding extra or omitting bytes from to `extraData` that result in a different game UUID + // in the factory, but are not used by the game, which would allow for multiple dispute games for the same + // output proposal to be created. + if (msg.data.length != expectedInitCallDataLength()) revert BadExtraData(); + // Grab the latest anchor root. - (Hash root, uint256 rootBlockNumber) = ANCHOR_STATE_REGISTRY.getAnchorRoot(); + (Hash root, uint256 rootBlockNumber) = anchorStateRegistry().getAnchorRoot(); // Should only happen if this is a new game type that hasn't been set up yet. if (root.raw() == bytes32(0)) revert AnchorRootNotFound(); @@ -308,25 +270,26 @@ contract FaultDisputeGame is Clone, ISemver { // Set the starting proposal. startingOutputRoot = Proposal({ l2SequenceNumber: rootBlockNumber, root: root }); - // Revert if the calldata size is not the expected length. - // - // This is to prevent adding extra or omitting bytes from to `extraData` that result in a different game UUID - // in the factory, but are not used by the game, which would allow for multiple dispute games for the same - // output proposal to be created. - // - // Expected length: 122 bytes - // - 4 bytes selector - // - 20 bytes creator address - // - 32 bytes root claim - // - 32 bytes l1 head - // - 32 bytes extraData - // - 2 bytes CWIA length - if (msg.data.length != 122) revert BadExtraData(); - // Do not allow the game to be initialized if the root claim corresponds to a block at or before the // configured starting block number. if (l2BlockNumber() <= rootBlockNumber) revert UnexpectedRootClaim(rootClaim()); + // Validate parameters that require access to the VM. + // The PreimageOracle challenge period must fit into uint64 so we can safely use it here. + if (vm().oracle().challengePeriod() > type(uint64).max) revert InvalidChallengePeriod(); + + // Determine the maximum clock extension which is either the split depth extension or the + // maximum game depth extension depending on the configuration of these contracts. + uint256 splitDepthExtension = uint256(CLOCK_EXTENSION.raw()) * 2; + uint256 maxGameDepthExtension = uint256(CLOCK_EXTENSION.raw()) + uint64(vm().oracle().challengePeriod()); + uint256 maxClockExtension = Math.max(splitDepthExtension, maxGameDepthExtension); + + // The maximum clock extension must fit into a uint64. + if (maxClockExtension > type(uint64).max) revert InvalidClockExtension(); + + // The maximum clock extension may not be greater than the maximum clock duration. + if (uint64(maxClockExtension) > MAX_CLOCK_DURATION.raw()) revert InvalidClockExtension(); + // Set the root claim claimData.push( ClaimData({ @@ -345,14 +308,39 @@ contract FaultDisputeGame is Clone, ISemver { // Deposit the bond. refundModeCredit[gameCreator()] += msg.value; - WETH.deposit{ value: msg.value }(); + weth().deposit{ value: msg.value }(); // Set the game's starting timestamp createdAt = Timestamp.wrap(uint64(block.timestamp)); // Set whether the game type was respected when the game was created. wasRespectedGameTypeWhenCreated = - GameType.unwrap(ANCHOR_STATE_REGISTRY.respectedGameType()) == GameType.unwrap(GAME_TYPE); + GameType.unwrap(anchorStateRegistry().respectedGameType()) == GameType.unwrap(gameType()); + } + + /// @notice Returns the expected calldata length for the initialize method + function expectedInitCallDataLength() internal pure returns (uint256) { + // Expected length: 6 bytes + immutable args byte count + // - 4 bytes: selector + // - 2 bytes: CWIA length prefix + // - n bytes: Immutable args data + return 6 + immutableArgsByteCount(); + } + + /// @notice Returns the byte count of the immutable args for this contract. + function immutableArgsByteCount() internal pure virtual returns (uint256) { + // Expected length: 244 bytes + // - 20 bytes: creator address + // - 32 bytes: root claim + // - 32 bytes: l1 head + // - 4 bytes: game type + // - 32 bytes: extraData + // - 32 bytes: absolutePrestate + // - 20 bytes: vm address + // - 20 bytes: anchorStateRegistry address + // - 20 bytes: weth address + // - 32 bytes: l2ChainId + return 244; } //////////////////////////////////////////////////////////////// @@ -406,7 +394,7 @@ contract FaultDisputeGame is Clone, ISemver { // which is the number of leaves in each execution trace subgame. This is so that we can // determine whether or not the step position is represents the `ABSOLUTE_PRESTATE`. preStateClaim = (stepPos.indexAtDepth() % (1 << (MAX_GAME_DEPTH - SPLIT_DEPTH))) == 0 - ? ABSOLUTE_PRESTATE + ? absolutePrestate() : _findTraceAncestor(Position.wrap(parentPos.raw() - 1), parent.parentIndex, false).claim; // For all attacks, the poststate is the parent claim. postState = parent; @@ -438,7 +426,7 @@ contract FaultDisputeGame is Clone, ISemver { // SAFETY: While the `attack` path does not need an extra check for the post // state's depth in relation to the parent, we don't need another // branch because (n - n) % 2 == 0. - bool validStep = VM.step(_stateData, _proof, uuid.raw()) == postState.claim.raw(); + bool validStep = vm().step(_stateData, _proof, uuid.raw()) == postState.claim.raw(); bool parentPostAgree = (parentPos.depth() - postState.position.depth()) % 2 == 0; if (parentPostAgree == validStep) revert ValidStep(); @@ -516,7 +504,7 @@ contract FaultDisputeGame is Clone, ISemver { // If the next position is `MAX_GAME_DEPTH - 1` then we're about to execute a step. Our // clock extension must therefore account for the LPP challenge period in addition to // the standard clock extension. - actualExtension = CLOCK_EXTENSION.raw() + uint64(VM.oracle().challengePeriod()); + actualExtension = CLOCK_EXTENSION.raw() + uint64(vm().oracle().challengePeriod()); } else if (nextPositionDepth == SPLIT_DEPTH - 1) { // If the next position is `SPLIT_DEPTH - 1` then we're about to begin an execution // trace bisection and we need to give extra time for the off-chain challenge agent to @@ -561,7 +549,7 @@ contract FaultDisputeGame is Clone, ISemver { // Deposit the bond. refundModeCredit[msg.sender] += msg.value; - WETH.deposit{ value: msg.value }(); + weth().deposit{ value: msg.value }(); // Emit the appropriate event for the attack or defense. emit Move(_challengeIndex, _claim, msg.sender); @@ -597,7 +585,7 @@ contract FaultDisputeGame is Clone, ISemver { _findStartingAndDisputedOutputs(_execLeafIdx); Hash uuid = _computeLocalContext(starting, startingPos, disputed, disputedPos); - IPreimageOracle oracle = VM.oracle(); + IPreimageOracle oracle = vm().oracle(); if (_ident == LocalPreimageKey.L1_HEAD_HASH) { // Load the L1 head hash oracle.loadLocalData(_ident, uuid.raw(), l1Head().raw(), 32, _partOffset); @@ -621,7 +609,7 @@ contract FaultDisputeGame is Clone, ISemver { oracle.loadLocalData(_ident, uuid.raw(), bytes32(l2Number << 0xC0), 8, _partOffset); } else if (_ident == LocalPreimageKey.CHAIN_ID) { // Load the chain ID as a big-endian uint64 in the high order 8 bytes of the word. - oracle.loadLocalData(_ident, uuid.raw(), bytes32(L2_CHAIN_ID << 0xC0), 8, _partOffset); + oracle.loadLocalData(_ident, uuid.raw(), bytes32(l2ChainId() << 0xC0), 8, _partOffset); } else { revert InvalidLocalIdent(); } @@ -641,7 +629,7 @@ contract FaultDisputeGame is Clone, ISemver { /// @notice The l2BlockNumber of the disputed output root in the `L2OutputOracle`. function l2BlockNumber() public pure returns (uint256 l2BlockNumber_) { - l2BlockNumber_ = _getArgUint256(84); + l2BlockNumber_ = _getArgUint256(88); } /// @notice The l2SequenceNumber of the disputed output root in the `L2OutputOracle` (in this case - block number). @@ -844,14 +832,6 @@ contract FaultDisputeGame is Clone, ISemver { } } - /// @notice Getter for the game type. - /// @dev The reference impl should be entirely different depending on the type (fault, validity) - /// i.e. The game type should indicate the security model. - /// @return gameType_ The type of proof system being used. - function gameType() public view returns (GameType gameType_) { - gameType_ = GAME_TYPE; - } - /// @notice Getter for the creator of the dispute game. /// @dev `clones-with-immutable-args` argument #1 /// @return creator_ The creator of the dispute game. @@ -869,8 +849,8 @@ contract FaultDisputeGame is Clone, ISemver { /// @notice Getter for the root claim for a given L2 chain ID. /// @param _chainId The L2 chain ID to get the root claim for. /// @return rootClaim_ The root claim of the DisputeGame. - function rootClaimByChainId(uint256 _chainId) public view returns (Claim rootClaim_) { - if (_chainId != L2_CHAIN_ID) revert UnknownChainId(); + function rootClaimByChainId(uint256 _chainId) public pure returns (Claim rootClaim_) { + if (_chainId != l2ChainId()) revert UnknownChainId(); rootClaim_ = rootClaim(); } @@ -881,13 +861,55 @@ contract FaultDisputeGame is Clone, ISemver { l1Head_ = Hash.wrap(_getArgBytes32(52)); } - /// @notice Getter for the extra data. + /// @notice Getter for the game type. /// @dev `clones-with-immutable-args` argument #4 + /// @return gameType_ The type of proof system being used. + function gameType() public pure returns (GameType gameType_) { + gameType_ = GameType.wrap(_getArgUint32(84)); + } + + /// @notice Getter for the extra data. + /// @dev `clones-with-immutable-args` argument #5 /// @return extraData_ Any extra data supplied to the dispute game contract by the creator. function extraData() public pure returns (bytes memory extraData_) { // The extra data starts at the second word within the cwia calldata and // is 32 bytes long. - extraData_ = _getArgBytes(84, 32); + extraData_ = _getArgBytes(88, 32); + } + + /// @notice Getter for the absolute prestate of the instruction trace. + /// @dev `clones-with-immutable-args` argument #6 + /// @return absolutePrestate_ The absolute prestate of the instruction trace. + function absolutePrestate() public pure returns (Claim absolutePrestate_) { + absolutePrestate_ = Claim.wrap(_getArgBytes32(120)); + } + + /// @notice Getter for the VM implementation. + /// @dev `clones-with-immutable-args` argument #7 + /// @return vm_ The onchain VM implementation address. + function vm() public pure returns (IBigStepper vm_) { + vm_ = IBigStepper(_getArgAddress(152)); + } + + /// @notice Getter for the anchor state registry. + /// @dev `clones-with-immutable-args` argument #8 + /// @return registry_ The anchor state registry contract address. + function anchorStateRegistry() public pure returns (IAnchorStateRegistry registry_) { + registry_ = IAnchorStateRegistry(_getArgAddress(172)); + } + + /// @notice Getter for the WETH contract. + /// @dev `clones-with-immutable-args` argument #9 + /// @return weth_ The WETH contract for holding ETH. + function weth() public pure returns (IDelayedWETH weth_) { + weth_ = IDelayedWETH(payable(_getArgAddress(192))); + } + + /// @notice Getter for the L2 chain ID. + /// @dev `clones-with-immutable-args` argument #10 + /// @return l2ChainId_ The L2 chain ID. + function l2ChainId() public pure returns (uint256 l2ChainId_) { + l2ChainId_ = _getArgUint256(212); } /// @notice A compliant implementation of this interface should return the components of the @@ -897,7 +919,7 @@ contract FaultDisputeGame is Clone, ISemver { /// @return gameType_ The type of proof system being used. /// @return rootClaim_ The root claim of the DisputeGame. /// @return extraData_ Any extra data supplied to the dispute game contract by the creator. - function gameData() external view returns (GameType gameType_, Claim rootClaim_, bytes memory extraData_) { + function gameData() external pure returns (GameType gameType_, Claim rootClaim_, bytes memory extraData_) { gameType_ = gameType(); rootClaim_ = rootClaim(); extraData_ = extraData(); @@ -979,7 +1001,7 @@ contract FaultDisputeGame is Clone, ISemver { // credit, we unlock it and return early. if (!hasUnlockedCredit[_recipient]) { hasUnlockedCredit[_recipient] = true; - WETH.unlock(_recipient, recipientCredit); + weth().unlock(_recipient, recipientCredit); return; } @@ -991,7 +1013,7 @@ contract FaultDisputeGame is Clone, ISemver { normalModeCredit[_recipient] = 0; // Try to withdraw the WETH amount so it can be used here. - WETH.withdraw(_recipient, recipientCredit); + weth().withdraw(_recipient, recipientCredit); // Transfer the credit to the recipient. (bool success,) = _recipient.call{ value: recipientCredit }(hex""); @@ -1017,7 +1039,7 @@ contract FaultDisputeGame is Clone, ISemver { // system is paused, the game will only go into refund mode if it ends up being explicitly // invalidated in the AnchorStateRegistry. If the game has already been closed and a refund // mode has been selected, we'll already have returned and we won't hit this revert. - if (ANCHOR_STATE_REGISTRY.paused()) { + if (anchorStateRegistry().paused()) { revert GamePaused(); } @@ -1028,7 +1050,7 @@ contract FaultDisputeGame is Clone, ISemver { } // Game must be finalized according to the AnchorStateRegistry. - bool finalized = ANCHOR_STATE_REGISTRY.isGameFinalized(IDisputeGame(address(this))); + bool finalized = anchorStateRegistry().isGameFinalized(IDisputeGame(address(this))); if (!finalized) { revert GameNotFinalized(); } @@ -1036,10 +1058,10 @@ contract FaultDisputeGame is Clone, ISemver { // Try to update the anchor game first. Won't always succeed because delays can lead // to situations in which this game might not be eligible to be a new anchor game. // eip150-safe - try ANCHOR_STATE_REGISTRY.setAnchorState(IDisputeGame(address(this))) { } catch { } + try anchorStateRegistry().setAnchorState(IDisputeGame(address(this))) { } catch { } // Check if the game is a proper game, which will determine the bond distribution mode. - bool properGame = ANCHOR_STATE_REGISTRY.isGameProper(IDisputeGame(address(this))); + bool properGame = anchorStateRegistry().isGameProper(IDisputeGame(address(this))); // If the game is a proper game, the bonds should be distributed normally. Otherwise, go // into refund mode and distribute bonds back to their original depositors. @@ -1099,11 +1121,6 @@ contract FaultDisputeGame is Clone, ISemver { // IMMUTABLE GETTERS // //////////////////////////////////////////////////////////////// - /// @notice Returns the absolute prestate of the instruction trace. - function absolutePrestate() external view returns (Claim absolutePrestate_) { - absolutePrestate_ = ABSOLUTE_PRESTATE; - } - /// @notice Returns the max game depth. function maxGameDepth() external view returns (uint256 maxGameDepth_) { maxGameDepth_ = MAX_GAME_DEPTH; @@ -1124,26 +1141,6 @@ contract FaultDisputeGame is Clone, ISemver { clockExtension_ = CLOCK_EXTENSION; } - /// @notice Returns the address of the VM. - function vm() external view returns (IBigStepper vm_) { - vm_ = VM; - } - - /// @notice Returns the WETH contract for holding ETH. - function weth() external view returns (IDelayedWETH weth_) { - weth_ = WETH; - } - - /// @notice Returns the anchor state registry contract. - function anchorStateRegistry() external view returns (IAnchorStateRegistry registry_) { - registry_ = ANCHOR_STATE_REGISTRY; - } - - /// @notice Returns the chain ID of the L2 network this contract argues about. - function l2ChainId() external view returns (uint256 l2ChainId_) { - l2ChainId_ = L2_CHAIN_ID; - } - //////////////////////////////////////////////////////////////// // HELPERS // //////////////////////////////////////////////////////////////// diff --git a/packages/contracts-bedrock/src/dispute/PermissionedDisputeGame.sol b/packages/contracts-bedrock/src/dispute/PermissionedDisputeGame.sol index 5dc45e46a3d..56df510bb49 100644 --- a/packages/contracts-bedrock/src/dispute/PermissionedDisputeGame.sol +++ b/packages/contracts-bedrock/src/dispute/PermissionedDisputeGame.sol @@ -17,39 +17,22 @@ import { BadAuth } from "src/dispute/lib/Errors.sol"; /// costs that certain networks may not wish to support. This contract can also be used as a fallback mechanism /// in case of a failure in the permissionless fault proof system in the stage one release. contract PermissionedDisputeGame is FaultDisputeGame { - /// @notice The proposer role is allowed to create proposals and participate in the dispute game. - address internal immutable PROPOSER; - - /// @notice The challenger role is allowed to participate in the dispute game. - address internal immutable CHALLENGER; - /// @notice Modifier that gates access to the `challenger` and `proposer` roles. modifier onlyAuthorized() { - if (!(msg.sender == PROPOSER || msg.sender == CHALLENGER)) { + if (!(msg.sender == proposer() || msg.sender == challenger())) { revert BadAuth(); } _; } /// @notice Semantic version. - /// @custom:semver 1.9.0 + /// @custom:semver 2.3.0 function version() public pure override returns (string memory) { - return "1.9.0"; + return "2.3.0"; } /// @param _params Parameters for creating a new FaultDisputeGame. - /// @param _proposer Address that is allowed to create instances of this contract. - /// @param _challenger Address that is allowed to challenge instances of this contract. - constructor( - GameConstructorParams memory _params, - address _proposer, - address _challenger - ) - FaultDisputeGame(_params) - { - PROPOSER = _proposer; - CHALLENGER = _challenger; - } + constructor(GameConstructorParams memory _params) FaultDisputeGame(_params) { } /// @inheritdoc FaultDisputeGame function step( @@ -86,24 +69,31 @@ contract PermissionedDisputeGame is FaultDisputeGame { /// @notice Initializes the contract. function initialize() public payable override { + super.initialize(); + // The creator of the dispute game must be the proposer EOA. - if (tx.origin != PROPOSER) revert BadAuth(); + if (tx.origin != proposer()) revert BadAuth(); + } - // Fallthrough initialization. - super.initialize(); + function immutableArgsByteCount() internal pure override returns (uint256) { + // Extend expected data length to account for proposer and challenger addresses + // - 20 bytes: proposer address + // - 20 bytes: challenger address + return super.immutableArgsByteCount() + 40; } //////////////////////////////////////////////////////////////// // IMMUTABLE GETTERS // //////////////////////////////////////////////////////////////// - /// @notice Returns the proposer address. - function proposer() external view returns (address proposer_) { - proposer_ = PROPOSER; + /// @notice Returns the proposer address. The proposer role is allowed to create proposals and participate in the + /// dispute game. + function proposer() public pure returns (address proposer_) { + proposer_ = _getArgAddress(super.immutableArgsByteCount()); } - /// @notice Returns the challenger address. - function challenger() external view returns (address challenger_) { - challenger_ = CHALLENGER; + /// @notice Returns the challenger address. The challenger role is allowed to participate in the dispute game. + function challenger() public pure returns (address challenger_) { + challenger_ = _getArgAddress(super.immutableArgsByteCount() + 20); } } diff --git a/packages/contracts-bedrock/src/dispute/v2/FaultDisputeGameV2.sol b/packages/contracts-bedrock/src/dispute/v2/FaultDisputeGameV2.sol deleted file mode 100644 index 1072a12458c..00000000000 --- a/packages/contracts-bedrock/src/dispute/v2/FaultDisputeGameV2.sol +++ /dev/null @@ -1,1318 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -// Libraries -import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; -import { FixedPointMathLib } from "@solady/utils/FixedPointMathLib.sol"; -import { Clone } from "@solady/utils/Clone.sol"; -import { Types } from "src/libraries/Types.sol"; -import { Hashing } from "src/libraries/Hashing.sol"; -import { RLPReader } from "src/libraries/rlp/RLPReader.sol"; -import { - GameStatus, - GameType, - BondDistributionMode, - Claim, - Clock, - Duration, - Timestamp, - Hash, - Proposal, - LibClock, - LocalPreimageKey, - VMStatuses -} from "src/dispute/lib/Types.sol"; -import { Position, LibPosition } from "src/dispute/lib/LibPosition.sol"; -import { - InvalidParent, - ClaimAlreadyExists, - ClaimAlreadyResolved, - OutOfOrderResolution, - InvalidChallengePeriod, - InvalidSplitDepth, - InvalidClockExtension, - MaxDepthTooLarge, - AnchorRootNotFound, - AlreadyInitialized, - UnexpectedRootClaim, - GameNotInProgress, - InvalidPrestate, - ValidStep, - GameDepthExceeded, - L2BlockNumberChallenged, - InvalidDisputedClaimIndex, - ClockTimeExceeded, - DuplicateStep, - CannotDefendRootClaim, - IncorrectBondAmount, - InvalidLocalIdent, - BlockNumberMatches, - InvalidHeaderRLP, - ClockNotExpired, - BondTransferFailed, - NoCreditToClaim, - InvalidOutputRootProof, - ClaimAboveSplit, - GameNotFinalized, - InvalidBondDistributionMode, - GameNotResolved, - GamePaused, - BadExtraData, - UnknownChainId -} from "src/dispute/lib/Errors.sol"; - -// Interfaces -import { ISemver } from "interfaces/universal/ISemver.sol"; -import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; -import { IBigStepper, IPreimageOracle } from "interfaces/dispute/IBigStepper.sol"; -import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; -import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; - -/// @title FaultDisputeGameV2 -/// @notice An implementation of the `IFaultDisputeGame` interface. -contract FaultDisputeGameV2 is Clone, ISemver { - //////////////////////////////////////////////////////////////// - // Structs // - //////////////////////////////////////////////////////////////// - - /// @notice The `ClaimData` struct represents the data associated with a Claim. - struct ClaimData { - uint32 parentIndex; - address counteredBy; - address claimant; - uint128 bond; - Claim claim; - Position position; - Clock clock; - } - - /// @notice The `ResolutionCheckpoint` struct represents the data associated with an in-progress claim resolution. - struct ResolutionCheckpoint { - bool initialCheckpointComplete; - uint32 subgameIndex; - Position leftmostPosition; - address counteredBy; - } - - /// @notice Parameters for creating a new FaultDisputeGame. We place this into a struct to - /// avoid stack-too-deep errors when compiling without the optimizer enabled. - struct GameConstructorParams { - uint256 maxGameDepth; - uint256 splitDepth; - Duration clockExtension; - Duration maxClockDuration; - } - - //////////////////////////////////////////////////////////////// - // Events // - //////////////////////////////////////////////////////////////// - - /// @notice Emitted when the game is resolved. - /// @param status The status of the game after resolution. - event Resolved(GameStatus indexed status); - - /// @notice Emitted when a new claim is added to the DAG by `claimant` - /// @param parentIndex The index within the `claimData` array of the parent claim - /// @param claim The claim being added - /// @param claimant The address of the claimant - event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant); - - /// @notice Emitted when the game is closed. - event GameClosed(BondDistributionMode bondDistributionMode); - - //////////////////////////////////////////////////////////////// - // State Vars // - //////////////////////////////////////////////////////////////// - - /// @notice The max depth of the game. - uint256 internal immutable MAX_GAME_DEPTH; - - /// @notice The max depth of the output bisection portion of the position tree. Immediately beneath - /// this depth, execution trace bisection begins. - uint256 internal immutable SPLIT_DEPTH; - - /// @notice The maximum duration that may accumulate on a team's chess clock before they may no longer respond. - Duration internal immutable MAX_CLOCK_DURATION; - - /// @notice The duration of the clock extension. Will be doubled if the grandchild is the root claim of an execution - /// trace bisection subgame. - Duration internal immutable CLOCK_EXTENSION; - - /// @notice The global root claim's position is always at gindex 1. - Position internal constant ROOT_POSITION = Position.wrap(1); - - /// @notice The index of the block number in the RLP-encoded block header. - /// @dev Consensus encoding reference: - /// https://github.com/paradigmxyz/reth/blob/5f82993c23164ce8ccdc7bf3ae5085205383a5c8/crates/primitives/src/header.rs#L368 - uint256 internal constant HEADER_BLOCK_NUMBER_INDEX = 8; - - /// @notice Semantic version. - /// @custom:semver 2.3.0 - function version() public pure virtual returns (string memory) { - return "2.3.0"; - } - - /// @notice The starting timestamp of the game - Timestamp public createdAt; - - /// @notice The timestamp of the game's global resolution. - Timestamp public resolvedAt; - - /// @notice Returns the current status of the game. - GameStatus public status; - - /// @notice Flag for the `initialize` function to prevent re-initialization. - bool internal initialized; - - /// @notice Flag for whether or not the L2 block number claim has been invalidated via `challengeRootL2Block`. - bool public l2BlockNumberChallenged; - - /// @notice The challenger of the L2 block number claim. Should always be `address(0)` if `l2BlockNumberChallenged` - /// is `false`. Should be the address of the challenger if `l2BlockNumberChallenged` is `true`. - address public l2BlockNumberChallenger; - - /// @notice An append-only array of all claims made during the dispute game. - ClaimData[] public claimData; - - /// @notice Credited balances for winning participants. - mapping(address => uint256) public normalModeCredit; - - /// @notice A mapping to allow for constant-time lookups of existing claims. - mapping(Hash => bool) public claims; - - /// @notice A mapping of subgames rooted at a claim index to other claim indices in the subgame. - mapping(uint256 => uint256[]) public subgames; - - /// @notice A mapping of resolved subgames rooted at a claim index. - mapping(uint256 => bool) public resolvedSubgames; - - /// @notice A mapping of claim indices to resolution checkpoints. - mapping(uint256 => ResolutionCheckpoint) public resolutionCheckpoints; - - /// @notice The latest finalized output root, serving as the anchor for output bisection. - Proposal public startingOutputRoot; - - /// @notice A boolean for whether or not the game type was respected when the game was created. - bool public wasRespectedGameTypeWhenCreated; - - /// @notice A mapping of each claimant's refund mode credit. - mapping(address => uint256) public refundModeCredit; - - /// @notice A mapping of whether a claimant has unlocked their credit. - mapping(address => bool) public hasUnlockedCredit; - - /// @notice The bond distribution mode of the game. - BondDistributionMode public bondDistributionMode; - - /// @param _params Parameters for creating a new FaultDisputeGame. - constructor(GameConstructorParams memory _params) { - // The max game depth may not be greater than `LibPosition.MAX_POSITION_BITLEN - 1`. - if (_params.maxGameDepth > LibPosition.MAX_POSITION_BITLEN - 1) revert MaxDepthTooLarge(); - - // The split depth plus one cannot be greater than or equal to the max game depth. We add - // an additional depth to the split depth to avoid a bug in trace ancestor lookup. We know - // that the case where the split depth is the max value for uint256 is equivalent to the - // second check though we do need to check it explicitly to avoid an overflow. - if (_params.splitDepth == type(uint256).max || _params.splitDepth + 1 >= _params.maxGameDepth) { - revert InvalidSplitDepth(); - } - - // The split depth cannot be 0 or 1 to stay in bounds of clock extension arithmetic. - if (_params.splitDepth < 2) revert InvalidSplitDepth(); - - // Validate clock extension bounds that don't require VM access. - // The split depth extension is always clockExtension * 2. - uint256 splitDepthExtension = uint256(_params.clockExtension.raw()) * 2; - - // The split depth extension must fit into a uint64. - if (splitDepthExtension > type(uint64).max) revert InvalidClockExtension(); - - // The split depth extension may not be greater than the maximum clock duration. - if (uint64(splitDepthExtension) > _params.maxClockDuration.raw()) revert InvalidClockExtension(); - - // Set up initial game state. - MAX_GAME_DEPTH = _params.maxGameDepth; - SPLIT_DEPTH = _params.splitDepth; - CLOCK_EXTENSION = _params.clockExtension; - MAX_CLOCK_DURATION = _params.maxClockDuration; - } - - /// @notice Initializes the contract. - /// @dev This function may only be called once. - function initialize() public payable virtual { - // SAFETY: Any revert in this function will bubble up to the DisputeGameFactory and - // prevent the game from being created. - // - // Implicit assumptions: - // - The `gameStatus` state variable defaults to 0, which is `GameStatus.IN_PROGRESS` - // - The dispute game factory will enforce the required bond to initialize the game. - // - // Explicit checks: - // - The game must not have already been initialized. - // - An output root cannot be proposed at or before the starting block number. - - // INVARIANT: The game must not have already been initialized. - if (initialized) revert AlreadyInitialized(); - - // Revert if the calldata size is not the expected length. - // - // This is to prevent adding extra or omitting bytes from to `extraData` that result in a different game UUID - // in the factory, but are not used by the game, which would allow for multiple dispute games for the same - // output proposal to be created. - if (msg.data.length != expectedInitCallDataLength()) revert BadExtraData(); - - // Grab the latest anchor root. - (Hash root, uint256 rootBlockNumber) = anchorStateRegistry().getAnchorRoot(); - - // Should only happen if this is a new game type that hasn't been set up yet. - if (root.raw() == bytes32(0)) revert AnchorRootNotFound(); - - // Set the starting proposal. - startingOutputRoot = Proposal({ l2SequenceNumber: rootBlockNumber, root: root }); - - // Do not allow the game to be initialized if the root claim corresponds to a block at or before the - // configured starting block number. - if (l2BlockNumber() <= rootBlockNumber) revert UnexpectedRootClaim(rootClaim()); - - // Validate parameters that require access to the VM. - // The PreimageOracle challenge period must fit into uint64 so we can safely use it here. - if (vm().oracle().challengePeriod() > type(uint64).max) revert InvalidChallengePeriod(); - - // Determine the maximum clock extension which is either the split depth extension or the - // maximum game depth extension depending on the configuration of these contracts. - uint256 splitDepthExtension = uint256(CLOCK_EXTENSION.raw()) * 2; - uint256 maxGameDepthExtension = uint256(CLOCK_EXTENSION.raw()) + uint64(vm().oracle().challengePeriod()); - uint256 maxClockExtension = Math.max(splitDepthExtension, maxGameDepthExtension); - - // The maximum clock extension must fit into a uint64. - if (maxClockExtension > type(uint64).max) revert InvalidClockExtension(); - - // The maximum clock extension may not be greater than the maximum clock duration. - if (uint64(maxClockExtension) > MAX_CLOCK_DURATION.raw()) revert InvalidClockExtension(); - - // Set the root claim - claimData.push( - ClaimData({ - parentIndex: type(uint32).max, - counteredBy: address(0), - claimant: gameCreator(), - bond: uint128(msg.value), - claim: rootClaim(), - position: ROOT_POSITION, - clock: LibClock.wrap(Duration.wrap(0), Timestamp.wrap(uint64(block.timestamp))) - }) - ); - - // Set the game as initialized. - initialized = true; - - // Deposit the bond. - refundModeCredit[gameCreator()] += msg.value; - weth().deposit{ value: msg.value }(); - - // Set the game's starting timestamp - createdAt = Timestamp.wrap(uint64(block.timestamp)); - - // Set whether the game type was respected when the game was created. - wasRespectedGameTypeWhenCreated = - GameType.unwrap(anchorStateRegistry().respectedGameType()) == GameType.unwrap(gameType()); - } - - /// @notice Returns the expected calldata length for the initialize method - function expectedInitCallDataLength() internal pure returns (uint256) { - // Expected length: 6 bytes + immutable args byte count - // - 4 bytes: selector - // - 2 bytes: CWIA length prefix - // - n bytes: Immutable args data - return 6 + immutableArgsByteCount(); - } - - /// @notice Returns the byte count of the immutable args for this contract. - function immutableArgsByteCount() internal pure virtual returns (uint256) { - // Expected length: 240 bytes - // - 20 bytes: creator address - // - 32 bytes: root claim - // - 32 bytes: l1 head - // - 4 bytes: game type - // - 32 bytes: extraData - // - 32 bytes: absolutePrestate - // - 20 bytes: vm address - // - 20 bytes: anchorStateRegistry address - // - 20 bytes: weth address - // - 32 bytes: l2ChainId - return 244; - } - - //////////////////////////////////////////////////////////////// - // `IFaultDisputeGame` impl // - //////////////////////////////////////////////////////////////// - - /// @notice Perform an instruction step via an on-chain fault proof processor. - /// @dev This function should point to a fault proof processor in order to execute - /// a step in the fault proof program on-chain. The interface of the fault proof - /// processor contract should adhere to the `IBigStepper` interface. - /// @param _claimIndex The index of the challenged claim within `claimData`. - /// @param _isAttack Whether or not the step is an attack or a defense. - /// @param _stateData The stateData of the step is the preimage of the claim at the given - /// prestate, which is at `_stateIndex` if the move is an attack and `_claimIndex` if - /// the move is a defense. If the step is an attack on the first instruction, it is - /// the absolute prestate of the fault proof VM. - /// @param _proof Proof to access memory nodes in the VM's merkle state tree. - function step( - uint256 _claimIndex, - bool _isAttack, - bytes calldata _stateData, - bytes calldata _proof - ) - public - virtual - { - // INVARIANT: Steps cannot be made unless the game is currently in progress. - if (status != GameStatus.IN_PROGRESS) revert GameNotInProgress(); - - // Get the parent. If it does not exist, the call will revert with OOB. - ClaimData storage parent = claimData[_claimIndex]; - - // Pull the parent position out of storage. - Position parentPos = parent.position; - // Determine the position of the step. - Position stepPos = parentPos.move(_isAttack); - - // INVARIANT: A step cannot be made unless the move position is 1 below the `MAX_GAME_DEPTH` - if (stepPos.depth() != MAX_GAME_DEPTH + 1) revert InvalidParent(); - - // Determine the expected pre & post states of the step. - Claim preStateClaim; - ClaimData storage postState; - if (_isAttack) { - // If the step position's index at depth is 0, the prestate is the absolute - // prestate. - // If the step is an attack at a trace index > 0, the prestate exists elsewhere in - // the game state. - // NOTE: We localize the `indexAtDepth` for the current execution trace subgame by finding - // the remainder of the index at depth divided by 2 ** (MAX_GAME_DEPTH - SPLIT_DEPTH), - // which is the number of leaves in each execution trace subgame. This is so that we can - // determine whether or not the step position is represents the `ABSOLUTE_PRESTATE`. - preStateClaim = (stepPos.indexAtDepth() % (1 << (MAX_GAME_DEPTH - SPLIT_DEPTH))) == 0 - ? absolutePrestate() - : _findTraceAncestor(Position.wrap(parentPos.raw() - 1), parent.parentIndex, false).claim; - // For all attacks, the poststate is the parent claim. - postState = parent; - } else { - // If the step is a defense, the poststate exists elsewhere in the game state, - // and the parent claim is the expected pre-state. - preStateClaim = parent.claim; - postState = _findTraceAncestor(Position.wrap(parentPos.raw() + 1), parent.parentIndex, false); - } - - // INVARIANT: The prestate is always invalid if the passed `_stateData` is not the - // preimage of the prestate claim hash. - // We ignore the highest order byte of the digest because it is used to - // indicate the VM Status and is added after the digest is computed. - if (keccak256(_stateData) << 8 != preStateClaim.raw() << 8) revert InvalidPrestate(); - - // Compute the local preimage context for the step. - Hash uuid = _findLocalContext(_claimIndex); - - // INVARIANT: If a step is an attack, the poststate is valid if the step produces - // the same poststate hash as the parent claim's value. - // If a step is a defense: - // 1. If the parent claim and the found post state agree with each other - // (depth diff % 2 == 0), the step is valid if it produces the same - // state hash as the post state's claim. - // 2. If the parent claim and the found post state disagree with each other - // (depth diff % 2 != 0), the parent cannot be countered unless the step - // produces the same state hash as `postState.claim`. - // SAFETY: While the `attack` path does not need an extra check for the post - // state's depth in relation to the parent, we don't need another - // branch because (n - n) % 2 == 0. - bool validStep = vm().step(_stateData, _proof, uuid.raw()) == postState.claim.raw(); - bool parentPostAgree = (parentPos.depth() - postState.position.depth()) % 2 == 0; - if (parentPostAgree == validStep) revert ValidStep(); - - // INVARIANT: A step cannot be made against a claim for a second time. - if (parent.counteredBy != address(0)) revert DuplicateStep(); - - // Set the parent claim as countered. We do not need to append a new claim to the game; - // instead, we can just set the existing parent as countered. - parent.counteredBy = msg.sender; - } - - /// @notice Generic move function, used for both `attack` and `defend` moves. - /// @param _disputed The disputed `Claim`. - /// @param _challengeIndex The index of the claim being moved against. - /// @param _claim The claim at the next logical position in the game. - /// @param _isAttack Whether or not the move is an attack or defense. - function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) public payable virtual { - // INVARIANT: Moves cannot be made unless the game is currently in progress. - if (status != GameStatus.IN_PROGRESS) revert GameNotInProgress(); - - // Get the parent. If it does not exist, the call will revert with OOB. - ClaimData memory parent = claimData[_challengeIndex]; - - // INVARIANT: The claim at the _challengeIndex must be the disputed claim. - if (Claim.unwrap(parent.claim) != Claim.unwrap(_disputed)) revert InvalidDisputedClaimIndex(); - - // Compute the position that the claim commits to. Because the parent's position is already - // known, we can compute the next position by moving left or right depending on whether - // or not the move is an attack or defense. - Position parentPos = parent.position; - Position nextPosition = parentPos.move(_isAttack); - uint256 nextPositionDepth = nextPosition.depth(); - - // INVARIANT: A defense can never be made against the root claim of either the output root game or any - // of the execution trace bisection subgames. This is because the root claim commits to the - // entire state. Therefore, the only valid defense is to do nothing if it is agreed with. - if ((_challengeIndex == 0 || nextPositionDepth == SPLIT_DEPTH + 2) && !_isAttack) { - revert CannotDefendRootClaim(); - } - - // INVARIANT: No moves against the root claim can be made after it has been challenged with - // `challengeRootL2Block`.` - if (l2BlockNumberChallenged && _challengeIndex == 0) revert L2BlockNumberChallenged(); - - // INVARIANT: A move can never surpass the `MAX_GAME_DEPTH`. The only option to counter a - // claim at this depth is to perform a single instruction step on-chain via - // the `step` function to prove that the state transition produces an unexpected - // post-state. - if (nextPositionDepth > MAX_GAME_DEPTH) revert GameDepthExceeded(); - - // When the next position surpasses the split depth (i.e., it is the root claim of an execution - // trace bisection sub-game), we need to perform some extra verification steps. - if (nextPositionDepth == SPLIT_DEPTH + 1) { - _verifyExecBisectionRoot(_claim, _challengeIndex, parentPos, _isAttack); - } - - // INVARIANT: The `msg.value` must exactly equal the required bond. - if (getRequiredBond(nextPosition) != msg.value) revert IncorrectBondAmount(); - - // Compute the duration of the next clock. This is done by adding the duration of the - // grandparent claim to the difference between the current block timestamp and the - // parent's clock timestamp. - Duration nextDuration = getChallengerDuration(_challengeIndex); - - // INVARIANT: A move can never be made once its clock has exceeded `MAX_CLOCK_DURATION` - // seconds of time. - if (nextDuration.raw() == MAX_CLOCK_DURATION.raw()) revert ClockTimeExceeded(); - - // Clock extension is a mechanism that automatically extends the clock for a potential - // grandchild claim when there would be less than the clock extension time left if a player - // is forced to inherit another team's clock when countering a freeloader claim. Exact - // amount of clock extension time depends exactly where we are within the game. - uint64 actualExtension; - if (nextPositionDepth == MAX_GAME_DEPTH - 1) { - // If the next position is `MAX_GAME_DEPTH - 1` then we're about to execute a step. Our - // clock extension must therefore account for the LPP challenge period in addition to - // the standard clock extension. - actualExtension = CLOCK_EXTENSION.raw() + uint64(vm().oracle().challengePeriod()); - } else if (nextPositionDepth == SPLIT_DEPTH - 1) { - // If the next position is `SPLIT_DEPTH - 1` then we're about to begin an execution - // trace bisection and we need to give extra time for the off-chain challenge agent to - // be able to generate the initial instruction trace on the native FPVM. - actualExtension = CLOCK_EXTENSION.raw() * 2; - } else { - // Otherwise, we just use the standard clock extension. - actualExtension = CLOCK_EXTENSION.raw(); - } - - // Check if we need to apply the clock extension. - if (nextDuration.raw() > MAX_CLOCK_DURATION.raw() - actualExtension) { - nextDuration = Duration.wrap(MAX_CLOCK_DURATION.raw() - actualExtension); - } - - // Construct the next clock with the new duration and the current block timestamp. - Clock nextClock = LibClock.wrap(nextDuration, Timestamp.wrap(uint64(block.timestamp))); - - // INVARIANT: There cannot be multiple identical claims with identical moves on the same challengeIndex. Multiple - // claims at the same position may dispute the same challengeIndex. However, they must have different - // values. - Hash claimHash = _claim.hashClaimPos(nextPosition, _challengeIndex); - if (claims[claimHash]) revert ClaimAlreadyExists(); - claims[claimHash] = true; - - // Create the new claim. - claimData.push( - ClaimData({ - parentIndex: uint32(_challengeIndex), - // This is updated during subgame resolution - counteredBy: address(0), - claimant: msg.sender, - bond: uint128(msg.value), - claim: _claim, - position: nextPosition, - clock: nextClock - }) - ); - - // Update the subgame rooted at the parent claim. - subgames[_challengeIndex].push(claimData.length - 1); - - // Deposit the bond. - refundModeCredit[msg.sender] += msg.value; - weth().deposit{ value: msg.value }(); - - // Emit the appropriate event for the attack or defense. - emit Move(_challengeIndex, _claim, msg.sender); - } - - /// @notice Attack a disagreed upon `Claim`. - /// @param _disputed The `Claim` being attacked. - /// @param _parentIndex Index of the `Claim` to attack in the `claimData` array. This must match the `_disputed` - /// claim. - /// @param _claim The `Claim` at the relative attack position. - function attack(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable { - move(_disputed, _parentIndex, _claim, true); - } - - /// @notice Defend an agreed upon `Claim`. - /// @notice _disputed The `Claim` being defended. - /// @param _parentIndex Index of the claim to defend in the `claimData` array. This must match the `_disputed` - /// claim. - /// @param _claim The `Claim` at the relative defense position. - function defend(Claim _disputed, uint256 _parentIndex, Claim _claim) external payable { - move(_disputed, _parentIndex, _claim, false); - } - - /// @notice Posts the requested local data to the VM's `PreimageOralce`. - /// @param _ident The local identifier of the data to post. - /// @param _execLeafIdx The index of the leaf claim in an execution subgame that requires the local data for a step. - /// @param _partOffset The offset of the data to post. - function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) external { - // INVARIANT: Local data can only be added if the game is currently in progress. - if (status != GameStatus.IN_PROGRESS) revert GameNotInProgress(); - - (Claim starting, Position startingPos, Claim disputed, Position disputedPos) = - _findStartingAndDisputedOutputs(_execLeafIdx); - Hash uuid = _computeLocalContext(starting, startingPos, disputed, disputedPos); - - IPreimageOracle oracle = vm().oracle(); - if (_ident == LocalPreimageKey.L1_HEAD_HASH) { - // Load the L1 head hash - oracle.loadLocalData(_ident, uuid.raw(), l1Head().raw(), 32, _partOffset); - } else if (_ident == LocalPreimageKey.STARTING_OUTPUT_ROOT) { - // Load the starting proposal's output root. - oracle.loadLocalData(_ident, uuid.raw(), starting.raw(), 32, _partOffset); - } else if (_ident == LocalPreimageKey.DISPUTED_OUTPUT_ROOT) { - // Load the disputed proposal's output root - oracle.loadLocalData(_ident, uuid.raw(), disputed.raw(), 32, _partOffset); - } else if (_ident == LocalPreimageKey.DISPUTED_L2_BLOCK_NUMBER) { - // Load the disputed proposal's L2 block number as a big-endian uint64 in the - // high order 8 bytes of the word. - - // We add the index at depth + 1 to the starting block number to get the disputed L2 - // block number. - uint256 l2Number = startingOutputRoot.l2SequenceNumber + disputedPos.traceIndex(SPLIT_DEPTH) + 1; - - // Choose the minimum between the `l2BlockNumber` claim and the bisected-to L2 block number. - l2Number = l2Number < l2BlockNumber() ? l2Number : l2BlockNumber(); - - oracle.loadLocalData(_ident, uuid.raw(), bytes32(l2Number << 0xC0), 8, _partOffset); - } else if (_ident == LocalPreimageKey.CHAIN_ID) { - // Load the chain ID as a big-endian uint64 in the high order 8 bytes of the word. - oracle.loadLocalData(_ident, uuid.raw(), bytes32(l2ChainId() << 0xC0), 8, _partOffset); - } else { - revert InvalidLocalIdent(); - } - } - - /// @notice Returns the number of children that still need to be resolved in order to fully resolve a subgame rooted - /// at `_claimIndex`. - /// @param _claimIndex The subgame root claim's index within `claimData`. - /// @return numRemainingChildren_ The number of children that still need to be checked to resolve the subgame. - function getNumToResolve(uint256 _claimIndex) public view returns (uint256 numRemainingChildren_) { - ResolutionCheckpoint storage checkpoint = resolutionCheckpoints[_claimIndex]; - uint256[] storage challengeIndices = subgames[_claimIndex]; - uint256 challengeIndicesLen = challengeIndices.length; - - numRemainingChildren_ = challengeIndicesLen - checkpoint.subgameIndex; - } - - /// @notice The l2BlockNumber of the disputed output root in the `L2OutputOracle`. - function l2BlockNumber() public pure returns (uint256 l2BlockNumber_) { - l2BlockNumber_ = _getArgUint256(88); - } - - /// @notice The l2SequenceNumber of the disputed output root in the `L2OutputOracle` (in this case - block number). - function l2SequenceNumber() public pure returns (uint256 l2SequenceNumber_) { - l2SequenceNumber_ = l2BlockNumber(); - } - - /// @notice Only the starting block number of the game. - function startingBlockNumber() external view returns (uint256 startingBlockNumber_) { - startingBlockNumber_ = startingOutputRoot.l2SequenceNumber; - } - - /// @notice Starting output root and block number of the game. - function startingRootHash() external view returns (Hash startingRootHash_) { - startingRootHash_ = startingOutputRoot.root; - } - - /// @notice Challenges the root L2 block number by providing the preimage of the output root and the L2 block header - /// and showing that the committed L2 block number is incorrect relative to the claimed L2 block number. - /// @param _outputRootProof The output root proof. - /// @param _headerRLP The RLP-encoded L2 block header. - function challengeRootL2Block( - Types.OutputRootProof calldata _outputRootProof, - bytes calldata _headerRLP - ) - external - { - // INVARIANT: Moves cannot be made unless the game is currently in progress. - if (status != GameStatus.IN_PROGRESS) revert GameNotInProgress(); - - // The root L2 block claim can only be challenged once. - if (l2BlockNumberChallenged) revert L2BlockNumberChallenged(); - - // Verify the output root preimage. - if (Hashing.hashOutputRootProof(_outputRootProof) != rootClaim().raw()) revert InvalidOutputRootProof(); - - // Verify the block hash preimage. - if (keccak256(_headerRLP) != _outputRootProof.latestBlockhash) revert InvalidHeaderRLP(); - - // Decode the header RLP to find the number of the block. In the consensus encoding, the timestamp - // is the 9th element in the list that represents the block header. - RLPReader.RLPItem[] memory headerContents = RLPReader.readList(RLPReader.toRLPItem(_headerRLP)); - bytes memory rawBlockNumber = RLPReader.readBytes(headerContents[HEADER_BLOCK_NUMBER_INDEX]); - - // Sanity check the block number string length. - if (rawBlockNumber.length > 32) revert InvalidHeaderRLP(); - - // Convert the raw, left-aligned block number to a uint256 by aligning it as a big-endian - // number in the low-order bytes of a 32-byte word. - // - // SAFETY: The length of `rawBlockNumber` is checked above to ensure it is at most 32 bytes. - uint256 blockNumber; - assembly { - blockNumber := shr(shl(0x03, sub(0x20, mload(rawBlockNumber))), mload(add(rawBlockNumber, 0x20))) - } - - // Ensure the block number does not match the block number claimed in the dispute game. - if (blockNumber == l2BlockNumber()) revert BlockNumberMatches(); - - // Issue a special counter to the root claim. This counter will always win the root claim subgame, and receive - // the bond from the root claimant. - l2BlockNumberChallenger = msg.sender; - l2BlockNumberChallenged = true; - } - - //////////////////////////////////////////////////////////////// - // `IDisputeGame` impl // - //////////////////////////////////////////////////////////////// - - /// @notice If all necessary information has been gathered, this function should mark the game - /// status as either `CHALLENGER_WINS` or `DEFENDER_WINS` and return the status of - /// the resolved game. It is at this stage that the bonds should be awarded to the - /// necessary parties. - /// @dev May only be called if the `status` is `IN_PROGRESS`. - /// @return status_ The status of the game after resolution. - function resolve() external returns (GameStatus status_) { - // INVARIANT: Resolution cannot occur unless the game is currently in progress. - if (status != GameStatus.IN_PROGRESS) revert GameNotInProgress(); - - // INVARIANT: Resolution cannot occur unless the absolute root subgame has been resolved. - if (!resolvedSubgames[0]) revert OutOfOrderResolution(); - - // Update the global game status; The dispute has concluded. - status_ = claimData[0].counteredBy == address(0) ? GameStatus.DEFENDER_WINS : GameStatus.CHALLENGER_WINS; - resolvedAt = Timestamp.wrap(uint64(block.timestamp)); - - // Update the status and emit the resolved event, note that we're performing an assignment here. - emit Resolved(status = status_); - } - - /// @notice Resolves the subgame rooted at the given claim index. `_numToResolve` specifies how many children of - /// the subgame will be checked in this call. If `_numToResolve` is less than the number of children, an - /// internal cursor will be updated and this function may be called again to complete resolution of the - /// subgame. - /// @dev This function must be called bottom-up in the DAG - /// A subgame is a tree of claims that has a maximum depth of 1. - /// A subgame root claims is valid if, and only if, all of its child claims are invalid. - /// At the deepest level in the DAG, a claim is invalid if there's a successful step against it. - /// @param _claimIndex The index of the subgame root claim to resolve. - /// @param _numToResolve The number of subgames to resolve in this call. If the input is `0`, and this is the first - /// page, this function will attempt to check all of the subgame's children at once. - function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external { - // INVARIANT: Resolution cannot occur unless the game is currently in progress. - if (status != GameStatus.IN_PROGRESS) revert GameNotInProgress(); - - ClaimData storage subgameRootClaim = claimData[_claimIndex]; - Duration challengeClockDuration = getChallengerDuration(_claimIndex); - - // INVARIANT: Cannot resolve a subgame unless the clock of its would-be counter has expired - // INVARIANT: Assuming ordered subgame resolution, challengeClockDuration is always >= MAX_CLOCK_DURATION if all - // descendant subgames are resolved - if (challengeClockDuration.raw() < MAX_CLOCK_DURATION.raw()) revert ClockNotExpired(); - - // INVARIANT: Cannot resolve a subgame twice. - if (resolvedSubgames[_claimIndex]) revert ClaimAlreadyResolved(); - - uint256[] storage challengeIndices = subgames[_claimIndex]; - uint256 challengeIndicesLen = challengeIndices.length; - - // Uncontested claims are resolved implicitly unless they are the root claim. Pay out the bond to the claimant - // and return early. - if (challengeIndicesLen == 0 && _claimIndex != 0) { - // In the event that the parent claim is at the max depth, there will always be 0 subgames. If the - // `counteredBy` field is set and there are no subgames, this implies that the parent claim was successfully - // stepped against. In this case, we pay out the bond to the party that stepped against the parent claim. - // Otherwise, the parent claim is uncontested, and the bond is returned to the claimant. - address counteredBy = subgameRootClaim.counteredBy; - address recipient = counteredBy == address(0) ? subgameRootClaim.claimant : counteredBy; - _distributeBond(recipient, subgameRootClaim); - resolvedSubgames[_claimIndex] = true; - return; - } - - // Fetch the resolution checkpoint from storage. - ResolutionCheckpoint memory checkpoint = resolutionCheckpoints[_claimIndex]; - - // If the checkpoint does not currently exist, initialize the current left most position as max u128. - if (!checkpoint.initialCheckpointComplete) { - checkpoint.leftmostPosition = Position.wrap(type(uint128).max); - checkpoint.initialCheckpointComplete = true; - - // If `_numToResolve == 0`, assume that we can check all child subgames in this one callframe. - if (_numToResolve == 0) _numToResolve = challengeIndicesLen; - } - - // Assume parent is honest until proven otherwise - uint256 lastToResolve = checkpoint.subgameIndex + _numToResolve; - uint256 finalCursor = lastToResolve > challengeIndicesLen ? challengeIndicesLen : lastToResolve; - for (uint256 i = checkpoint.subgameIndex; i < finalCursor; i++) { - uint256 challengeIndex = challengeIndices[i]; - - // INVARIANT: Cannot resolve a subgame containing an unresolved claim - if (!resolvedSubgames[challengeIndex]) revert OutOfOrderResolution(); - - ClaimData storage claim = claimData[challengeIndex]; - - // If the child subgame is uncountered and further left than the current left-most counter, - // update the parent subgame's `countered` address and the current `leftmostCounter`. - // The left-most correct counter is preferred in bond payouts in order to discourage attackers - // from countering invalid subgame roots via an invalid defense position. As such positions - // cannot be correctly countered. - // Note that correctly positioned defense, but invalid claimes can still be successfully countered. - if (claim.counteredBy == address(0) && checkpoint.leftmostPosition.raw() > claim.position.raw()) { - checkpoint.counteredBy = claim.claimant; - checkpoint.leftmostPosition = claim.position; - } - } - - // Increase the checkpoint's cursor position by the number of children that were checked. - checkpoint.subgameIndex = uint32(finalCursor); - - // Persist the checkpoint and allow for continuing in a separate transaction, if resolution is not already - // complete. - resolutionCheckpoints[_claimIndex] = checkpoint; - - // If all children have been traversed in the above loop, the subgame may be resolved. Otherwise, persist the - // checkpoint and allow for continuation in a separate transaction. - if (checkpoint.subgameIndex == challengeIndicesLen) { - address countered = checkpoint.counteredBy; - - // Mark the subgame as resolved. - resolvedSubgames[_claimIndex] = true; - - // Distribute the bond to the appropriate party. - if (_claimIndex == 0 && l2BlockNumberChallenged) { - // Special case: If the root claim has been challenged with the `challengeRootL2Block` function, - // the bond is always paid out to the issuer of that challenge. - address challenger = l2BlockNumberChallenger; - _distributeBond(challenger, subgameRootClaim); - subgameRootClaim.counteredBy = challenger; - } else { - // If the parent was not successfully countered, pay out the parent's bond to the claimant. - // If the parent was successfully countered, pay out the parent's bond to the challenger. - _distributeBond(countered == address(0) ? subgameRootClaim.claimant : countered, subgameRootClaim); - - // Once a subgame is resolved, we percolate the result up the DAG so subsequent calls to - // resolveClaim will not need to traverse this subgame. - subgameRootClaim.counteredBy = countered; - } - } - } - - /// @notice Getter for the creator of the dispute game. - /// @dev `clones-with-immutable-args` argument #1 - /// @return creator_ The creator of the dispute game. - function gameCreator() public pure returns (address creator_) { - creator_ = _getArgAddress(0); - } - - /// @notice Getter for the root claim. - /// @dev `clones-with-immutable-args` argument #2 - /// @return rootClaim_ The root claim of the DisputeGame. - function rootClaim() public pure returns (Claim rootClaim_) { - rootClaim_ = Claim.wrap(_getArgBytes32(20)); - } - - /// @notice Getter for the root claim for a given L2 chain ID. - /// @param _chainId The L2 chain ID to get the root claim for. - /// @return rootClaim_ The root claim of the DisputeGame. - function rootClaimByChainId(uint256 _chainId) public pure returns (Claim rootClaim_) { - if (_chainId != l2ChainId()) revert UnknownChainId(); - rootClaim_ = rootClaim(); - } - - /// @notice Getter for the parent hash of the L1 block when the dispute game was created. - /// @dev `clones-with-immutable-args` argument #3 - /// @return l1Head_ The parent hash of the L1 block when the dispute game was created. - function l1Head() public pure returns (Hash l1Head_) { - l1Head_ = Hash.wrap(_getArgBytes32(52)); - } - - /// @notice Getter for the game type. - /// @dev `clones-with-immutable-args` argument #4 - /// @return gameType_ The type of proof system being used. - function gameType() public pure returns (GameType gameType_) { - gameType_ = GameType.wrap(_getArgUint32(84)); - } - - /// @notice Getter for the extra data. - /// @dev `clones-with-immutable-args` argument #5 - /// @return extraData_ Any extra data supplied to the dispute game contract by the creator. - function extraData() public pure returns (bytes memory extraData_) { - // The extra data starts at the second word within the cwia calldata and - // is 32 bytes long. - extraData_ = _getArgBytes(88, 32); - } - - /// @notice Getter for the absolute prestate of the instruction trace. - /// @dev `clones-with-immutable-args` argument #6 - /// @return absolutePrestate_ The absolute prestate of the instruction trace. - function absolutePrestate() public pure returns (Claim absolutePrestate_) { - absolutePrestate_ = Claim.wrap(_getArgBytes32(120)); - } - - /// @notice Getter for the VM implementation. - /// @dev `clones-with-immutable-args` argument #7 - /// @return vm_ The onchain VM implementation address. - function vm() public pure returns (IBigStepper vm_) { - vm_ = IBigStepper(_getArgAddress(152)); - } - - /// @notice Getter for the anchor state registry. - /// @dev `clones-with-immutable-args` argument #8 - /// @return registry_ The anchor state registry contract address. - function anchorStateRegistry() public pure returns (IAnchorStateRegistry registry_) { - registry_ = IAnchorStateRegistry(_getArgAddress(172)); - } - - /// @notice Getter for the WETH contract. - /// @dev `clones-with-immutable-args` argument #9 - /// @return weth_ The WETH contract for holding ETH. - function weth() public pure returns (IDelayedWETH weth_) { - weth_ = IDelayedWETH(payable(_getArgAddress(192))); - } - - /// @notice Getter for the L2 chain ID. - /// @dev `clones-with-immutable-args` argument #10 - /// @return l2ChainId_ The L2 chain ID. - function l2ChainId() public pure returns (uint256 l2ChainId_) { - l2ChainId_ = _getArgUint256(212); - } - - /// @notice A compliant implementation of this interface should return the components of the - /// game UUID's preimage provided in the cwia payload. The preimage of the UUID is - /// constructed as `keccak256(gameType . rootClaim . extraData)` where `.` denotes - /// concatenation. - /// @return gameType_ The type of proof system being used. - /// @return rootClaim_ The root claim of the DisputeGame. - /// @return extraData_ Any extra data supplied to the dispute game contract by the creator. - function gameData() external pure returns (GameType gameType_, Claim rootClaim_, bytes memory extraData_) { - gameType_ = gameType(); - rootClaim_ = rootClaim(); - extraData_ = extraData(); - } - - //////////////////////////////////////////////////////////////// - // MISC EXTERNAL // - //////////////////////////////////////////////////////////////// - - /// @notice Returns the required bond for a given move kind. - /// @param _position The position of the bonded interaction. - /// @return requiredBond_ The required ETH bond for the given move, in wei. - function getRequiredBond(Position _position) public view returns (uint256 requiredBond_) { - uint256 depth = uint256(_position.depth()); - if (depth > MAX_GAME_DEPTH) revert GameDepthExceeded(); - - // Values taken from Big Bonds v1.5 (TM) spec. - uint256 assumedBaseFee = 200 gwei; - uint256 baseGasCharged = 400_000; - uint256 highGasCharged = 300_000_000; - - // Goal here is to compute the fixed multiplier that will be applied to the base gas - // charged to get the required gas amount for the given depth. We apply this multiplier - // some `n` times where `n` is the depth of the position. We are looking for some number - // that, when multiplied by itself `MAX_GAME_DEPTH` times and then multiplied by the base - // gas charged, will give us the maximum gas that we want to charge. - // We want to solve for (highGasCharged/baseGasCharged) ** (1/MAX_GAME_DEPTH). - // We know that a ** (b/c) is equal to e ** (ln(a) * (b/c)). - // We can compute e ** (ln(a) * (b/c)) quite easily with FixedPointMathLib. - - // Set up a, b, and c. - uint256 a = highGasCharged / baseGasCharged; - uint256 b = FixedPointMathLib.WAD; - uint256 c = MAX_GAME_DEPTH * FixedPointMathLib.WAD; - - // Compute ln(a). - // slither-disable-next-line divide-before-multiply - uint256 lnA = uint256(FixedPointMathLib.lnWad(int256(a * FixedPointMathLib.WAD))); - - // Computes (b / c) with full precision using WAD = 1e18. - uint256 bOverC = FixedPointMathLib.divWad(b, c); - - // Compute e ** (ln(a) * (b/c)) - // sMulWad can be used here since WAD = 1e18 maintains the same precision. - uint256 numerator = FixedPointMathLib.mulWad(lnA, bOverC); - int256 base = FixedPointMathLib.expWad(int256(numerator)); - - // Compute the required gas amount. - int256 rawGas = FixedPointMathLib.powWad(base, int256(depth * FixedPointMathLib.WAD)); - uint256 requiredGas = FixedPointMathLib.mulWad(baseGasCharged, uint256(rawGas)); - - // Compute the required bond. - requiredBond_ = assumedBaseFee * requiredGas; - } - - /// @notice Claim the credit belonging to the recipient address. Reverts if the game isn't - /// finalized, if the recipient has no credit to claim, or if the bond transfer - /// fails. If the game is finalized but no bond has been paid out yet, this method - /// will determine the bond distribution mode and also try to update anchor game. - /// @param _recipient The owner and recipient of the credit. - function claimCredit(address _recipient) external { - // Close out the game and determine the bond distribution mode if not already set. - // We call this as part of claim credit to reduce the number of additional calls that a - // Challenger needs to make to this contract. - closeGame(); - - // Fetch the recipient's credit balance based on the bond distribution mode. - uint256 recipientCredit; - if (bondDistributionMode == BondDistributionMode.REFUND) { - recipientCredit = refundModeCredit[_recipient]; - } else if (bondDistributionMode == BondDistributionMode.NORMAL) { - recipientCredit = normalModeCredit[_recipient]; - } else { - // We shouldn't get here, but sanity check just in case. - revert InvalidBondDistributionMode(); - } - - // If the game is in refund mode, and the recipient has not unlocked their refund mode - // credit, we unlock it and return early. - if (!hasUnlockedCredit[_recipient]) { - hasUnlockedCredit[_recipient] = true; - weth().unlock(_recipient, recipientCredit); - return; - } - - // Revert if the recipient has no credit to claim. - if (recipientCredit == 0) revert NoCreditToClaim(); - - // Set the recipient's credit balances to 0. - refundModeCredit[_recipient] = 0; - normalModeCredit[_recipient] = 0; - - // Try to withdraw the WETH amount so it can be used here. - weth().withdraw(_recipient, recipientCredit); - - // Transfer the credit to the recipient. - (bool success,) = _recipient.call{ value: recipientCredit }(hex""); - if (!success) revert BondTransferFailed(); - } - - /// @notice Closes out the game, determines the bond distribution mode, attempts to register - /// the game as the anchor game, and emits an event. - function closeGame() public { - // If the bond distribution mode has already been determined, we can return early. - if (bondDistributionMode == BondDistributionMode.REFUND || bondDistributionMode == BondDistributionMode.NORMAL) - { - // We can't revert or we'd break claimCredit(). - return; - } else if (bondDistributionMode != BondDistributionMode.UNDECIDED) { - // We shouldn't get here, but sanity check just in case. - revert InvalidBondDistributionMode(); - } - - // We won't close the game if the system is currently paused. Paused games are temporarily - // invalid which would cause the game to go into refund mode and potentially cause some - // confusion for honest challengers. By blocking the game from being closed while the - // system is paused, the game will only go into refund mode if it ends up being explicitly - // invalidated in the AnchorStateRegistry. If the game has already been closed and a refund - // mode has been selected, we'll already have returned and we won't hit this revert. - if (anchorStateRegistry().paused()) { - revert GamePaused(); - } - - // Make sure that the game is resolved. - // AnchorStateRegistry should be checking this but we're being defensive here. - if (resolvedAt.raw() == 0) { - revert GameNotResolved(); - } - - // Game must be finalized according to the AnchorStateRegistry. - bool finalized = anchorStateRegistry().isGameFinalized(IDisputeGame(address(this))); - if (!finalized) { - revert GameNotFinalized(); - } - - // Try to update the anchor game first. Won't always succeed because delays can lead - // to situations in which this game might not be eligible to be a new anchor game. - // eip150-safe - try anchorStateRegistry().setAnchorState(IDisputeGame(address(this))) { } catch { } - - // Check if the game is a proper game, which will determine the bond distribution mode. - bool properGame = anchorStateRegistry().isGameProper(IDisputeGame(address(this))); - - // If the game is a proper game, the bonds should be distributed normally. Otherwise, go - // into refund mode and distribute bonds back to their original depositors. - if (properGame) { - bondDistributionMode = BondDistributionMode.NORMAL; - } else { - bondDistributionMode = BondDistributionMode.REFUND; - } - - // Emit an event to signal that the game has been closed. - emit GameClosed(bondDistributionMode); - } - - /// @notice Returns the amount of time elapsed on the potential challenger to `_claimIndex`'s chess clock. Maxes - /// out at `MAX_CLOCK_DURATION`. - /// @param _claimIndex The index of the subgame root claim. - /// @return duration_ The time elapsed on the potential challenger to `_claimIndex`'s chess clock. - function getChallengerDuration(uint256 _claimIndex) public view returns (Duration duration_) { - // INVARIANT: The game must be in progress to query the remaining time to respond to a given claim. - if (status != GameStatus.IN_PROGRESS) { - revert GameNotInProgress(); - } - - // Fetch the subgame root claim. - ClaimData storage subgameRootClaim = claimData[_claimIndex]; - - // Fetch the parent of the subgame root's clock, if it exists. - Clock parentClock; - if (subgameRootClaim.parentIndex != type(uint32).max) { - parentClock = claimData[subgameRootClaim.parentIndex].clock; - } - - // Compute the duration elapsed of the potential challenger's clock. - uint64 challengeDuration = - uint64(parentClock.duration().raw() + (block.timestamp - subgameRootClaim.clock.timestamp().raw())); - duration_ = challengeDuration > MAX_CLOCK_DURATION.raw() ? MAX_CLOCK_DURATION : Duration.wrap(challengeDuration); - } - - /// @notice Returns the length of the `claimData` array. - function claimDataLen() external view returns (uint256 len_) { - len_ = claimData.length; - } - - /// @notice Returns the credit balance of a given recipient. - /// @param _recipient The recipient of the credit. - /// @return credit_ The credit balance of the recipient. - function credit(address _recipient) external view returns (uint256 credit_) { - if (bondDistributionMode == BondDistributionMode.REFUND) { - credit_ = refundModeCredit[_recipient]; - } else { - // Always return normal credit balance by default unless we're in refund mode. - credit_ = normalModeCredit[_recipient]; - } - } - - //////////////////////////////////////////////////////////////// - // IMMUTABLE GETTERS // - //////////////////////////////////////////////////////////////// - - /// @notice Returns the max game depth. - function maxGameDepth() external view returns (uint256 maxGameDepth_) { - maxGameDepth_ = MAX_GAME_DEPTH; - } - - /// @notice Returns the split depth. - function splitDepth() external view returns (uint256 splitDepth_) { - splitDepth_ = SPLIT_DEPTH; - } - - /// @notice Returns the max clock duration. - function maxClockDuration() external view returns (Duration maxClockDuration_) { - maxClockDuration_ = MAX_CLOCK_DURATION; - } - - /// @notice Returns the clock extension constant. - function clockExtension() external view returns (Duration clockExtension_) { - clockExtension_ = CLOCK_EXTENSION; - } - - //////////////////////////////////////////////////////////////// - // HELPERS // - //////////////////////////////////////////////////////////////// - - /// @notice Pays out the bond of a claim to a given recipient. - /// @param _recipient The recipient of the bond. - /// @param _bonded The claim to pay out the bond of. - function _distributeBond(address _recipient, ClaimData storage _bonded) internal { - normalModeCredit[_recipient] += _bonded.bond; - } - - /// @notice Verifies the integrity of an execution bisection subgame's root claim. Reverts if the claim - /// is invalid. - /// @param _rootClaim The root claim of the execution bisection subgame. - function _verifyExecBisectionRoot( - Claim _rootClaim, - uint256 _parentIdx, - Position _parentPos, - bool _isAttack - ) - internal - view - { - // The root claim of an execution trace bisection sub-game must: - // 1. Signal that the VM panicked or resulted in an invalid transition if the disputed output root - // was made by the opposing party. - // 2. Signal that the VM resulted in a valid transition if the disputed output root was made by the same party. - - // If the move is a defense, the disputed output could have been made by either party. In this case, we - // need to search for the parent output to determine what the expected status byte should be. - Position disputedLeafPos = Position.wrap(_parentPos.raw() + 1); - ClaimData storage disputed = _findTraceAncestor({ _pos: disputedLeafPos, _start: _parentIdx, _global: true }); - uint8 vmStatus = uint8(_rootClaim.raw()[0]); - - if (_isAttack || disputed.position.depth() % 2 == SPLIT_DEPTH % 2) { - // If the move is an attack, the parent output is always deemed to be disputed. In this case, we only need - // to check that the root claim signals that the VM panicked or resulted in an invalid transition. - // If the move is a defense, and the disputed output and creator of the execution trace subgame disagree, - // the root claim should also signal that the VM panicked or resulted in an invalid transition. - if (!(vmStatus == VMStatuses.INVALID.raw() || vmStatus == VMStatuses.PANIC.raw())) { - revert UnexpectedRootClaim(_rootClaim); - } - } else if (vmStatus != VMStatuses.VALID.raw()) { - // The disputed output and the creator of the execution trace subgame agree. The status byte should - // have signaled that the VM succeeded. - revert UnexpectedRootClaim(_rootClaim); - } - } - - /// @notice Finds the trace ancestor of a given position within the DAG. - /// @param _pos The position to find the trace ancestor claim of. - /// @param _start The index to start searching from. - /// @param _global Whether or not to search the entire dag or just within an execution trace subgame. If set to - /// `true`, and `_pos` is at or above the split depth, this function will revert. - /// @return ancestor_ The ancestor claim that commits to the same trace index as `_pos`. - function _findTraceAncestor( - Position _pos, - uint256 _start, - bool _global - ) - internal - view - returns (ClaimData storage ancestor_) - { - // Grab the trace ancestor's expected position. - Position traceAncestorPos = _global ? _pos.traceAncestor() : _pos.traceAncestorBounded(SPLIT_DEPTH); - - // Walk up the DAG to find a claim that commits to the same trace index as `_pos`. It is - // guaranteed that such a claim exists. - ancestor_ = claimData[_start]; - while (ancestor_.position.raw() != traceAncestorPos.raw()) { - ancestor_ = claimData[ancestor_.parentIndex]; - } - } - - /// @notice Finds the starting and disputed output root for a given `ClaimData` within the DAG. This - /// `ClaimData` must be below the `SPLIT_DEPTH`. - /// @param _start The index within `claimData` of the claim to start searching from. - /// @return startingClaim_ The starting output root claim. - /// @return startingPos_ The starting output root position. - /// @return disputedClaim_ The disputed output root claim. - /// @return disputedPos_ The disputed output root position. - function _findStartingAndDisputedOutputs(uint256 _start) - internal - view - returns (Claim startingClaim_, Position startingPos_, Claim disputedClaim_, Position disputedPos_) - { - // Fatch the starting claim. - uint256 claimIdx = _start; - ClaimData storage claim = claimData[claimIdx]; - - // If the starting claim's depth is less than or equal to the split depth, we revert as this is UB. - if (claim.position.depth() <= SPLIT_DEPTH) revert ClaimAboveSplit(); - - // We want to: - // 1. Find the first claim at the split depth. - // 2. Determine whether it was the starting or disputed output for the exec game. - // 3. Find the complimentary claim depending on the info from #2 (pre or post). - - // Walk up the DAG until the ancestor's depth is equal to the split depth. - uint256 currentDepth; - ClaimData storage execRootClaim = claim; - while ((currentDepth = claim.position.depth()) > SPLIT_DEPTH) { - uint256 parentIndex = claim.parentIndex; - - // If we're currently at the split depth + 1, we're at the root of the execution sub-game. - // We need to keep track of the root claim here to determine whether the execution sub-game was - // started with an attack or defense against the output leaf claim. - if (currentDepth == SPLIT_DEPTH + 1) execRootClaim = claim; - - claim = claimData[parentIndex]; - claimIdx = parentIndex; - } - - // Determine whether the start of the execution sub-game was an attack or defense to the output root - // above. This is important because it determines which claim is the starting output root and which - // is the disputed output root. - (Position execRootPos, Position outputPos) = (execRootClaim.position, claim.position); - bool wasAttack = execRootPos.parent().raw() == outputPos.raw(); - - // Determine the starting and disputed output root indices. - // 1. If it was an attack, the disputed output root is `claim`, and the starting output root is - // elsewhere in the DAG (it must commit to the block # index at depth of `outputPos - 1`). - // 2. If it was a defense, the starting output root is `claim`, and the disputed output root is - // elsewhere in the DAG (it must commit to the block # index at depth of `outputPos + 1`). - if (wasAttack) { - // If this is an attack on the first output root (the block directly after the starting - // block number), the starting claim nor position exists in the tree. We leave these as - // 0, which can be easily identified due to 0 being an invalid Gindex. - if (outputPos.indexAtDepth() > 0) { - ClaimData storage starting = _findTraceAncestor(Position.wrap(outputPos.raw() - 1), claimIdx, true); - (startingClaim_, startingPos_) = (starting.claim, starting.position); - } else { - startingClaim_ = Claim.wrap(startingOutputRoot.root.raw()); - } - (disputedClaim_, disputedPos_) = (claim.claim, claim.position); - } else { - ClaimData storage disputed = _findTraceAncestor(Position.wrap(outputPos.raw() + 1), claimIdx, true); - (startingClaim_, startingPos_) = (claim.claim, claim.position); - (disputedClaim_, disputedPos_) = (disputed.claim, disputed.position); - } - } - - /// @notice Finds the local context hash for a given claim index that is present in an execution trace subgame. - /// @param _claimIndex The index of the claim to find the local context hash for. - /// @return uuid_ The local context hash. - function _findLocalContext(uint256 _claimIndex) internal view returns (Hash uuid_) { - (Claim starting, Position startingPos, Claim disputed, Position disputedPos) = - _findStartingAndDisputedOutputs(_claimIndex); - uuid_ = _computeLocalContext(starting, startingPos, disputed, disputedPos); - } - - /// @notice Computes the local context hash for a set of starting/disputed claim values and positions. - /// @param _starting The starting claim. - /// @param _startingPos The starting claim's position. - /// @param _disputed The disputed claim. - /// @param _disputedPos The disputed claim's position. - /// @return uuid_ The local context hash. - function _computeLocalContext( - Claim _starting, - Position _startingPos, - Claim _disputed, - Position _disputedPos - ) - internal - pure - returns (Hash uuid_) - { - // A position of 0 indicates that the starting claim is the absolute prestate. In this special case, - // we do not include the starting claim within the local context hash. - uuid_ = _startingPos.raw() == 0 - ? Hash.wrap(keccak256(abi.encode(_disputed, _disputedPos))) - : Hash.wrap(keccak256(abi.encode(_starting, _startingPos, _disputed, _disputedPos))); - } -} diff --git a/packages/contracts-bedrock/src/dispute/v2/PermissionedDisputeGameV2.sol b/packages/contracts-bedrock/src/dispute/v2/PermissionedDisputeGameV2.sol deleted file mode 100644 index 9f2a58ab712..00000000000 --- a/packages/contracts-bedrock/src/dispute/v2/PermissionedDisputeGameV2.sol +++ /dev/null @@ -1,99 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -// Contracts -import { FaultDisputeGameV2 } from "src/dispute/v2/FaultDisputeGameV2.sol"; - -// Libraries -import { Claim } from "src/dispute/lib/Types.sol"; -import { BadAuth } from "src/dispute/lib/Errors.sol"; - -/// @title PermissionedDisputeGameV2 -/// @notice PermissionedDisputeGameV2 is a contract that inherits from `FaultDisputeGameV2`, and contains two roles: -/// - The `challenger` role, which is allowed to challenge a dispute. -/// - The `proposer` role, which is allowed to create proposals and participate in their game. -/// This contract exists as a way for networks to support the fault proof iteration of the OptimismPortal -/// contract without needing to support a fully permissionless system. Permissionless systems can introduce -/// costs that certain networks may not wish to support. This contract can also be used as a fallback mechanism -/// in case of a failure in the permissionless fault proof system in the stage one release. -contract PermissionedDisputeGameV2 is FaultDisputeGameV2 { - /// @notice Modifier that gates access to the `challenger` and `proposer` roles. - modifier onlyAuthorized() { - if (!(msg.sender == proposer() || msg.sender == challenger())) { - revert BadAuth(); - } - _; - } - - /// @notice Semantic version. - /// @custom:semver 2.3.0 - function version() public pure override returns (string memory) { - return "2.3.0"; - } - - /// @param _params Parameters for creating a new FaultDisputeGame. - constructor(GameConstructorParams memory _params) FaultDisputeGameV2(_params) { } - - /// @inheritdoc FaultDisputeGameV2 - function step( - uint256 _claimIndex, - bool _isAttack, - bytes calldata _stateData, - bytes calldata _proof - ) - public - override - onlyAuthorized - { - super.step(_claimIndex, _isAttack, _stateData, _proof); - } - - /// @notice Generic move function, used for both `attack` and `defend` moves. - /// @notice _disputed The disputed `Claim`. - /// @param _challengeIndex The index of the claim being moved against. This must match the `_disputed` claim. - /// @param _claim The claim at the next logical position in the game. - /// @param _isAttack Whether or not the move is an attack or defense. - function move( - Claim _disputed, - uint256 _challengeIndex, - Claim _claim, - bool _isAttack - ) - public - payable - override - onlyAuthorized - { - super.move(_disputed, _challengeIndex, _claim, _isAttack); - } - - /// @notice Initializes the contract. - function initialize() public payable override { - super.initialize(); - - // The creator of the dispute game must be the proposer EOA. - if (tx.origin != proposer()) revert BadAuth(); - } - - function immutableArgsByteCount() internal pure override returns (uint256) { - // Extend expected data length to account for proposer and challenger addresses - // - 20 bytes: proposer address - // - 20 bytes: challenger address - return super.immutableArgsByteCount() + 40; - } - - //////////////////////////////////////////////////////////////// - // IMMUTABLE GETTERS // - //////////////////////////////////////////////////////////////// - - /// @notice Returns the proposer address. The proposer role is allowed to create proposals and participate in the - /// dispute game. - function proposer() public pure returns (address proposer_) { - proposer_ = _getArgAddress(super.immutableArgsByteCount()); - } - - /// @notice Returns the challenger address. The challenger role is allowed to participate in the dispute game. - function challenger() public pure returns (address challenger_) { - challenger_ = _getArgAddress(super.immutableArgsByteCount() + 20); - } -} diff --git a/packages/contracts-bedrock/src/dispute/zk/OptimisticZkGame.sol b/packages/contracts-bedrock/src/dispute/zk/OptimisticZkGame.sol index a9c91d6f289..9b929aa08e3 100644 --- a/packages/contracts-bedrock/src/dispute/zk/OptimisticZkGame.sol +++ b/packages/contracts-bedrock/src/dispute/zk/OptimisticZkGame.sol @@ -146,8 +146,8 @@ contract OptimisticZkGame is Clone, ISemver, IDisputeGame { AccessManager internal immutable ACCESS_MANAGER; /// @notice Semantic version. - /// @custom:semver 0.0.2 - string public constant version = "0.0.2"; + /// @custom:semver 0.1.0 + string public constant version = "0.1.0"; /// @notice The starting timestamp of the game. Timestamp public createdAt; diff --git a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol index 7feffe72daa..ded358bb732 100644 --- a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol +++ b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol @@ -33,8 +33,7 @@ import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol"; import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol"; import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol"; import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol"; -import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; + import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol"; @@ -621,17 +620,17 @@ contract OPContractsManager_AddGameType_Test is OPContractsManager_TestInit { address registeredImpl = address(chainDeployOutput1.disputeGameFactoryProxy.gameImpls(GameTypes.PERMISSIONED_CANNON)); - // Verify implementation address matches permissionedDisputeGameV2Impl + // Verify implementation address matches permissionedDisputeGameImpl assertEq( registeredImpl, - address(impls.permissionedDisputeGameV2Impl), + address(impls.permissionedDisputeGameImpl), "DisputeGameFactory should have v2 PermissionedDisputeGame implementation registered" ); // Verify that the returned fault dispute game is the v2 implementation assertEq( address(output.faultDisputeGame), - address(impls.permissionedDisputeGameV2Impl), + address(impls.permissionedDisputeGameImpl), "addGameType should return v2 PermissionedDisputeGame implementation" ); } @@ -662,17 +661,17 @@ contract OPContractsManager_AddGameType_Test is OPContractsManager_TestInit { // Get the v2 implementation address from OPCM IOPContractsManager.Implementations memory impls = opcm.implementations(); - // Verify implementation address matches permissionedDisputeGameV2Impl + // Verify implementation address matches permissionedDisputeGameImpl assertEq( registeredImpl, - address(impls.faultDisputeGameV2Impl), + address(impls.faultDisputeGameImpl), "DisputeGameFactory should have v2 FaultDisputeGame implementation registered" ); // Verify that the returned fault dispute game is the v2 implementation assertEq( address(output.faultDisputeGame), - address(impls.faultDisputeGameV2Impl), + address(impls.faultDisputeGameImpl), "addGameType should return v2 FaultDisputeGame implementation" ); } @@ -2305,8 +2304,8 @@ contract OPContractsManager_Deploy_Test is DeployOPChain_TestBase, DisputeGames function test_deployPermissioned_succeeds() public { // Sanity-check setup is consistent with devFeatures flag IOPContractsManager.Implementations memory impls = IOPContractsManager(opcmAddr).implementations(); - address pdgImpl = address(impls.permissionedDisputeGameV2Impl); - address fdgImpl = address(impls.faultDisputeGameV2Impl); + address pdgImpl = address(impls.permissionedDisputeGameImpl); + address fdgImpl = address(impls.faultDisputeGameImpl); assertFalse(pdgImpl == address(0), "PDG implementation address should be non-zero"); assertFalse(fdgImpl == address(0), "FDG implementation address should be non-zero"); diff --git a/packages/contracts-bedrock/test/L1/OPContractsManagerStandardValidator.t.sol b/packages/contracts-bedrock/test/L1/OPContractsManagerStandardValidator.t.sol index bab34b933d6..a84c6c02880 100644 --- a/packages/contracts-bedrock/test/L1/OPContractsManagerStandardValidator.t.sol +++ b/packages/contracts-bedrock/test/L1/OPContractsManagerStandardValidator.t.sol @@ -16,8 +16,7 @@ import { DevFeatures } from "src/libraries/DevFeatures.sol"; // Interfaces import { IOPContractsManager } from "interfaces/L1/IOPContractsManager.sol"; import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; -import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; + import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; @@ -38,6 +37,8 @@ import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol"; import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol"; import { IStandardBridge } from "interfaces/universal/IStandardBridge.sol"; import { IOPContractsManagerStandardValidator } from "interfaces/L1/IOPContractsManagerStandardValidator.sol"; +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; +import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; import { IMIPS64 } from "interfaces/cannon/IMIPS64.sol"; import { IBigStepper } from "../../interfaces/dispute/IBigStepper.sol"; import { IDisputeGameFactory } from "../../interfaces/dispute/IDisputeGameFactory.sol"; diff --git a/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol b/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol index 0ba370bb66b..35d8e4b33bb 100644 --- a/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol +++ b/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol @@ -28,9 +28,10 @@ import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol"; import { IOptimismPortal2 as IOptimismPortal } from "interfaces/L1/IOptimismPortal2.sol"; import { IOptimismPortalInterop } from "interfaces/L1/IOptimismPortalInterop.sol"; import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; + import { IProxy } from "interfaces/universal/IProxy.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol"; import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol"; diff --git a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerContainer.t.sol b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerContainer.t.sol index fbb579449e9..6ce881b6171 100644 --- a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerContainer.t.sol +++ b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerContainer.t.sol @@ -40,8 +40,8 @@ contract OPContractsManagerContainer_TestInit is Test { anchorStateRegistryImpl: makeAddr("anchorStateRegistryImpl"), delayedWETHImpl: makeAddr("delayedWETHImpl"), mipsImpl: makeAddr("mipsImpl"), - faultDisputeGameV2Impl: makeAddr("faultDisputeGameV2Impl"), - permissionedDisputeGameV2Impl: makeAddr("permissionedDisputeGameV2Impl"), + faultDisputeGameImpl: makeAddr("faultDisputeGameImpl"), + permissionedDisputeGameImpl: makeAddr("permissionedDisputeGameImpl"), superFaultDisputeGameImpl: makeAddr("superFaultDisputeGameImpl"), superPermissionedDisputeGameImpl: makeAddr("superPermissionedDisputeGameImpl"), storageSetterImpl: makeAddr("storageSetterImpl") diff --git a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerUtils.t.sol b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerUtils.t.sol index ce79986542f..b71e09b7528 100644 --- a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerUtils.t.sol +++ b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerUtils.t.sol @@ -97,8 +97,8 @@ contract OPContractsManagerUtils_TestInit is Test { anchorStateRegistryImpl: makeAddr("anchorStateRegistryImpl"), delayedWETHImpl: makeAddr("delayedWETHImpl"), mipsImpl: makeAddr("mipsImpl"), - faultDisputeGameV2Impl: makeAddr("faultDisputeGameV2Impl"), - permissionedDisputeGameV2Impl: makeAddr("permissionedDisputeGameV2Impl"), + faultDisputeGameImpl: makeAddr("faultDisputeGameImpl"), + permissionedDisputeGameImpl: makeAddr("permissionedDisputeGameImpl"), superFaultDisputeGameImpl: makeAddr("superFaultDisputeGameImpl"), superPermissionedDisputeGameImpl: makeAddr("superPermissionedDisputeGameImpl"), storageSetterImpl: address(storageSetter) diff --git a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol index 0b072c3a5b7..cf50da086d9 100644 --- a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol +++ b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol @@ -693,7 +693,7 @@ contract OPContractsManagerV2_Upgrade_Test is OPContractsManagerV2_Upgrade_TestI runCurrentUpgradeV2(chainPAO); assertEq( address(disputeGameFactory.gameImpls(GameTypes.CANNON)), - opcmV2.implementations().faultDisputeGameV2Impl, + opcmV2.implementations().faultDisputeGameImpl, "game impl not restored" ); assertEq(disputeGameFactory.initBonds(GameTypes.CANNON), originalBond, "init bond not restored"); @@ -705,7 +705,7 @@ contract OPContractsManagerV2_Upgrade_Test is OPContractsManagerV2_Upgrade_TestI runCurrentUpgradeV2(chainPAO); assertEq( address(disputeGameFactory.gameImpls(GameTypes.CANNON)), - opcmV2.implementations().faultDisputeGameV2Impl, + opcmV2.implementations().faultDisputeGameImpl, "initial game impl mismatch" ); diff --git a/packages/contracts-bedrock/test/dispute/AnchorStateRegistry.t.sol b/packages/contracts-bedrock/test/dispute/AnchorStateRegistry.t.sol index a33f6964215..2af2302d2b5 100644 --- a/packages/contracts-bedrock/test/dispute/AnchorStateRegistry.t.sol +++ b/packages/contracts-bedrock/test/dispute/AnchorStateRegistry.t.sol @@ -10,8 +10,9 @@ import { ForgeArtifacts, StorageSlot } from "scripts/libraries/ForgeArtifacts.so // Interfaces import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; + import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol"; /// @title AnchorStateRegistry_TestInit diff --git a/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol b/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol index 74e93e505fe..7400646b89e 100644 --- a/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol +++ b/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol @@ -18,10 +18,8 @@ import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol"; import { IPreimageOracle } from "interfaces/cannon/IPreimageOracle.sol"; import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; -import { IFaultDisputeGameV2 } from "interfaces/dispute/v2/IFaultDisputeGameV2.sol"; import { ISuperFaultDisputeGame } from "interfaces/dispute/ISuperFaultDisputeGame.sol"; import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; -import { IPermissionedDisputeGameV2 } from "interfaces/dispute/v2/IPermissionedDisputeGameV2.sol"; import { ISuperPermissionedDisputeGame } from "interfaces/dispute/ISuperPermissionedDisputeGame.sol"; // Mocks import { AlphabetVM } from "test/mocks/AlphabetVM.sol"; @@ -85,36 +83,12 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { vm_ = new AlphabetVM(_absolutePrestate, preimageOracle_); } - function _getGameConstructorParams( - Claim _absolutePrestate, - AlphabetVM _vm, - GameType _gameType, - uint256 _l2ChainId - ) + function _getGameConstructorParams() internal - view + pure returns (IFaultDisputeGame.GameConstructorParams memory params_) { return IFaultDisputeGame.GameConstructorParams({ - gameType: _gameType, - absolutePrestate: _absolutePrestate, - maxGameDepth: 2 ** 3, - splitDepth: 2 ** 2, - clockExtension: Duration.wrap(3 hours), - maxClockDuration: Duration.wrap(3.5 days), - vm: _vm, - weth: delayedWeth, - anchorStateRegistry: anchorStateRegistry, - l2ChainId: _l2ChainId - }); - } - - function _getGameConstructorParamsV2() - internal - pure - returns (IFaultDisputeGameV2.GameConstructorParams memory params_) - { - return IFaultDisputeGameV2.GameConstructorParams({ maxGameDepth: 2 ** 3, splitDepth: 2 ** 2, clockExtension: Duration.wrap(3 hours), @@ -160,7 +134,7 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { returns (address gameImpl_, AlphabetVM vm_, IPreimageOracle preimageOracle_) { bytes memory immutableArgs; - (immutableArgs, vm_, preimageOracle_) = getSuperFaultDisputeGameV2ImmutableArgs(_absolutePrestate); + (immutableArgs, vm_, preimageOracle_) = getSuperFaultDisputeGameImmutableArgs(_absolutePrestate); gameImpl_ = DeployUtils.create1({ _name: "SuperFaultDisputeGame", @@ -187,35 +161,8 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { gameImpl_ = setupSuperPermissionedDisputeGame(implArgs); } - /// @notice Sets up a fault game implementation - function setupFaultDisputeGame(Claim _absolutePrestate) - internal - returns (address gameImpl_, AlphabetVM vm_, IPreimageOracle preimageOracle_) - { - return setupFaultDisputeGameV2(_absolutePrestate); - } - - /// @notice Sets up a fault game implementation - function setupFaultDisputeGameV1(Claim _absolutePrestate) - internal - returns (address gameImpl_, AlphabetVM vm_, IPreimageOracle preimageOracle_) - { - (vm_, preimageOracle_) = _createVM(_absolutePrestate); - gameImpl_ = DeployUtils.create1({ - _name: "FaultDisputeGame", - _args: DeployUtils.encodeConstructor( - abi.encodeCall( - IFaultDisputeGame.__constructor__, - (_getGameConstructorParams(_absolutePrestate, vm_, GameTypes.CANNON, l2ChainId)) - ) - ) - }); - - _setGame(gameImpl_, GameTypes.CANNON); - } - - /// @notice Sets up immutable data for fault game v2 implementation - function getFaultDisputeGameV2ImmutableArgs(Claim _absolutePrestate) + /// @notice Sets up immutable data for fault game implementation + function getFaultDisputeGameImmutableArgs(Claim _absolutePrestate) internal returns (bytes memory immutableArgs_, AlphabetVM vm_, IPreimageOracle preimageOracle_) { @@ -231,7 +178,7 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { } /// @notice Sets up immutable data for super fault dispute game implementation - function getSuperFaultDisputeGameV2ImmutableArgs(Claim _absolutePrestate) + function getSuperFaultDisputeGameImmutableArgs(Claim _absolutePrestate) internal returns (bytes memory immutableArgs_, AlphabetVM vm_, IPreimageOracle preimageOracle_) { @@ -247,63 +194,26 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { } /// @notice Sets up a fault game v2 implementation - function setupFaultDisputeGameV2(Claim _absolutePrestate) + function setupFaultDisputeGame(Claim _absolutePrestate) internal returns (address gameImpl_, AlphabetVM vm_, IPreimageOracle preimageOracle_) { bytes memory immutableArgs; - (immutableArgs, vm_, preimageOracle_) = getFaultDisputeGameV2ImmutableArgs(_absolutePrestate); - gameImpl_ = setupFaultDisputeGameV2(immutableArgs); + (immutableArgs, vm_, preimageOracle_) = getFaultDisputeGameImmutableArgs(_absolutePrestate); + gameImpl_ = setupFaultDisputeGame(immutableArgs); } - function setupFaultDisputeGameV2(bytes memory immutableArgs) internal returns (address gameImpl_) { + function setupFaultDisputeGame(bytes memory immutableArgs) internal returns (address gameImpl_) { gameImpl_ = DeployUtils.create1({ - _name: "FaultDisputeGameV2", + _name: "FaultDisputeGame", _args: DeployUtils.encodeConstructor( - abi.encodeCall(IFaultDisputeGameV2.__constructor__, (_getGameConstructorParamsV2())) + abi.encodeCall(IFaultDisputeGame.__constructor__, (_getGameConstructorParams())) ) }); _setGame(gameImpl_, GameTypes.CANNON, immutableArgs); } - function setupPermissionedDisputeGame( - Claim _absolutePrestate, - address _proposer, - address _challenger - ) - internal - returns (address gameImpl_, AlphabetVM vm_, IPreimageOracle preimageOracle_) - { - return setupPermissionedDisputeGameV2(_absolutePrestate, _proposer, _challenger); - } - - function setupPermissionedDisputeGameV1( - Claim _absolutePrestate, - address _proposer, - address _challenger - ) - internal - returns (address gameImpl_, AlphabetVM vm_, IPreimageOracle preimageOracle_) - { - (vm_, preimageOracle_) = _createVM(_absolutePrestate); - gameImpl_ = DeployUtils.create1({ - _name: "PermissionedDisputeGame", - _args: DeployUtils.encodeConstructor( - abi.encodeCall( - IPermissionedDisputeGame.__constructor__, - ( - _getGameConstructorParams(_absolutePrestate, vm_, GameTypes.PERMISSIONED_CANNON, l2ChainId), - _proposer, - _challenger - ) - ) - ) - }); - - _setGame(gameImpl_, GameTypes.PERMISSIONED_CANNON); - } - function changeClaimStatus(Claim _claim, VMStatus _status) public pure returns (Claim out_) { assembly { out_ := or(and(not(shl(248, 0xFF)), _claim), shl(248, _status)) @@ -311,7 +221,7 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { } /// @notice Sets up immutable args for PDG v2 implementation - function getPermissionedDisputeGameV2ImmutableArgs( + function getPermissionedDisputeGameImmutableArgs( Claim _absolutePrestate, address _proposer, address _challenger @@ -357,7 +267,7 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { } /// @notice Deploys PDG v2 implementation and sets it on the DGF - function setupPermissionedDisputeGameV2( + function setupPermissionedDisputeGame( Claim _absolutePrestate, address _proposer, address _challenger @@ -367,17 +277,17 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { { bytes memory implArgs; (implArgs, vm_, preimageOracle_) = - getPermissionedDisputeGameV2ImmutableArgs(_absolutePrestate, _proposer, _challenger); + getPermissionedDisputeGameImmutableArgs(_absolutePrestate, _proposer, _challenger); - gameImpl_ = setupPermissionedDisputeGameV2(implArgs); + gameImpl_ = setupPermissionedDisputeGame(implArgs); } /// @notice Deploys PDG v2 implementation and sets it on the DGF - function setupPermissionedDisputeGameV2(bytes memory _implArgs) internal returns (address gameImpl_) { + function setupPermissionedDisputeGame(bytes memory _implArgs) internal returns (address gameImpl_) { gameImpl_ = DeployUtils.create1({ - _name: "PermissionedDisputeGameV2", + _name: "PermissionedDisputeGame", _args: DeployUtils.encodeConstructor( - abi.encodeCall(IPermissionedDisputeGameV2.__constructor__, (_getGameConstructorParamsV2())) + abi.encodeCall(IPermissionedDisputeGame.__constructor__, (_getGameConstructorParams())) ) }); @@ -619,7 +529,7 @@ contract DisputeGameFactory_Create_Test is DisputeGameFactory_TestInit { function test_create_implArgs_succeeds() public { Claim absolutePrestate = Claim.wrap(bytes32(hex"dead")); - (, AlphabetVM vm_,) = setupFaultDisputeGameV2(absolutePrestate); + (, AlphabetVM vm_,) = setupFaultDisputeGame(absolutePrestate); Claim rootClaim = changeClaimStatus(Claim.wrap(bytes32(hex"beef")), VMStatuses.INVALID); // extraData should contain the l2BlockNumber as first 32 bytes @@ -638,24 +548,24 @@ contract DisputeGameFactory_Create_Test is DisputeGameFactory_TestInit { assertEq(Timestamp.unwrap(timestamp), block.timestamp); // Verify the game has the correct parameters via CWIA - IFaultDisputeGameV2 gameV2 = IFaultDisputeGameV2(address(proxy)); + IFaultDisputeGame game_ = IFaultDisputeGame(address(proxy)); // Test CWIA getters - assertEq(Claim.unwrap(gameV2.absolutePrestate()), Claim.unwrap(absolutePrestate)); - assertEq(Claim.unwrap(gameV2.rootClaim()), Claim.unwrap(rootClaim)); - assertEq(gameV2.extraData(), extraData); - assertEq(gameV2.l2ChainId(), l2ChainId); - assertEq(address(gameV2.gameCreator()), address(this)); - assertEq(gameV2.l2BlockNumber(), uint256(type(uint32).max)); - assertEq(address(gameV2.vm()), address(vm_)); - assertEq(address(gameV2.weth()), address(delayedWeth)); - assertEq(address(gameV2.anchorStateRegistry()), address(anchorStateRegistry)); + assertEq(Claim.unwrap(game_.absolutePrestate()), Claim.unwrap(absolutePrestate)); + assertEq(Claim.unwrap(game_.rootClaim()), Claim.unwrap(rootClaim)); + assertEq(game_.extraData(), extraData); + assertEq(game_.l2ChainId(), l2ChainId); + assertEq(address(game_.gameCreator()), address(this)); + assertEq(game_.l2BlockNumber(), uint256(type(uint32).max)); + assertEq(address(game_.vm()), address(vm_)); + assertEq(address(game_.weth()), address(delayedWeth)); + assertEq(address(game_.anchorStateRegistry()), address(anchorStateRegistry)); // Test Constructor args - assertEq(GameType.unwrap(gameV2.gameType()), GameType.unwrap(GameTypes.CANNON)); - assertEq(gameV2.maxGameDepth(), 2 ** 3); - assertEq(gameV2.splitDepth(), 2 ** 2); - assertEq(Duration.unwrap(gameV2.clockExtension()), Duration.unwrap(Duration.wrap(3 hours))); - assertEq(Duration.unwrap(gameV2.maxClockDuration()), Duration.unwrap(Duration.wrap(3.5 days))); + assertEq(GameType.unwrap(game_.gameType()), GameType.unwrap(GameTypes.CANNON)); + assertEq(game_.maxGameDepth(), 2 ** 3); + assertEq(game_.splitDepth(), 2 ** 2); + assertEq(Duration.unwrap(game_.clockExtension()), Duration.unwrap(Duration.wrap(3 hours))); + assertEq(Duration.unwrap(game_.maxClockDuration()), Duration.unwrap(Duration.wrap(3.5 days))); } } diff --git a/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol b/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol index 87ca2a403f0..ee5aeaaf4d5 100644 --- a/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol +++ b/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol @@ -26,8 +26,8 @@ import "src/dispute/lib/Errors.sol"; import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; import { IPreimageOracle } from "interfaces/dispute/IBigStepper.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; + import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; -import { IFaultDisputeGameV2 } from "interfaces/dispute/v2/IFaultDisputeGameV2.sol"; contract ClaimCreditReenter { Vm internal immutable vm; @@ -233,7 +233,7 @@ contract FaultDisputeGame_Version_Test is FaultDisputeGame_TestInit { /// @title FaultDisputeGame_Constructor_Test /// @notice Tests the constructor of the `FaultDisputeGame` contract. -contract FaultDisputeGameV2_Constructor_Test is FaultDisputeGame_TestInit { +contract FaultDisputeGame_Constructor_Test is FaultDisputeGame_TestInit { function setUp() public virtual override { super.setUp(); } @@ -244,12 +244,12 @@ contract FaultDisputeGameV2_Constructor_Test is FaultDisputeGame_TestInit { _maxGameDepth = bound(_maxGameDepth, LibPosition.MAX_POSITION_BITLEN, type(uint256).max - 1); vm.expectRevert(MaxDepthTooLarge.selector); DeployUtils.create1({ - _name: "FaultDisputeGameV2", + _name: "FaultDisputeGame", _args: DeployUtils.encodeConstructor( abi.encodeCall( - IFaultDisputeGameV2.__constructor__, + IFaultDisputeGame.__constructor__, ( - IFaultDisputeGameV2.GameConstructorParams({ + IFaultDisputeGame.GameConstructorParams({ maxGameDepth: _maxGameDepth, splitDepth: _maxGameDepth + 1, clockExtension: Duration.wrap(3 hours), @@ -268,12 +268,12 @@ contract FaultDisputeGameV2_Constructor_Test is FaultDisputeGame_TestInit { _splitDepth = bound(_splitDepth, maxGameDepth - 1, type(uint256).max); vm.expectRevert(InvalidSplitDepth.selector); DeployUtils.create1({ - _name: "FaultDisputeGameV2", + _name: "FaultDisputeGame", _args: DeployUtils.encodeConstructor( abi.encodeCall( - IFaultDisputeGameV2.__constructor__, + IFaultDisputeGame.__constructor__, ( - IFaultDisputeGameV2.GameConstructorParams({ + IFaultDisputeGame.GameConstructorParams({ maxGameDepth: maxGameDepth, splitDepth: _splitDepth, clockExtension: Duration.wrap(3 hours), @@ -292,12 +292,12 @@ contract FaultDisputeGameV2_Constructor_Test is FaultDisputeGame_TestInit { _splitDepth = bound(_splitDepth, 0, minSplitDepth - 1); vm.expectRevert(InvalidSplitDepth.selector); DeployUtils.create1({ - _name: "FaultDisputeGameV2", + _name: "FaultDisputeGame", _args: DeployUtils.encodeConstructor( abi.encodeCall( - IFaultDisputeGameV2.__constructor__, + IFaultDisputeGame.__constructor__, ( - IFaultDisputeGameV2.GameConstructorParams({ + IFaultDisputeGame.GameConstructorParams({ maxGameDepth: 2 ** 3, splitDepth: _splitDepth, clockExtension: Duration.wrap(3 hours), @@ -324,12 +324,12 @@ contract FaultDisputeGameV2_Constructor_Test is FaultDisputeGame_TestInit { vm.expectRevert(InvalidClockExtension.selector); DeployUtils.create1({ - _name: "FaultDisputeGameV2", + _name: "FaultDisputeGame", _args: DeployUtils.encodeConstructor( abi.encodeCall( - IFaultDisputeGameV2.__constructor__, + IFaultDisputeGame.__constructor__, ( - IFaultDisputeGameV2.GameConstructorParams({ + IFaultDisputeGame.GameConstructorParams({ maxGameDepth: 16, splitDepth: 8, clockExtension: Duration.wrap(_clockExtension), @@ -409,7 +409,7 @@ contract FaultDisputeGame_Initialize_Test is FaultDisputeGame_TestInit { /// @notice Tests that the game cannot be initialized with incorrect CWIA calldata length /// caused by additional immutable args data function test_initialize_extraImmutableArgsBytes_reverts(uint256 _extraByteCount) public { - (bytes memory correctArgs,,) = getFaultDisputeGameV2ImmutableArgs(absolutePrestate); + (bytes memory correctArgs,,) = getFaultDisputeGameImmutableArgs(absolutePrestate); // We bound the upper end to 23.5KB to ensure that the minimal proxy never surpasses the // contract size limit in this test, as CWIA proxies store the immutable args in their @@ -420,7 +420,7 @@ contract FaultDisputeGame_Initialize_Test is FaultDisputeGame_TestInit { copyBytes(correctArgs, immutableArgs); // Set up dispute game implementation with target immutableArgs - setupFaultDisputeGameV2(immutableArgs); + setupFaultDisputeGame(immutableArgs); Claim claim = _dummyClaim(); vm.expectRevert(IFaultDisputeGame.BadExtraData.selector); @@ -434,7 +434,7 @@ contract FaultDisputeGame_Initialize_Test is FaultDisputeGame_TestInit { /// @notice Tests that the game cannot be initialized with incorrect CWIA calldata length /// caused by missing immutable args data function test_initialize_missingImmutableArgsBytes_reverts(uint256 _truncatedByteCount) public { - (bytes memory correctArgs,,) = getFaultDisputeGameV2ImmutableArgs(absolutePrestate); + (bytes memory correctArgs,,) = getFaultDisputeGameImmutableArgs(absolutePrestate); _truncatedByteCount = (_truncatedByteCount % correctArgs.length) + 1; bytes memory immutableArgs = new bytes(correctArgs.length - _truncatedByteCount); @@ -442,7 +442,7 @@ contract FaultDisputeGame_Initialize_Test is FaultDisputeGame_TestInit { copyBytes(correctArgs, immutableArgs); // Set up dispute game implementation with target immutableArgs - setupFaultDisputeGameV2(immutableArgs); + setupFaultDisputeGame(immutableArgs); Claim claim = _dummyClaim(); vm.expectRevert(IFaultDisputeGame.BadExtraData.selector); @@ -505,13 +505,13 @@ contract FaultDisputeGame_Initialize_Test is FaultDisputeGame_TestInit { } /// @notice Tests that initialization reverts when oracle challenge period is too large. - /// @dev V2 validates oracle challenge period during initialize(), not constructor + /// @dev Validates oracle challenge period during initialize(), not constructor function testFuzz_initialize_oracleChallengePeriodTooLarge_reverts(uint256 _challengePeriod) public { // Bound to values larger than uint64.max _challengePeriod = bound(_challengePeriod, uint256(type(uint64).max) + 1, type(uint256).max); // Get the current AlphabetVM from the setup - (, AlphabetVM vm_,) = setupFaultDisputeGameV2(absolutePrestate); + (, AlphabetVM vm_,) = setupFaultDisputeGame(absolutePrestate); // Mock the VM's oracle to return invalid challenge period vm.mockCall( diff --git a/packages/contracts-bedrock/test/dispute/PermissionedDisputeGame.t.sol b/packages/contracts-bedrock/test/dispute/PermissionedDisputeGame.t.sol index 4c344d6d1a9..c6e1640cbb3 100644 --- a/packages/contracts-bedrock/test/dispute/PermissionedDisputeGame.t.sol +++ b/packages/contracts-bedrock/test/dispute/PermissionedDisputeGame.t.sol @@ -285,7 +285,7 @@ contract PermissionedDisputeGame_Initialize_Test is PermissionedDisputeGame_Test /// @notice Tests that the game cannot be initialized with incorrect CWIA calldata length /// caused by additional immutable args data function test_initialize_extraImmutableArgsBytes_reverts(uint256 _extraByteCount) public { - (bytes memory correctArgs,,) = getPermissionedDisputeGameV2ImmutableArgs(absolutePrestate, PROPOSER, CHALLENGER); + (bytes memory correctArgs,,) = getPermissionedDisputeGameImmutableArgs(absolutePrestate, PROPOSER, CHALLENGER); // We bound the upper end to 23.5KB to ensure that the minimal proxy never surpasses the // contract size limit in this test, as CWIA proxies store the immutable args in their @@ -296,7 +296,7 @@ contract PermissionedDisputeGame_Initialize_Test is PermissionedDisputeGame_Test copyBytes(correctArgs, immutableArgs); // Set up dispute game implementation with target immutableArgs - setupPermissionedDisputeGameV2(immutableArgs); + setupPermissionedDisputeGame(immutableArgs); Claim claim = _dummyClaim(); vm.prank(PROPOSER, PROPOSER); @@ -311,7 +311,7 @@ contract PermissionedDisputeGame_Initialize_Test is PermissionedDisputeGame_Test /// @notice Tests that the game cannot be initialized with incorrect CWIA calldata length /// caused by missing immutable args data function test_initialize_missingImmutableArgsBytes_reverts(uint256 _truncatedByteCount) public { - (bytes memory correctArgs,,) = getPermissionedDisputeGameV2ImmutableArgs(absolutePrestate, PROPOSER, CHALLENGER); + (bytes memory correctArgs,,) = getPermissionedDisputeGameImmutableArgs(absolutePrestate, PROPOSER, CHALLENGER); _truncatedByteCount = (_truncatedByteCount % correctArgs.length) + 1; bytes memory immutableArgs = new bytes(correctArgs.length - _truncatedByteCount); @@ -319,7 +319,7 @@ contract PermissionedDisputeGame_Initialize_Test is PermissionedDisputeGame_Test copyBytes(correctArgs, immutableArgs); // Set up dispute game implementation with target immutableArgs - setupPermissionedDisputeGameV2(immutableArgs); + setupPermissionedDisputeGame(immutableArgs); Claim claim = _dummyClaim(); vm.prank(PROPOSER, PROPOSER); diff --git a/packages/contracts-bedrock/test/invariants/SuperFaultDisputeGame.t.sol b/packages/contracts-bedrock/test/invariants/SuperFaultDisputeGame.t.sol index cc0816d67e7..23658fb00ef 100644 --- a/packages/contracts-bedrock/test/invariants/SuperFaultDisputeGame.t.sol +++ b/packages/contracts-bedrock/test/invariants/SuperFaultDisputeGame.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.15; // Testing import { BaseSuperFaultDisputeGame_TestInit } from "test/dispute/SuperFaultDisputeGame.t.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; + import { RandomClaimActor } from "test/invariants/FaultDisputeGame.t.sol"; // Libraries @@ -12,6 +12,9 @@ import "src/dispute/lib/Errors.sol"; import { Types } from "src/libraries/Types.sol"; import { Hashing } from "src/libraries/Hashing.sol"; +// Interfaces +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; + contract SuperFaultDisputeGame_Solvency_Invariant is BaseSuperFaultDisputeGame_TestInit { Claim internal ROOT_CLAIM; Claim internal constant ABSOLUTE_PRESTATE = Claim.wrap(bytes32((uint256(3) << 248) | uint256(0))); diff --git a/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol b/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol index 4b58a66ede8..b94732d7700 100644 --- a/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol @@ -52,39 +52,33 @@ contract DeployImplementations_Test is Test, FeatureFlags { assertNotEq(address(output.systemConfigImpl), address(0)); - assertNotEq(address(output.faultDisputeGameV2Impl), address(0), "FaultDisputeGameV2 should be deployed"); + assertNotEq(address(output.faultDisputeGameImpl), address(0), "FaultDisputeGame should be deployed"); assertNotEq( - address(output.permissionedDisputeGameV2Impl), address(0), "PermissionedDisputeGameV2 should be deployed" + address(output.permissionedDisputeGameImpl), address(0), "PermissionedDisputeGame should be deployed" ); - // Validate constructor args for FaultDisputeGameV2 - assertEq(output.faultDisputeGameV2Impl.maxGameDepth(), 73, "FaultDisputeGameV2 maxGameDepth incorrect"); - assertEq(output.faultDisputeGameV2Impl.splitDepth(), 30, "FaultDisputeGameV2 splitDepth incorrect"); + // Validate constructor args for FaultDisputeGame + assertEq(output.faultDisputeGameImpl.maxGameDepth(), 73, "FaultDisputeGame maxGameDepth incorrect"); + assertEq(output.faultDisputeGameImpl.splitDepth(), 30, "FaultDisputeGame splitDepth incorrect"); + assertEq(output.faultDisputeGameImpl.clockExtension().raw(), 10800, "FaultDisputeGame clockExtension incorrect"); assertEq( - output.faultDisputeGameV2Impl.clockExtension().raw(), 10800, "FaultDisputeGameV2 clockExtension incorrect" - ); - assertEq( - output.faultDisputeGameV2Impl.maxClockDuration().raw(), - 302400, - "FaultDisputeGameV2 maxClockDuration incorrect" + output.faultDisputeGameImpl.maxClockDuration().raw(), 302400, "FaultDisputeGame maxClockDuration incorrect" ); - // Validate constructor args for PermissionedDisputeGameV2 - assertEq( - output.permissionedDisputeGameV2Impl.maxGameDepth(), 73, "PermissionedDisputeGameV2 maxGameDepth incorrect" - ); + // Validate constructor args for PermissionedDisputeGame assertEq( - output.permissionedDisputeGameV2Impl.splitDepth(), 30, "PermissionedDisputeGameV2 splitDepth incorrect" + output.permissionedDisputeGameImpl.maxGameDepth(), 73, "PermissionedDisputeGame maxGameDepth incorrect" ); + assertEq(output.permissionedDisputeGameImpl.splitDepth(), 30, "PermissionedDisputeGame splitDepth incorrect"); assertEq( - output.permissionedDisputeGameV2Impl.clockExtension().raw(), + output.permissionedDisputeGameImpl.clockExtension().raw(), 10800, - "PermissionedDisputeGameV2 clockExtension incorrect" + "PermissionedDisputeGame clockExtension incorrect" ); assertEq( - output.permissionedDisputeGameV2Impl.maxClockDuration().raw(), + output.permissionedDisputeGameImpl.maxClockDuration().raw(), 302400, - "PermissionedDisputeGameV2 maxClockDuration incorrect" + "PermissionedDisputeGame maxClockDuration incorrect" ); // for the super DG implementation deployments @@ -168,11 +162,11 @@ contract DeployImplementations_Test is Test, FeatureFlags { assertEq(address(output1.anchorStateRegistryImpl), address(output2.anchorStateRegistryImpl), "1100"); assertEq(address(output1.opcm), address(output2.opcm), "1200"); assertEq(address(output1.ethLockboxImpl), address(output2.ethLockboxImpl), "1300"); - assertEq(address(output1.faultDisputeGameV2Impl), address(output2.faultDisputeGameV2Impl), "1400"); - assertEq(address(output1.permissionedDisputeGameV2Impl), address(output2.permissionedDisputeGameV2Impl), "1500"); + assertEq(address(output1.faultDisputeGameImpl), address(output2.faultDisputeGameImpl), "1400"); + assertEq(address(output1.permissionedDisputeGameImpl), address(output2.permissionedDisputeGameImpl), "1500"); - assertNotEq(address(output1.faultDisputeGameV2Impl), address(0), "V2 contracts should not be null"); - assertNotEq(address(output1.permissionedDisputeGameV2Impl), address(0), "V2 contracts should not be null"); + assertNotEq(address(output1.faultDisputeGameImpl), address(0), "V2 contracts should not be null"); + assertNotEq(address(output1.permissionedDisputeGameImpl), address(0), "V2 contracts should not be null"); } function testFuzz_run_memory_succeeds( @@ -279,32 +273,32 @@ contract DeployImplementations_Test is Test, FeatureFlags { assertEq(address(output.opcmContainer), address(0), "900-v2"); } - assertNotEq(address(output.faultDisputeGameV2Impl), address(0), "V2 should be deployed when enabled"); - assertNotEq(address(output.permissionedDisputeGameV2Impl), address(0), "V2 should be deployed when enabled"); + assertNotEq(address(output.faultDisputeGameImpl), address(0), "V2 should be deployed when enabled"); + assertNotEq(address(output.permissionedDisputeGameImpl), address(0), "V2 should be deployed when enabled"); // Verify V2 constructor parameters match fuzz inputs - assertEq(output.faultDisputeGameV2Impl.maxGameDepth(), _faultGameV2MaxGameDepth, "FDGv2 maxGameDepth"); - assertEq(output.faultDisputeGameV2Impl.splitDepth(), _faultGameV2SplitDepth, "FDGv2 splitDepth"); + assertEq(output.faultDisputeGameImpl.maxGameDepth(), _faultGameV2MaxGameDepth, "FDGv2 maxGameDepth"); + assertEq(output.faultDisputeGameImpl.splitDepth(), _faultGameV2SplitDepth, "FDGv2 splitDepth"); assertEq( - output.faultDisputeGameV2Impl.clockExtension().raw(), + output.faultDisputeGameImpl.clockExtension().raw(), uint64(_faultGameV2ClockExtension), "FDGv2 clockExtension" ); assertEq( - output.faultDisputeGameV2Impl.maxClockDuration().raw(), + output.faultDisputeGameImpl.maxClockDuration().raw(), uint64(_faultGameV2MaxClockDuration), "FDGv2 maxClockDuration" ); - assertEq(output.permissionedDisputeGameV2Impl.maxGameDepth(), _faultGameV2MaxGameDepth, "PDGv2 maxGameDepth"); - assertEq(output.permissionedDisputeGameV2Impl.splitDepth(), _faultGameV2SplitDepth, "PDGv2 splitDepth"); + assertEq(output.permissionedDisputeGameImpl.maxGameDepth(), _faultGameV2MaxGameDepth, "PDGv2 maxGameDepth"); + assertEq(output.permissionedDisputeGameImpl.splitDepth(), _faultGameV2SplitDepth, "PDGv2 splitDepth"); assertEq( - output.permissionedDisputeGameV2Impl.clockExtension().raw(), + output.permissionedDisputeGameImpl.clockExtension().raw(), uint64(_faultGameV2ClockExtension), "PDGv2 clockExtension" ); assertEq( - output.permissionedDisputeGameV2Impl.maxClockDuration().raw(), + output.permissionedDisputeGameImpl.maxClockDuration().raw(), uint64(_faultGameV2MaxClockDuration), "PDGv2 maxClockDuration" ); @@ -392,8 +386,8 @@ contract DeployImplementations_Test is Test, FeatureFlags { assertEq(address(output.opcmContainer).code, empty, "2100-v2"); } - assertNotEq(address(output.faultDisputeGameV2Impl).code, empty, "V2 FDG should have code when enabled"); - assertNotEq(address(output.permissionedDisputeGameV2Impl).code, empty, "V2 PDG should have code when enabled"); + assertNotEq(address(output.faultDisputeGameImpl).code, empty, "V2 FDG should have code when enabled"); + assertNotEq(address(output.permissionedDisputeGameImpl).code, empty, "V2 PDG should have code when enabled"); if (superGamesEnabled) { assertNotEq(address(output.superFaultDisputeGameImpl).code, empty, "Super DG should have code when enabled"); assertNotEq( diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index d5a3b3d7507..fd4fffdbbec 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -230,7 +230,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { // Check dispute game deployments // Validate permissionedDisputeGame (PDG) address IOPContractsManager.Implementations memory impls = IOPContractsManager(opcmAddr).implementations(); - address expectedPDGAddress = impls.permissionedDisputeGameV2Impl; + address expectedPDGAddress = impls.permissionedDisputeGameImpl; address actualPDGAddress = address(doo.disputeGameFactoryProxy.gameImpls(GameTypes.PERMISSIONED_CANNON)); assertNotEq(actualPDGAddress, address(0), "PDG address should be non-zero"); assertEq(actualPDGAddress, expectedPDGAddress, "PDG address should match expected address"); diff --git a/packages/contracts-bedrock/test/scripts/VerifyOPCM.t.sol b/packages/contracts-bedrock/test/scripts/VerifyOPCM.t.sol index 904d3538eb9..d8b9db0c759 100644 --- a/packages/contracts-bedrock/test/scripts/VerifyOPCM.t.sol +++ b/packages/contracts-bedrock/test/scripts/VerifyOPCM.t.sol @@ -119,11 +119,7 @@ contract VerifyOPCM_Run_Test is VerifyOPCM_TestInit { for (uint256 j = 0; j < refsByType[i].length; j++) { VerifyOPCM.OpcmContractRef memory ref = refsByType[i][j]; - // TODO(#17262): Remove these skips once these contracts are no longer behind a feature flag - // This script doesn't work for features that are in-development, so skip for now - if (_isDisputeGameV2ContractRef(ref)) { - continue; - } + // TODO(#17262): Remove this skip once Super dispute games are no longer behind a feature flag if (_isSuperDisputeGameContractRef(ref)) { continue; } @@ -474,10 +470,6 @@ contract VerifyOPCM_Run_Test is VerifyOPCM_TestInit { assertGt(componentsWithUtilsTested, 0, "Should have tested at least one component with opcmUtils"); } - function _isDisputeGameV2ContractRef(VerifyOPCM.OpcmContractRef memory ref) internal pure returns (bool) { - return LibString.eq(ref.name, "FaultDisputeGameV2") || LibString.eq(ref.name, "PermissionedDisputeGameV2"); - } - function _isSuperDisputeGameContractRef(VerifyOPCM.OpcmContractRef memory ref) internal pure returns (bool) { return LibString.eq(ref.name, "SuperFaultDisputeGame") || LibString.eq(ref.name, "SuperPermissionedDisputeGame"); } diff --git a/packages/contracts-bedrock/test/setup/ForkLive.s.sol b/packages/contracts-bedrock/test/setup/ForkLive.s.sol index ba151832ff0..ec6e9119107 100644 --- a/packages/contracts-bedrock/test/setup/ForkLive.s.sol +++ b/packages/contracts-bedrock/test/setup/ForkLive.s.sol @@ -22,7 +22,7 @@ import { LibGameArgs } from "src/dispute/lib/LibGameArgs.sol"; // Interfaces import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; + import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol"; import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IAddressManager } from "interfaces/legacy/IAddressManager.sol"; @@ -30,6 +30,7 @@ import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol"; import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol"; import { IOPContractsManager } from "interfaces/L1/IOPContractsManager.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol"; import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol"; import { IOPContractsManagerUpgrader } from "interfaces/L1/IOPContractsManager.sol"; diff --git a/packages/contracts-bedrock/test/setup/Setup.sol b/packages/contracts-bedrock/test/setup/Setup.sol index 542ae8f25d9..b83c68cf5ff 100644 --- a/packages/contracts-bedrock/test/setup/Setup.sol +++ b/packages/contracts-bedrock/test/setup/Setup.sol @@ -40,6 +40,8 @@ import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol" import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; import { IBigStepper } from "interfaces/dispute/IBigStepper.sol"; +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; +import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; import { IL2CrossDomainMessenger } from "interfaces/L2/IL2CrossDomainMessenger.sol"; import { IL2StandardBridgeInterop } from "interfaces/L2/IL2StandardBridgeInterop.sol"; import { IL2ToL1MessagePasser } from "interfaces/L2/IL2ToL1MessagePasser.sol"; @@ -60,8 +62,7 @@ import { IWETH98 } from "interfaces/universal/IWETH98.sol"; import { IGovernanceToken } from "interfaces/governance/IGovernanceToken.sol"; import { ILegacyMessagePasser } from "interfaces/legacy/ILegacyMessagePasser.sol"; import { ISuperchainTokenBridge } from "interfaces/L2/ISuperchainTokenBridge.sol"; -import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; + import { ICrossL2Inbox } from "interfaces/L2/ICrossL2Inbox.sol"; import { ILiquidityController } from "interfaces/L2/ILiquidityController.sol"; import { INativeAssetLiquidity } from "interfaces/L2/INativeAssetLiquidity.sol"; diff --git a/packages/contracts-bedrock/test/vendor/Initializable.t.sol b/packages/contracts-bedrock/test/vendor/Initializable.t.sol index e74a08deec2..eafb97663b3 100644 --- a/packages/contracts-bedrock/test/vendor/Initializable.t.sol +++ b/packages/contracts-bedrock/test/vendor/Initializable.t.sol @@ -382,7 +382,7 @@ contract Initializer_Test is CommonTest { function test_cannotReinitialize_succeeds() public { // Collect exclusions. uint256 j; - string[] memory excludes = new string[](13); + string[] memory excludes = new string[](11); // Contract is currently not being deployed as part of the standard deployment script. excludes[j++] = "src/L2/OptimismSuperchainERC20.sol"; // Periphery contracts don't get deployed as part of the standard deployment script. @@ -393,10 +393,8 @@ contract Initializer_Test is CommonTest { // contracts and instead simply deploys them anonymously. Means that functions like "getInitializedSlot" // don't work properly. Remove these exclusions once the deployment script is fixed. excludes[j++] = "src/dispute/FaultDisputeGame.sol"; - excludes[j++] = "src/dispute/v2/FaultDisputeGameV2.sol"; - excludes[j++] = "src/dispute/v2/PermissionedDisputeGameV2.sol"; - excludes[j++] = "src/dispute/SuperFaultDisputeGame.sol"; excludes[j++] = "src/dispute/PermissionedDisputeGame.sol"; + excludes[j++] = "src/dispute/SuperFaultDisputeGame.sol"; excludes[j++] = "src/dispute/SuperPermissionedDisputeGame.sol"; excludes[j++] = "src/dispute/zk/OptimisticZkGame.sol"; // TODO: Eventually remove this exclusion. Same reason as above dispute contracts.