This repository was archived by the owner on Apr 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 335
Smart contract section #1563
Merged
Merged
Smart contract section #1563
Changes from 35 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
e799212
Smart contract section
bradleycamacho 31f44c4
Fixes
bradleycamacho 95fb41a
Fix lint
bradleycamacho 5798c3e
Delete page
bradleycamacho 2b7f303
Final edits
bradleycamacho e24ee32
Merge branch 'main' into contract-updates
bradleycamacho 2592df3
breadcrumbs
bradleycamacho 2e8be36
Merge branch 'contract-updates' of https://github.com/ethereum-optimi…
bradleycamacho 821a44a
Fix lint
bradleycamacho e7b621f
Restore op-deployer content
bradleycamacho 29ce7cc
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho 4314609
Merge branch 'main' into contract-updates
bradleycamacho 1777ceb
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho af6ad15
Move superchain-ops doc and create op-deployer doc
bradleycamacho b1c5b13
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho 7e9f4d9
Fix breadcrumbs
bradleycamacho 961ec92
Import steps
bradleycamacho 83546b2
Add links in upgrade overview page
bradleycamacho 3a2f0aa
Implement feedback
bradleycamacho afc447b
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho 2bc5942
small fix
bradleycamacho 8001e14
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho dad9b21
Clarify upgrades
bradleycamacho 6ce9a54
Update 1.3>1.8
bradleycamacho c6e4eac
fix docker references
bradleycamacho cf11fdd
fix title
bradleycamacho c333b2d
Fix docker again
bradleycamacho 71005ab
Fix nav
bradleycamacho d3f60f4
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho 6c5e6cc
Merge branch 'main' into contract-updates
bradleycamacho 24ef5f7
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho e5cced2
Fix checkout
bradleycamacho a528cf1
Remove redundant info
bradleycamacho 45a9539
Add code block formatting
bradleycamacho 29ca519
Implement feedback
bradleycamacho 2ac88ad
Add missing output descriptions
bradleycamacho acf3ccc
Implement feedback and small fixes
bradleycamacho 38be307
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
bradleycamacho b1ce3b1
Update pages/stack/smart-contracts/upgrade-op-contracts-1-3-1-8.mdx
bradleycamacho dabfc54
Update pages/stack/smart-contracts/upgrade-op-contracts-1-3-1-8.mdx
bradleycamacho 046d657
Update pages/stack/smart-contracts/upgrade-op-contracts-1-3-1-8.mdx
bradleycamacho 09715e6
Update pages/stack/smart-contracts/upgrade-op-contracts-1-3-1-8.mdx
bradleycamacho 3ffb217
Update pages/stack/smart-contracts/upgrade-op-contracts-1-3-1-8.mdx
bradleycamacho 8f96d23
Implement feedback
bradleycamacho e782df1
Merge branch 'contract-updates' of https://github.com/ethereum-optimi…
bradleycamacho 2521d60
Merge branch 'main' into contract-updates
bradleycamacho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "smart-contracts": "Smart Contracts", | ||
| "superchain-ops-guide": "Upgrade using superchain-op", | ||
| "op-deployer-upgrade.mdx": "Upgrade using op-deployer", | ||
| "upgrade-op-contracts-1-3-1-8.mdx": "Upgrade OP Contracts v1.3.0 to v1.8.0" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| title: Upgrade L1 contracts using `op-deployer` | ||
| description: Learn about how to upgrade smart contracts using op-deployer | ||
| lang: en-US | ||
| content_type: guide | ||
| topic: smart-contract-overview | ||
| personas: | ||
| - protocol-developer | ||
| - chain-operator | ||
| categories: | ||
| - protocol | ||
| - l1-contracts | ||
| - contract-upgrades | ||
| is_imported_content: 'false' | ||
| --- | ||
|
bradleycamacho marked this conversation as resolved.
|
||
|
|
||
| import { Steps } from 'nextra/components' | ||
|
|
||
| # Upgrade L1 contracts using `op-deployer` | ||
|
|
||
| [`op-deployer`](/operators/chain-operators/tools/op-deployer) simplifies the process of deploying and upgrading the OP Stack. Using the `upgrade` command, you can upgrade a chain from one version to the next. | ||
|
|
||
| It consists of several subcommands, one for each upgrade version. Think of it like a database migration: each upgrade command upgrades a chain from exactly one previous version to the next. A chain that is several versions behind can be upgrade to the latest version by running multiple upgrade commands in sequence. | ||
|
|
||
|
bradleycamacho marked this conversation as resolved.
Outdated
|
||
| Unlike the bootstrap or apply commands, upgrade does not directly interact with the chain. Instead, it generates calldata. You can then use this calldate with cast, Gnosis SAFE, or whatever tooling you use to manage your L1. | ||
|
bradleycamacho marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Limitations of `upgrade` | ||
|
|
||
| There are a few limitations to `upgrade`: | ||
|
|
||
| Using the standard OP Contracts Manager currently requires you to be using the standard shared SuperchainConfig contract. If you're not using this, you will need to utilize the `bootstrap` command to deploy your own Superchain target, including your own `opcm` instance. | ||
|
|
||
| ## Using `upgrade` | ||
|
|
||
| <Steps> | ||
| ### Install `op-deployer` | ||
|
|
||
| [Install `op-deployer`](/operators/chain-operators/tools/op-deployer#installation) from source or pre-built binary. | ||
|
|
||
| ### Create a `config.json` file | ||
|
|
||
| Create a `config.json` file using the following example: | ||
|
|
||
| ```json | ||
| { | ||
| "prank": "<address of the contract of the L1 ProxyAdmin owner>", | ||
| "opcm": "<address of the chain's OPCM>", | ||
| "chainConfigs": [ | ||
| { | ||
| "systemConfigProxy": "<address of the chain's system config proxy>", | ||
| "proxyAdmin": "<address of the chain's proxy admin>", | ||
| "absolutePrestate": "<32-byte hash of the chain's absolute prestate>" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| The standard OPCM instances (`opcm` in the example above) and absolute prestates (`absolutePrestate`) are found in the superchain registry: | ||
|
|
||
| * `opcm`: under `op_contracts_manager` for [Mainnet](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-versions-mainnet.toml) and [Sepolia](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-versions-sepolia.toml). | ||
| * `absolutePrestate`: the `hash` under your [chosen upgrade](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-prestates.toml) | ||
|
|
||
| ### Generate calldata | ||
|
|
||
| Run the following command: | ||
|
|
||
| ```bash | ||
| op-deployer upgrade <version> \ | ||
| --config <path to config JSON> | ||
| ``` | ||
|
|
||
| `version` must be either major release `2.0` or higher. | ||
|
|
||
| The output should look like: | ||
|
|
||
| ```json | ||
| { | ||
| "to": "<maps to the prank address>", | ||
| "data": "<calldata>", | ||
| "value": "0x0" | ||
| } | ||
| ``` | ||
|
|
||
| Now you have the calldata that can be executed onchain to perform the L1 contract upgrade. You should simulate this upgrade and make sure the changes are expected. You can reference the validation files of previously executed upgrade tasks in the [superchain-ops repo](https://github.com/ethereum-optimism/superchain-ops/blob/main/tasks/eth/022-holocene-fp-upgrade/NestedSignFromJson.s.sol) to see what the expected changes are. Once you're confident the state changes are expected, you can sign and execute the upgrade. | ||
| </Steps> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.