From a6309c4bc62f1f732ece82dc5f85c97bf0739461 Mon Sep 17 00:00:00 2001 From: Maurelian Date: Thu, 18 Dec 2025 16:51:10 -0500 Subject: [PATCH] chore(ctb): move init bond value to CommonTest --- .../test/L1/opcm/OPContractsManagerV2.t.sol | 6 +++--- .../contracts-bedrock/test/dispute/DisputeGameFactory.t.sol | 2 +- .../contracts-bedrock/test/dispute/FaultDisputeGame.t.sol | 2 +- .../test/dispute/SuperFaultDisputeGame.t.sol | 2 +- packages/contracts-bedrock/test/setup/CommonTest.sol | 3 +++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol index 07506952f2ff7..0b072c3a5b707 100644 --- a/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol +++ b/packages/contracts-bedrock/test/L1/opcm/OPContractsManagerV2.t.sol @@ -1032,7 +1032,7 @@ contract OPContractsManagerV2_Deploy_Test is OPContractsManagerV2_TestInit { deployConfig.disputeGameConfigs.push( IOPContractsManagerUtils.DisputeGameConfig({ enabled: true, - initBond: 0.08 ether, // Standard init bond + initBond: DEFAULT_DISPUTE_GAME_INIT_BOND, // Standard init bond gameType: GameTypes.CANNON, gameArgs: abi.encode(IOPContractsManagerUtils.FaultDisputeGameConfig({ absolutePrestate: cannonPrestate })) }) @@ -1040,7 +1040,7 @@ contract OPContractsManagerV2_Deploy_Test is OPContractsManagerV2_TestInit { deployConfig.disputeGameConfigs.push( IOPContractsManagerUtils.DisputeGameConfig({ enabled: true, - initBond: 0.08 ether, // Standard init bond + initBond: DEFAULT_DISPUTE_GAME_INIT_BOND, // Standard init bond gameType: GameTypes.PERMISSIONED_CANNON, gameArgs: abi.encode( IOPContractsManagerUtils.PermissionedDisputeGameConfig({ @@ -1054,7 +1054,7 @@ contract OPContractsManagerV2_Deploy_Test is OPContractsManagerV2_TestInit { deployConfig.disputeGameConfigs.push( IOPContractsManagerUtils.DisputeGameConfig({ enabled: true, - initBond: 0.08 ether, // Standard init bond + initBond: DEFAULT_DISPUTE_GAME_INIT_BOND, // Standard init bond gameType: GameTypes.CANNON_KONA, gameArgs: abi.encode( IOPContractsManagerUtils.FaultDisputeGameConfig({ absolutePrestate: cannonKonaPrestate }) diff --git a/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol b/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol index f628b17cf7b05..74e93e505fe86 100644 --- a/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol +++ b/packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol @@ -150,7 +150,7 @@ abstract contract DisputeGameFactory_TestInit is CommonTest { } else { disputeGameFactory.setImplementation(_gameType, IDisputeGame(_gameImpl)); } - disputeGameFactory.setInitBond(_gameType, 0.08 ether); + disputeGameFactory.setInitBond(_gameType, DEFAULT_DISPUTE_GAME_INIT_BOND); vm.stopPrank(); } diff --git a/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol b/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol index 50599d9a950c4..87ca2a403f02e 100644 --- a/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol +++ b/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol @@ -2123,7 +2123,7 @@ contract FaultDisputeGame_GetRequiredBond_Test is FaultDisputeGame_TestInit { uint256 bond = gameProxy.getRequiredBond(pos); // Reasonable approximation for a max depth of 8. - uint256 expected = 0.08 ether; + uint256 expected = DEFAULT_DISPUTE_GAME_INIT_BOND; for (uint64 j = 0; j < i; j++) { expected = expected * 22876; expected = expected / 10000; diff --git a/packages/contracts-bedrock/test/dispute/SuperFaultDisputeGame.t.sol b/packages/contracts-bedrock/test/dispute/SuperFaultDisputeGame.t.sol index c3a78ce42f841..a25ae92bf9b19 100644 --- a/packages/contracts-bedrock/test/dispute/SuperFaultDisputeGame.t.sol +++ b/packages/contracts-bedrock/test/dispute/SuperFaultDisputeGame.t.sol @@ -1950,7 +1950,7 @@ contract SuperFaultDisputeGame_GetRequiredBond_Test is SuperFaultDisputeGame_Tes uint256 bond = gameProxy.getRequiredBond(pos); // Reasonable approximation for a max depth of 8. - uint256 expected = 0.08 ether; + uint256 expected = DEFAULT_DISPUTE_GAME_INIT_BOND; for (uint64 j = 0; j < i; j++) { expected = expected * 22876; expected = expected / 10000; diff --git a/packages/contracts-bedrock/test/setup/CommonTest.sol b/packages/contracts-bedrock/test/setup/CommonTest.sol index 5185f52d8ca4e..daea37745ae3e 100644 --- a/packages/contracts-bedrock/test/setup/CommonTest.sol +++ b/packages/contracts-bedrock/test/setup/CommonTest.sol @@ -29,6 +29,9 @@ abstract contract CommonTest is Test, Setup, Events { bytes32 constant nonZeroHash = keccak256(abi.encode("NON_ZERO")); + /// @notice The default initial bond value for dispute games. + uint256 constant DEFAULT_DISPUTE_GAME_INIT_BOND = 0.08 ether; + FFIInterface constant ffi = FFIInterface(address(uint160(uint256(keccak256(abi.encode("optimism.ffi")))))); bool useAltDAOverride;