Skip to main content
op-contracts is the OP Stack’s smart contract layer: the L1 contracts that anchor an OP Stack chain to Ethereum and the L2 predeploy contracts that every OP Stack chain ships in its genesis state. Both live in packages/contracts-bedrock in the Optimism monorepo and release together as op-contracts/vX.Y.Z.

Overview

The L1 contracts, deployed on Ethereum, facilitate cross-domain message passing and maintain the valid state root of the L2: deposits enter the chain through them, withdrawals are proven and finalized against dispute game results, and the chain’s onchain configuration lives in them. The L2 predeploys sit at predetermined addresses in the genesis state and provide the chain’s built-in functionality, from the cross-domain messengers and bridges to the fee vaults and the gas price oracle. For a contract-by-contract tour of both layers, see the smart contract overview. It exists because an OP Stack chain’s security anchors on Ethereum: the bridge, the state proposals that dispute games check, and the withdrawal path that op-challenger defends are all enforced by these contracts. Who runs it: nobody operates op-contracts as a service; the contracts run onchain. Chain operators deploy a chain’s L1 contracts with op-deployer and upgrade them through the OP Contracts Manager, which deploys and upgrades the contracts for a chain in a single transaction.

Get started

How-tos

  • Upgrade using superchain-ops: upgrade a chain’s L1 contracts with the superchain-ops task workflow, the path for chains that require security council signing or a more secure upgrade process.
  • Upgrade L1 contracts using op-deployer: version availability and migration paths for op-deployer’s deprecated upgrade command, which supports upgrades only up to op-contracts/v5.0.0.

Configuration & flags reference

op-contracts has no CLI; its configuration surface is the deployment configuration the contracts are deployed with.

Releases