-
Notifications
You must be signed in to change notification settings - Fork 268
Smart contract section #1563
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
Smart contract section #1563
Changes from 1 commit
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,5 @@ | ||
{ | ||
"smart-contracts": "Smart Contracts", | ||
"smart-contract-upgrades": "Smart Contracts upgrades", | ||
"upgrade-op-contracts-1-6-1-8.mdx": "Upgrade v1.6.0 to v1.8.0" | ||
} |
113 changes: 113 additions & 0 deletions
113
pages/stack/smart-contracts/smart-contract-upgrades.mdx
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,113 @@ | ||
--- | ||
title: Smart Contract upgrades | ||
description: Learn about upgrading the smart contracts that make up the OP Stack. | ||
lang: en-US | ||
content_type: guide | ||
topic: smart-contract-upgrades | ||
personas: | ||
- protocol-developer | ||
- chain-operator | ||
- app-developer | ||
categories: | ||
- mainnet | ||
- protocol | ||
- l1-contracts | ||
- predeploys | ||
- contract-addresses | ||
- contract-upgrades | ||
- architecture | ||
- fault-proofs | ||
is_imported_content: 'false' | ||
--- | ||
|
||
import { Callout } from 'nextra/components' | ||
|
||
# Upgrading Optimism L1 smart contracts | ||
|
||
This guide outlines the definitive process for upgrading Optimism Layer 1 smart contracts using the superchain-ops repository. | ||
|
||
## The superchain-ops repository | ||
|
||
The [superchain-ops repository](https://github.com/ethereum-optimism/superchain-ops/tree/main) is the central hub for all Optimism network upgrades. It contains: | ||
|
||
1. Execution code for deployments | ||
2. Artifacts from previous upgrades | ||
3. Tools for validating and executing new upgrades | ||
|
||
The repository structure is explicitly designed to track all significant network changes that require authorization to execute. When planning an upgrade, you must use this repository. | ||
|
||
## Repository structure requirements | ||
|
||
You must organize your upgrade according to these strict requirements: | ||
|
||
Top level directory names must follow the [EIP-3770](https://eips.ethereum.org/EIPS/eip-3770) short name for the network (e.g., "mainnet", "sepolia"). | ||
|
||
Each task directory must contain: | ||
|
||
* `README.md`: Describing precisely what the task will execute | ||
* `Validation.md`: Detailing the expected state changes with justifications | ||
* A foundry script for post-upgrade assertions: | ||
* Use `SignFromJson.s.sol` for a Safe owned by EOA signers | ||
* Use `NestedSignFromJson.s.sol` for a Safe owned by other Safes | ||
* `input.json`: Defining the exact transaction for execution | ||
* `.env`: Containing all environment variables specific to this task | ||
|
||
See [the repo](https://github.com/ethereum-optimism/superchain-ops/tree/main) for more info. | ||
|
||
## Upgrade process | ||
|
||
Follow these steps to upgrade your smart contracts: | ||
|
||
### Required dependencies | ||
|
||
You must install these tools before beginning: | ||
|
||
* `docker` - Required for containerized execution | ||
* `just` - Required for running script commands | ||
* `foundry` - Required for contract validation | ||
|
||
### Step-by-step workflow | ||
|
||
1. **Set up your environment**: | ||
First, clone the repository with the appropriate branch for your upgrade target: | ||
|
||
```sh | ||
git clone --branch [specific-version-branch] --depth 1 [repository-url] | ||
cd [path-to-upgrade-scripts] | ||
``` | ||
|
||
You must use the specific branch that contains the contract version you're upgrading to. | ||
|
||
2. **Configure your environment variables**: | ||
|
||
```sh | ||
cp .env.example .env | ||
vim .env | ||
``` | ||
|
||
Your .env file must include all necessary configuration parameters. | ||
|
||
3. **Build the Docker image**: | ||
|
||
```sh | ||
just build-image | ||
``` | ||
|
||
You must allocate at least 16GB of memory to Docker or the compilation will fail. The default 8GB is insufficient. | ||
|
||
4. **Run the upgrade task**: | ||
|
||
```sh | ||
just run $(realpath path/to/deploy-config.json) | ||
``` | ||
|
||
Your deploy-config.json must contain the correct configuration values for your target network. | ||
|
||
**CRITICAL:** If your upgrade involves fault proof systems, you must set the correct `faultGameAbsolutePrestate` value. Use the latest value, not the original deployment value. | ||
|
||
## Resources | ||
|
||
* [superchain-ops Repository](https://github.com/ethereum-optimism/superchain-ops) | ||
* [Optimism Monorepo](https://github.com/ethereum-optimism/optimism) | ||
|
||
For detailed installation instructions, see the [superchain-ops README](https://github.com/ethereum-optimism/superchain-ops/tree/main). |
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.