diff --git a/setup-templates/template-funding/script/Fund.s.sol b/setup-templates/template-funding/script/Fund.s.sol index db8b19a9..e6e55289 100644 --- a/setup-templates/template-funding/script/Fund.s.sol +++ b/setup-templates/template-funding/script/Fund.s.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.15; import {Vm} from "forge-std/Vm.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; contract FundScript is MultisigScript { address internal immutable OWNER_SAFE; @@ -45,12 +45,11 @@ contract FundScript is MultisigScript { require(OWNER_SAFE.balance >= TOTAL_FUNDS, "OWNER_SAFE not enough balance"); } - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = new IMulticall3.Call3Value[](RECIPIENTS.length); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](RECIPIENTS.length); for (uint256 i; i < RECIPIENTS.length; i++) { - calls[i] = - IMulticall3.Call3Value({target: RECIPIENTS[i], allowFailure: false, callData: "", value: FUNDS[i]}); + calls[i] = Call({operation: Enum.Operation.Call, target: RECIPIENTS[i], data: "", value: FUNDS[i]}); } return calls; diff --git a/setup-templates/template-gas-and-elasticity-increase/script/IncreaseEip1559ElasticityAndIncreaseGasLimit.s.sol b/setup-templates/template-gas-and-elasticity-increase/script/IncreaseEip1559ElasticityAndIncreaseGasLimit.s.sol index 6f27a8b0..edc79c2c 100644 --- a/setup-templates/template-gas-and-elasticity-increase/script/IncreaseEip1559ElasticityAndIncreaseGasLimit.s.sol +++ b/setup-templates/template-gas-and-elasticity-increase/script/IncreaseEip1559ElasticityAndIncreaseGasLimit.s.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.15; import {Vm} from "forge-std/Vm.sol"; -import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; +import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; interface ISystemConfig { function eip1559Elasticity() external view returns (uint32); @@ -90,10 +90,8 @@ contract IncreaseEip1559ElasticityAndIncreaseGasLimitScript is MultisigScript { // Mask to preserve bits 64-159 (operatorFeeScalar and operatorFeeConstant) uint256 operatorFeeMask = uint256(0xFFFFFFFFFFFFFFFFFFFFFFFF) << 64; uint256 preservedOperatorFees = existingEip1559Word & operatorFeeMask; - uint256 composedEip1559Word = (uint256(DA_FOOTPRINT_GAS_SCALAR) << 160) - | preservedOperatorFees - | (uint256(ELASTICITY) << 32) - | uint256(DENOMINATOR); + uint256 composedEip1559Word = (uint256(DA_FOOTPRINT_GAS_SCALAR) << 160) | preservedOperatorFees + | (uint256(ELASTICITY) << 32) | uint256(DENOMINATOR); storageOverrides[1] = Simulation.StorageOverride({key: eip1559SlotKey, value: bytes32(composedEip1559Word)}); stateOverrides[0] = Simulation.StateOverride({contractAddress: SYSTEM_CONFIG, overrides: storageOverrides}); @@ -101,27 +99,27 @@ contract IncreaseEip1559ElasticityAndIncreaseGasLimitScript is MultisigScript { } } - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = new IMulticall3.Call3Value[](3); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](3); - calls[0] = IMulticall3.Call3Value({ + calls[0] = Call({ + operation: Enum.Operation.Call, target: SYSTEM_CONFIG, - allowFailure: false, - callData: abi.encodeCall(ISystemConfig.setEIP1559Params, (DENOMINATOR, NEW_ELASTICITY)), + data: abi.encodeCall(ISystemConfig.setEIP1559Params, (DENOMINATOR, NEW_ELASTICITY)), value: 0 }); - calls[1] = IMulticall3.Call3Value({ + calls[1] = Call({ + operation: Enum.Operation.Call, target: SYSTEM_CONFIG, - allowFailure: false, - callData: abi.encodeCall(ISystemConfig.setGasLimit, (NEW_GAS_LIMIT)), + data: abi.encodeCall(ISystemConfig.setGasLimit, (NEW_GAS_LIMIT)), value: 0 }); - calls[2] = IMulticall3.Call3Value({ + calls[2] = Call({ + operation: Enum.Operation.Call, target: SYSTEM_CONFIG, - allowFailure: false, - callData: abi.encodeCall(ISystemConfig.setDAFootprintGasScalar, (NEW_DA_FOOTPRINT_GAS_SCALAR)), + data: abi.encodeCall(ISystemConfig.setDAFootprintGasScalar, (NEW_DA_FOOTPRINT_GAS_SCALAR)), value: 0 }); diff --git a/setup-templates/template-generic/script/CounterMultisigScript.s.sol b/setup-templates/template-generic/script/CounterMultisigScript.s.sol index fd9b2ccc..95e80efe 100644 --- a/setup-templates/template-generic/script/CounterMultisigScript.s.sol +++ b/setup-templates/template-generic/script/CounterMultisigScript.s.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.15; import {Vm} from "forge-std/Vm.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; -import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; +import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; interface ITest { function counter() external view returns (uint256); @@ -28,15 +28,11 @@ contract CounterMultisigScript is MultisigScript { require(ITest(TARGET).counter() == COUNT + 1, "Counter did not increment"); } - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = new IMulticall3.Call3Value[](1); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](1); - calls[0] = IMulticall3.Call3Value({ - target: TARGET, - allowFailure: false, - callData: abi.encodeCall(ITest.increment, ()), - value: 0 - }); + calls[0] = + Call({operation: Enum.Operation.Call, target: TARGET, data: abi.encodeCall(ITest.increment, ()), value: 0}); return calls; } diff --git a/setup-templates/template-pause-bridge-base/script/PauseBridge.s.sol b/setup-templates/template-pause-bridge-base/script/PauseBridge.s.sol index 7d7f5b46..9912c0f6 100644 --- a/setup-templates/template-pause-bridge-base/script/PauseBridge.s.sol +++ b/setup-templates/template-pause-bridge-base/script/PauseBridge.s.sol @@ -2,9 +2,10 @@ pragma solidity 0.8.15; import {Vm} from "forge-std/Vm.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; -import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; + import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; +import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; interface IOptimismPortal2 { function depositTransaction(address _to, uint256 _value, uint64 _gasLimit, bool _isCreation, bytes memory _data) @@ -22,8 +23,8 @@ contract PauseBridge is MultisigScript { address public immutable L2_BRIDGE = vm.envAddress("L2_BRIDGE"); bool public immutable IS_PAUSED = vm.envBool("IS_PAUSED"); - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = new IMulticall3.Call3Value[](1); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](1); address to = L2_BRIDGE; uint256 value = 0; @@ -31,10 +32,10 @@ contract PauseBridge is MultisigScript { bool isCreation = false; bytes memory data = abi.encodeCall(IBridge.setPaused, (IS_PAUSED)); - calls[0] = IMulticall3.Call3Value({ + calls[0] = Call({ + operation: Enum.Operation.Call, target: L1_PORTAL, - allowFailure: false, - callData: abi.encodeCall(IOptimismPortal2.depositTransaction, (to, value, gasLimit, isCreation, data)), + data: abi.encodeCall(IOptimismPortal2.depositTransaction, (to, value, gasLimit, isCreation, data)), value: value }); diff --git a/setup-templates/template-safe-management/script/UpdateSigners.s.sol b/setup-templates/template-safe-management/script/UpdateSigners.s.sol index 4bb1481c..65e9b482 100644 --- a/setup-templates/template-safe-management/script/UpdateSigners.s.sol +++ b/setup-templates/template-safe-management/script/UpdateSigners.s.sol @@ -3,10 +3,11 @@ pragma solidity 0.8.15; import {Vm} from "forge-std/Vm.sol"; import {stdJson} from "forge-std/StdJson.sol"; -import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; +import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; + import {GnosisSafe} from "safe-smart-account/GnosisSafe.sol"; import {OwnerManager} from "safe-smart-account/base/OwnerManager.sol"; @@ -103,24 +104,23 @@ contract UpdateSigners is MultisigScript { } } - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = - new IMulticall3.Call3Value[](OWNERS_TO_ADD.length + OWNERS_TO_REMOVE.length); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](OWNERS_TO_ADD.length + OWNERS_TO_REMOVE.length); for (uint256 i; i < OWNERS_TO_ADD.length; i++) { - calls[i] = IMulticall3.Call3Value({ + calls[i] = Call({ + operation: Enum.Operation.Call, target: OWNER_SAFE, - allowFailure: false, - callData: abi.encodeCall(OwnerManager.addOwnerWithThreshold, (OWNERS_TO_ADD[i], THRESHOLD)), + data: abi.encodeCall(OwnerManager.addOwnerWithThreshold, (OWNERS_TO_ADD[i], THRESHOLD)), value: 0 }); } for (uint256 i; i < OWNERS_TO_REMOVE.length; i++) { - calls[OWNERS_TO_ADD.length + i] = IMulticall3.Call3Value({ + calls[OWNERS_TO_ADD.length + i] = Call({ + operation: Enum.Operation.Call, target: OWNER_SAFE, - allowFailure: false, - callData: abi.encodeCall( + data: abi.encodeCall( OwnerManager.removeOwner, (ownerToPrevOwner[OWNERS_TO_REMOVE[i]], OWNERS_TO_REMOVE[i], THRESHOLD) ), value: 0 @@ -133,4 +133,4 @@ contract UpdateSigners is MultisigScript { function _ownerSafe() internal view override returns (address) { return OWNER_SAFE; } -} \ No newline at end of file +} diff --git a/setup-templates/template-set-bridge-partner-threshold/script/SetThreshold.s.sol b/setup-templates/template-set-bridge-partner-threshold/script/SetThreshold.s.sol index 0d9e2d66..5b6ed564 100644 --- a/setup-templates/template-set-bridge-partner-threshold/script/SetThreshold.s.sol +++ b/setup-templates/template-set-bridge-partner-threshold/script/SetThreshold.s.sol @@ -2,9 +2,10 @@ pragma solidity 0.8.28; import {Vm} from "forge-std/Vm.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; -import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; + import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; +import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; interface IOptimismPortal2 { function depositTransaction(address _to, uint256 _value, uint64 _gasLimit, bool _isCreation, bytes memory _data) @@ -22,8 +23,8 @@ contract SetThreshold is MultisigScript { address public immutable L2_BRIDGE_VALIDATOR = vm.envAddress("L2_BRIDGE_VALIDATOR"); uint256 public immutable NEW_THRESHOLD = vm.envUint("NEW_THRESHOLD"); - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = new IMulticall3.Call3Value[](1); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](1); address to = L2_BRIDGE_VALIDATOR; uint256 value = 0; @@ -31,10 +32,10 @@ contract SetThreshold is MultisigScript { bool isCreation = false; bytes memory data = abi.encodeCall(IBridgeValidator.setPartnerThreshold, (NEW_THRESHOLD)); - calls[0] = IMulticall3.Call3Value({ + calls[0] = Call({ + operation: Enum.Operation.Call, target: L1_PORTAL, - allowFailure: false, - callData: abi.encodeCall(IOptimismPortal2.depositTransaction, (to, value, gasLimit, isCreation, data)), + data: abi.encodeCall(IOptimismPortal2.depositTransaction, (to, value, gasLimit, isCreation, data)), value: value }); diff --git a/setup-templates/template-switch-to-permissioned-game/script/SwitchToPermissionedGame.sol b/setup-templates/template-switch-to-permissioned-game/script/SwitchToPermissionedGame.sol index c11beb7b..031280c7 100644 --- a/setup-templates/template-switch-to-permissioned-game/script/SwitchToPermissionedGame.sol +++ b/setup-templates/template-switch-to-permissioned-game/script/SwitchToPermissionedGame.sol @@ -2,14 +2,16 @@ pragma solidity 0.8.15; import {Vm} from "forge-std/Vm.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; + +import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; +import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; + import {IAnchorStateRegistry} from "@eth-optimism-bedrock/src/dispute/FaultDisputeGame.sol"; import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; import {DisputeGameFactory} from "@eth-optimism-bedrock/src/dispute/DisputeGameFactory.sol"; import {FaultDisputeGame} from "@eth-optimism-bedrock/src/dispute/PermissionedDisputeGame.sol"; import {GameTypes, GameType} from "@eth-optimism-bedrock/src/dispute/lib/Types.sol"; -import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; -import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; /// @notice This script updates the respectedGameType and retires existing games in the AnchorStateRegistry. contract SwitchToPermissionedGame is MultisigScript { @@ -39,20 +41,20 @@ contract SwitchToPermissionedGame is MultisigScript { ); } - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = new IMulticall3.Call3Value[](2); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](2); - calls[0] = IMulticall3.Call3Value({ + calls[0] = Call({ + operation: Enum.Operation.Call, target: address(anchorStateRegistry), - allowFailure: false, - callData: abi.encodeCall(IAnchorStateRegistry.setRespectedGameType, (GameTypes.PERMISSIONED_CANNON)), + data: abi.encodeCall(IAnchorStateRegistry.setRespectedGameType, (GameTypes.PERMISSIONED_CANNON)), value: 0 }); - calls[1] = IMulticall3.Call3Value({ + calls[1] = Call({ + operation: Enum.Operation.Call, target: address(anchorStateRegistry), - allowFailure: false, - callData: abi.encodeCall(IAnchorStateRegistry.updateRetirementTimestamp, ()), + data: abi.encodeCall(IAnchorStateRegistry.updateRetirementTimestamp, ()), value: 0 }); diff --git a/setup-templates/template-upgrade-fault-proofs/script/DeployDisputeGames.s.sol b/setup-templates/template-upgrade-fault-proofs/script/DeployDisputeGames.s.sol index 42494078..c32397d4 100644 --- a/setup-templates/template-upgrade-fault-proofs/script/DeployDisputeGames.s.sol +++ b/setup-templates/template-upgrade-fault-proofs/script/DeployDisputeGames.s.sol @@ -2,17 +2,23 @@ pragma solidity 0.8.15; import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; -import {IAnchorStateRegistry, IDelayedWETH, IBigStepper} from "@eth-optimism-bedrock/src/dispute/FaultDisputeGame.sol"; import { - PermissionedDisputeGame, FaultDisputeGame -} from "@eth-optimism-bedrock/src/dispute/PermissionedDisputeGame.sol"; + IDelayedWETH, + IAnchorStateRegistry, + IBigStepper +} from "@eth-optimism-bedrock/src/dispute/v2/FaultDisputeGameV2.sol"; +import { + FaultDisputeGameV2, + PermissionedDisputeGameV2 +} from "@eth-optimism-bedrock/src/dispute/v2/PermissionedDisputeGameV2.sol"; import {GameTypes, GameType, Duration, Claim} from "@eth-optimism-bedrock/src/dispute/lib/Types.sol"; import {LibGameType, LibDuration} from "@eth-optimism-bedrock/src/dispute/lib/LibUDT.sol"; import {DisputeGameFactory} from "@eth-optimism-bedrock/src/dispute/DisputeGameFactory.sol"; import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; + import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -import {console} from "forge-std/console.sol"; /// @notice This script deploys new versions of FaultDisputeGame and PermissionedDisputeGame with all the same /// parameters as the existing implementations excluding the absolute prestate. @@ -27,8 +33,7 @@ contract DeployDisputeGames is Script { SystemConfig internal _SYSTEM_CONFIG = SystemConfig(vm.envAddress("SYSTEM_CONFIG")); Claim immutable absolutePrestate; - FaultDisputeGame.GameConstructorParams fdgParams; - FaultDisputeGame.GameConstructorParams pdgParams; + FaultDisputeGameV2.GameConstructorParams dgParams; address proposer; address challenger; @@ -38,77 +43,39 @@ contract DeployDisputeGames is Script { function setUp() public { DisputeGameFactory dgfProxy = DisputeGameFactory(_SYSTEM_CONFIG.disputeGameFactory()); - FaultDisputeGame currentFdg = FaultDisputeGame(address(dgfProxy.gameImpls(GameTypes.CANNON))); - PermissionedDisputeGame currentPdg = - PermissionedDisputeGame(address(dgfProxy.gameImpls(GameTypes.PERMISSIONED_CANNON))); + FaultDisputeGameV2 currentFdg = FaultDisputeGameV2(address(dgfProxy.gameImpls(GameTypes.CANNON))); + PermissionedDisputeGameV2 currentPdg = + PermissionedDisputeGameV2(address(dgfProxy.gameImpls(GameTypes.PERMISSIONED_CANNON))); uint256 maxGameDepth = currentFdg.maxGameDepth(); uint256 splitDepth = currentFdg.splitDepth(); Duration clockExtension = currentFdg.clockExtension(); Duration maxClockDuration = currentFdg.maxClockDuration(); - IBigStepper bigStepper = currentFdg.vm(); - IAnchorStateRegistry anchorStateRegistry = currentFdg.anchorStateRegistry(); - uint256 l2ChainId = currentFdg.l2ChainId(); proposer = currentPdg.proposer(); challenger = currentPdg.challenger(); - fdgParams = FaultDisputeGame.GameConstructorParams({ - gameType: GameTypes.CANNON, - absolutePrestate: absolutePrestate, - maxGameDepth: maxGameDepth, - splitDepth: splitDepth, - clockExtension: clockExtension, - maxClockDuration: maxClockDuration, - vm: bigStepper, - weth: currentFdg.weth(), - anchorStateRegistry: anchorStateRegistry, - l2ChainId: l2ChainId - }); - pdgParams = FaultDisputeGame.GameConstructorParams({ - gameType: GameTypes.PERMISSIONED_CANNON, - absolutePrestate: absolutePrestate, + dgParams = FaultDisputeGameV2.GameConstructorParams({ maxGameDepth: maxGameDepth, splitDepth: splitDepth, clockExtension: clockExtension, - maxClockDuration: maxClockDuration, - vm: bigStepper, - weth: currentPdg.weth(), - anchorStateRegistry: anchorStateRegistry, - l2ChainId: l2ChainId + maxClockDuration: maxClockDuration }); } function _postCheck(address fdgImpl, address pdgImpl) private view { - FaultDisputeGame fdg = FaultDisputeGame(fdgImpl); - PermissionedDisputeGame pdg = PermissionedDisputeGame(pdgImpl); + FaultDisputeGameV2 fdg = FaultDisputeGameV2(fdgImpl); + PermissionedDisputeGameV2 pdg = PermissionedDisputeGameV2(pdgImpl); require(Strings.equal(fdg.version(), EXPECTED_VERSION), "Postcheck version 1"); require(Strings.equal(pdg.version(), EXPECTED_VERSION), "Postcheck version 2"); require(fdg.gameType().raw() == GameTypes.CANNON.raw(), "Postcheck 1"); require(fdg.absolutePrestate().raw() == absolutePrestate.raw(), "Postcheck 2"); - require(fdg.maxGameDepth() == fdgParams.maxGameDepth, "Postcheck 3"); - require(fdg.splitDepth() == fdgParams.splitDepth, "Postcheck 4"); - require(fdg.clockExtension().raw() == fdgParams.clockExtension.raw(), "Postcheck 5"); - require(fdg.maxClockDuration().raw() == fdgParams.maxClockDuration.raw(), "Postcheck 6"); - require(fdg.vm() == fdgParams.vm, "Postcheck 7"); - require(fdg.weth() == fdgParams.weth, "Postcheck 8"); - require(fdg.anchorStateRegistry() == fdgParams.anchorStateRegistry, "Postcheck 9"); - require(fdg.l2ChainId() == fdgParams.l2ChainId, "Postcheck 10"); - - require(pdg.gameType().raw() == GameTypes.PERMISSIONED_CANNON.raw(), "Postcheck 11"); - require(pdg.absolutePrestate().raw() == absolutePrestate.raw(), "Postcheck 12"); - require(pdg.maxGameDepth() == pdgParams.maxGameDepth, "Postcheck 13"); - require(pdg.splitDepth() == pdgParams.splitDepth, "Postcheck 14"); - require(pdg.clockExtension().raw() == pdgParams.clockExtension.raw(), "Postcheck 15"); - require(pdg.maxClockDuration().raw() == pdgParams.maxClockDuration.raw(), "Postcheck 16"); - require(pdg.vm() == pdgParams.vm, "Postcheck 17"); - require(pdg.weth() == pdgParams.weth, "Postcheck 18"); - require(pdg.anchorStateRegistry() == pdgParams.anchorStateRegistry, "Postcheck 19"); - require(pdg.l2ChainId() == pdgParams.l2ChainId, "Postcheck 20"); - require(pdg.proposer() == proposer, "Postcheck 21"); - require(pdg.challenger() == challenger, "Postcheck 22"); + require(fdg.maxGameDepth() == dgParams.maxGameDepth, "Postcheck 3"); + require(fdg.splitDepth() == dgParams.splitDepth, "Postcheck 4"); + require(fdg.clockExtension().raw() == dgParams.clockExtension.raw(), "Postcheck 5"); + require(fdg.maxClockDuration().raw() == dgParams.maxClockDuration.raw(), "Postcheck 6"); } function run() public { @@ -131,14 +98,14 @@ contract DeployDisputeGames is Script { function _deployContracts() private returns (address, address) { console.log("FaultDisputeGame params:"); - console.logBytes(abi.encode(fdgParams)); + console.logBytes(abi.encode(dgParams)); console.log("PermissionedDisputeGame params:"); - console.logBytes(abi.encode(pdgParams, proposer, challenger)); + console.logBytes(abi.encode(dgParams)); vm.startBroadcast(); - address fdg = address(new FaultDisputeGame(fdgParams)); - address pdg = address(new PermissionedDisputeGame(pdgParams, proposer, challenger)); + address fdg = address(new FaultDisputeGameV2(dgParams)); + address pdg = address(new PermissionedDisputeGameV2(dgParams)); vm.stopBroadcast(); return (fdg, pdg); diff --git a/setup-templates/template-upgrade-fault-proofs/script/UpgradeDGF.s.sol b/setup-templates/template-upgrade-fault-proofs/script/UpgradeDGF.s.sol index 971ae3bf..b227eea0 100644 --- a/setup-templates/template-upgrade-fault-proofs/script/UpgradeDGF.s.sol +++ b/setup-templates/template-upgrade-fault-proofs/script/UpgradeDGF.s.sol @@ -3,13 +3,13 @@ pragma solidity 0.8.24; import {Vm} from "forge-std/Vm.sol"; import {stdJson} from "forge-std/StdJson.sol"; -import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; import {console} from "forge-std/console.sol"; -import {LibString} from "@solady/utils/LibString.sol"; - import {MultisigScript} from "@base-contracts/script/universal/MultisigScript.sol"; import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; +import {Enum} from "@base-contracts/script/universal/IGnosisSafe.sol"; + +import {LibString} from "@solady/utils/LibString.sol"; interface IDisputeGameFactory { function gameImpls(uint32) external view returns (address); @@ -125,19 +125,19 @@ contract UpgradeDGF is MultisigScript { require(rootBlockNumber != 0, "check-310"); } - function _buildCalls() internal view override returns (IMulticall3.Call3Value[] memory) { - IMulticall3.Call3Value[] memory calls = new IMulticall3.Call3Value[](2); + function _buildCalls() internal view override returns (Call[] memory) { + Call[] memory calls = new Call[](2); - calls[0] = IMulticall3.Call3Value({ + calls[0] = Call({ + operation: Enum.Operation.Call, target: address(dgfProxy), - allowFailure: false, - callData: abi.encodeCall(IDisputeGameFactory.setImplementation, (CANNON, fdgImpl)), + data: abi.encodeCall(IDisputeGameFactory.setImplementation, (CANNON, fdgImpl)), value: 0 }); - calls[1] = IMulticall3.Call3Value({ + calls[1] = Call({ + operation: Enum.Operation.Call, target: address(dgfProxy), - allowFailure: false, - callData: abi.encodeCall(IDisputeGameFactory.setImplementation, (PERMISSIONED_CANNON, pdgImpl)), + data: abi.encodeCall(IDisputeGameFactory.setImplementation, (PERMISSIONED_CANNON, pdgImpl)), value: 0 });