Skip to content

updated the smart contract deployment guide #1585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 75 additions & 30 deletions pages/operators/chain-operators/deploy/smart-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,91 @@ import { Callout, Steps } from 'nextra/components'

# OP Stack smart contract deployment

This guide outlines the process for deploying the OP Stack L1 smart contracts using `op-deployer`.

## Overview

Deploying OP Stack L1 contracts is a critical step in setting up your rollup.

<Callout type="warning">
This page is out of date and shows the legacy method for smart contract deployment.
For the latest recommended method, use [op-deployer](/operators/chain-operators/tools/op-deployer).
Always deploy from official contract releases. You can find official release versions in the
[smart contract overview](/stack/smart-contracts#official-releases). Contract changes are
generally not considered backwards compatible.
</Callout>

The following guide shows you how to deploy the OP Stack L1 smart contracts.
The primary development branch is `develop`, however **you should only deploy
official contract releases**. You can visit the [smart contract overview](/stack/smart-contracts#official-releases)
for the official release versions. Changes to the smart contracts are
generally not considered backwards compatible.
## Deployment workflow

<Steps>
### Install op-deployer

First, install the `op-deployer` tool following the [installation instructions](/operators/chain-operators/tools/op-deployer#installation).

### Create an intent file

Generate an intent file that defines your chain configuration:

```bash
op-deployer init \
--l1-chain-id <chain ID of your L1> \
--l2-chain-ids <comma-separated list of chain IDs for your L2s> \
--workdir .deployer \
--intent-type <standard|custom|standard-overrides>
```

Customize the generated intent file according to your requirements. See the [op-deployer configuration guide](/operators/chain-operators/tools/op-deployer#understanding-the-intenttoml-fields) for details.

### Deploy the contracts

## Deployment configuration
Execute the deployment:

Deploying your OP Stack contracts requires creating a deployment configuration
JSON file. You will create a new deployment configuration file in the following
monorepo subdirectory: [packages/contracts-bedrock/deploy-config](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/deploy-config)
For the full set of deployment configuration options and their meanings, you
can see the [rollup deployment configuration page](/operators/chain-operators/configuration/rollup).
```bash
op-deployer apply --workdir .deployer --l1-rpc-url <rpc-url> --private-key <private key hex>
```

For a detailed explanation of the configuration options and their meanings, refer to the [rollup deployment configuration page](/operators/chain-operators/configuration/rollup).
### Verify contract source code (Optional)

## Using `op-deployer`
Verify your deployed contracts on block explorers:

The recommended way to deploy the L1 smart contracts is with the `op-deployer` tool.
Follow the steps in this [section](/operators/chain-operators/tutorials/create-l2-rollup#using-op-deployer) to learn how it works.
```bash
op-deployer verify \
--l1-rpc-url <l1 rpc url> \
--etherscan-api-key <your free etherscan api key>
```

### Generate chain configuration files

Generate the necessary configuration files for your L2 node:

```bash
op-deployer inspect genesis --workdir .deployer <l2-chain-id> > .deployer/genesis.json
op-deployer inspect rollup --workdir .deployer <l2-chain-id> > .deployer/rollup.json
```
</Steps>

## Contract versioning

The OP Stack follows semantic versioning (X.Y.Z) for contract releases:

* **Major (X):** Breaking changes that require coordination, such as Ecotone or the Fault Proof System
* **Minor (Y):** New features or improvements that maintain backwards compatibility
* **Patch (Z):** Bug fixes and minor improvements

Contract releases are tagged in the repository as `op-contracts/vX.Y.Z`.

<Callout type="info">
For standard chains intended to join the Superchain, always use the latest Optimism Governance approved
release. You can find these in the [Superchain Registry](https://github.com/ethereum-optimism/superchain-registry).
</Callout>

## Version compatibility

## Best practices
When selecting a contract version, consider:

Production users should deploy their L1 contracts from a contracts release.
All contracts releases are on git tags with the following format:
`op-contracts/vX.Y.Z`. If you're deploying a new standard chain, you should
deploy the latest Optimism Governance approved release of the L1 smart contracts with [op-deployer](/operators/chain-operators/tools/op-deployer). This will only initially deploy with permissioned dispute games
enabled.
Starting with permissioned fault proofs gives chain operators time to get comfortable
running the additional infrastructure requirements: [op-challenger](https://github.com/ethereum-optimism/optimism/tree/develop/op-challenger) and
[monitoring](https://github.com/ethereum-optimism/monitorism/tree/main). There are also
additional changes to the economics of operating a permissionless fault proof that chain operators should fully understand.
* L2 Client compatibility: Ensure your chosen contract version is compatible with the op-geth and op-node versions you plan to use
* Feature requirements: Different versions support different features (e.g., only v2.0.0+ supports permissionless fault proofs)
* Security updates: Always prefer the latest patch version within your chosen major.minor version

## Next steps
## Next Steps

* Learn how to [create your genesis file](/operators/chain-operators/deploy/genesis)
* See all [configuration options](/operators/chain-operators/configuration/rollup) and example configurations
* Learn how to [create your genesis file](/operators/chain-operators/deploy/genesis).
* See all [configuration options](/operators/chain-operators/configuration/rollup) and example configurations.
2 changes: 0 additions & 2 deletions words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ Devnet
devnet
Devnets
devnets
Devs

direnv
DISABLETXPOOLGOSSIP
disabletxpoolgossip
Expand Down