Prerequisites
Before you begin, ensure that:- Run op-contracts/v2.0.0 or higher on your chain
- Own the chain’s L1
ProxyAdmin
contract - Install the Forge toolkit (see Foundry docs)
Understanding dispute games
The OP Stack uses two types of dispute games:- Permissioned dispute game: Limited to specific proposer and challenger addresses
- Permissionless dispute game: Open to anyone to propose or challenge
In the Permissioned dispute game (PDG), the challenger role is a protocol-level permission assigned to specific addresses, allowing them to initiate or respond to disputes. This role is distinct from the op-challenger service, which is an off-chain monitoring service responsible for automatically detecting discrepancies and submitting challenges.
While the op-challenger service typically operates using an address that has been assigned the challenger role, the protocol-level role itself can be independently assigned, regardless of whether the op-challenger service is in use.
Refer to the OP Stack configurability spec for more details.
op-deployer
only initially include the permissioned dispute game.
This guide explains how to add the permissionless game.
The addGameType
function
The OPCM contract contains an addGameType
function that handles the deployment of new dispute games. This function:
- Deploys a new dispute game implementation
- Optionally deploys a new
DelayedWETH
contract - Registers the game with the
DisputeGameFactory
- Sets the initial bond amount
1. Finding the correct OPCM instance
Each OP Contracts release has its own OPCM instance. You must use the OPCM corresponding exactly to your chain’s contract version. For example, if your system uses contracts version v3.0.0, you must use the OPCM for v3.0.0. To find the correct OPCM address:- For Mainnet, refer to the standard-versions-mainnet.toml file in the Superchain Registry.
- For Sepolia, refer to the standard-versions-sepolia.toml file in the Superchain Registry.
2. Preparing the addGameType
Call
The addGameType
function expects an array of AddGameInput
structs. Here is the structure:
- saltMixer: A string used to create unique contract addresses
- systemConfig: The address of your chain’s
SystemConfig
contract - proxyAdmin: The Address of your chain’s
ProxyAdmin
contract - delayedWETH: The Address of the
DelayedWETH
contract (use zero address to deploy a new one) - disputeGameType: For permissionless games, use
GameTypes.CANNON
- disputeAbsolutePrestate: The absolute prestate hash for the game
- permissioned: Set to
false
for a permissionless game
false
and use the GameType CANNON
.
- Execute the addGameType function The following is a template for calling the addGameType function using Forge’s cast:
The most recommended way is to use a script to execute this call, rather than manual execution.
- Setting the respected game type After deploying the permissionless dispute game, you’ll need to update the respectedGameType in the OptimismPortal to start using it. For detailed instructions on setting the respected game type and migrating your chain from permissioned to permissionless fault proofs, refer to the migrating to permissionless fault proofs guide.
Next Steps
- For more detail on deploying new dispute games with OPCM, see the docs.
- Learn about absolute prestate
- checkout the migrating to permissionless fault proofs guide
- Fault proofs explainer