diff --git a/components/AskAIButton.tsx b/components/AskAIButton.tsx index 7ce0372c4..344e20d17 100644 --- a/components/AskAIButton.tsx +++ b/components/AskAIButton.tsx @@ -1,15 +1,36 @@ import { RiSparkling2Fill } from '@remixicon/react'; import { useFeature } from '@growthbook/growthbook-react'; +import { useEffect, useState } from 'react'; const AskAIButton = () => { + const [mounted, setMounted] = useState(false); const enableDocsAIWidget = useFeature('enable_docs_ai_widget').on; + + useEffect(() => { + setMounted(true); + }, []); + + // Don't render anything until client-side + if (!mounted) { + return null; + } if (!enableDocsAIWidget) { return null; } return ( - diff --git a/components/WipCallout.tsx b/components/WipCallout.tsx index aaa5b1c57..cebce8d24 100644 --- a/components/WipCallout.tsx +++ b/components/WipCallout.tsx @@ -62,11 +62,8 @@ export function InteropCallout({ context }: Props): ReactElement {
Interop is currently in active development and not yet ready for production use. The information provided here may - change frequently. -

- We recommend checking back regularly for the most up-to-date + change frequently. We recommend checking back regularly for the most up-to-date information. -

)} diff --git a/nouns.txt b/nouns.txt index be98afea6..27f2e07a0 100644 --- a/nouns.txt +++ b/nouns.txt @@ -4,6 +4,8 @@ Ethereum OP Stack MetaMask SuperchainERC20 +SuperchainERC20 Starter Kit +Supersim ZK Security Council Sequencer PBS diff --git a/package.json b/package.json index 45bdd9704..525cfc6e0 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "fix": "eslint . --ext mdx --fix && pnpm spellcheck:fix && pnpm breadcrumbs && pnpm fix-redirects", "spellcheck:lint": "cspell lint \"**/*.mdx\"", "spellcheck:fix": "cspell --words-only --unique \"**/*.mdx\" | sort --ignore-case | uniq > words.txt", + "linkcheck": "lychee --config ./lychee.toml --quiet \"./pages\"", "breadcrumbs": "npx ts-node --skip-project utils/create-breadcrumbs.ts", "check-redirects": "npx ts-node --skip-project utils/redirects.ts", "fix-redirects": "npx ts-node --skip-project utils/fix-redirects.ts", diff --git a/pages/app-developers/_meta.json b/pages/app-developers/_meta.json index d5afc0cfe..4401826db 100644 --- a/pages/app-developers/_meta.json +++ b/pages/app-developers/_meta.json @@ -3,10 +3,35 @@ "title": "App Developers", "type": "separator" }, - "overview": "Overview", - "quick-start": "Superchain app quick start", - "tutorials": "Tutorials", - "transactions": "Transactions", + "get-started": "Getting started", + "starter-kit": "SuperchainERC20 starter kit", + "interop": "Interoperability", + "building-apps": "Building apps on the Superchain", + "testing-apps": "Testing apps for the Superchain", "bridging": "Bridging", - "tools": "App tools" + "transactions": "Transactions", + "+++ Tutorials": { + "title": "", + "type": "separator" + }, + "--- Tutorials": { + "title": "Tutorials", + "type": "separator" + }, + "tutorials": { + "title": "Tutorials", + "display": "children" + }, + "+++ DevTools": { + "title": "", + "type": "separator" + }, + "--- DevTools": { + "title": "Developer tools", + "type": "separator" + }, + "tools": { + "title": "Developer tools", + "display": "children" + } } diff --git a/pages/app-developers/bridging.mdx b/pages/app-developers/bridging.mdx index 4bec707f9..b5c79ad8f 100644 --- a/pages/app-developers/bridging.mdx +++ b/pages/app-developers/bridging.mdx @@ -1,18 +1,24 @@ --- -title: Bridging +title: Bridging guides lang: en-US description: Learn about bridging basics, custom bridges, data transmission between L1 and L2, and using the standard bridge in OP Stack. --- import { Card, Cards } from 'nextra/components' -# Bridging +# Bridging guides -This section provides information on bridging basics, custom bridges, sending data between l1 and l2 and using the standard bridge. You'll find guide, overview to help you understand and work with these topics. +Looking to build an application that sends ETH, tokens, or data between OP Mainnet and Ethereum? +You'll find some useful guides and tutorials in this area of the docs. +For instance, if you want to learn how to bridge a token from Ethereum to OP Mainnet (or vice versa!), you should check out the [Standard Token Bridge](bridging/standard-bridge). + +If you're looking for something more advanced, take a look at the guide on [sending data between L1 and L2](bridging/messaging). +Contracts on one chain can trigger contract functions on the other chain, which is pretty cool! +The Standard Token Bridge for OP Mainnet even uses this same message-passing infrastructure under the hood. - - - - + } /> + } /> + } /> + } /> diff --git a/pages/app-developers/bridging/basics.mdx b/pages/app-developers/bridging/basics.mdx index 33af955f9..9969444a0 100644 --- a/pages/app-developers/bridging/basics.mdx +++ b/pages/app-developers/bridging/basics.mdx @@ -28,7 +28,7 @@ All of this is easily accessible with a simple, clean API. Ready to start bridging? Check out these tutorials to get up to speed fast. -* [Learn how to bridge ERC-20 tokens with viem](/app-developers/tutorials/cross-dom-bridge-erc20) -* [Learn how to bridge ETH with viem](/app-developers/tutorials/cross-dom-bridge-eth) -* [Learn how to create a standard bridged token](/app-developers/tutorials/standard-bridge-standard-token) -* [Learn how to create a custom bridged token](/app-developers/tutorials/standard-bridge-custom-token) +* [Learn how to bridge ERC-20 tokens with viem](/app-developers/tutorials/bridging/cross-dom-bridge-erc20) +* [Learn how to bridge ETH with viem](/app-developers/tutorials/bridging/cross-dom-bridge-eth) +* [Learn how to create a standard bridged token](/app-developers/tutorials/bridging/standard-bridge-standard-token) +* [Learn how to create a custom bridged token](/app-developers/tutorials/bridging/standard-bridge-custom-token) diff --git a/pages/app-developers/bridging/custom-bridge.mdx b/pages/app-developers/bridging/custom-bridge.mdx index 50773f398..7488b42f0 100644 --- a/pages/app-developers/bridging/custom-bridge.mdx +++ b/pages/app-developers/bridging/custom-bridge.mdx @@ -15,7 +15,7 @@ This guide provides important information you should be aware of when building a Custom bridges can bring a significant amount of complexity and risk to any project. Before you commit to a custom bridge, be sure that the [Standard Bridge](./standard-bridge) definitely does not support your use case. - [Building a custom bridged token](/app-developers/tutorials/standard-bridge-custom-token) is often sufficient for projects that need more flexibility. + [Building a custom bridged token](/app-developers/tutorials/bridging/standard-bridge-custom-token) is often sufficient for projects that need more flexibility. ## Guidelines diff --git a/pages/app-developers/bridging/messaging.mdx b/pages/app-developers/bridging/messaging.mdx index 3a1e10449..98a49b1f4 100644 --- a/pages/app-developers/bridging/messaging.mdx +++ b/pages/app-developers/bridging/messaging.mdx @@ -13,7 +13,7 @@ This page explains how bridging works, how to use it, and what to watch out for. This is a high-level overview of the bridging process. - For a step-by-step tutorial on how to send data between L1 and L2, check out the [Solidity tutorial](/app-developers/tutorials/cross-dom-solidity). + For a step-by-step tutorial on how to send data between L1 and L2, check out the [Solidity tutorial](/app-developers/tutorials/bridging/cross-dom-solidity). ## Understanding contract calls diff --git a/pages/app-developers/bridging/standard-bridge.mdx b/pages/app-developers/bridging/standard-bridge.mdx index a748d38e5..ed7dae356 100644 --- a/pages/app-developers/bridging/standard-bridge.mdx +++ b/pages/app-developers/bridging/standard-bridge.mdx @@ -199,10 +199,10 @@ Users simply need to trigger and send ETH to the [`bridgeETH`](https://github.co ## Tutorials -* [Learn how to bridge ERC-20 tokens with viem](/app-developers/tutorials/cross-dom-bridge-erc20) -* [Learn how to bridge ETH with viem](/app-developers/tutorials/cross-dom-bridge-eth) -* [Learn how to create a standard bridged token](/app-developers/tutorials/standard-bridge-standard-token) -* [Learn how to create a custom bridged token](/app-developers/tutorials/standard-bridge-custom-token) +* [Learn how to bridge ERC-20 tokens with viem](/app-developers/tutorials/bridging/cross-dom-bridge-erc20) +* [Learn how to bridge ETH with viem](/app-developers/tutorials/bridging/cross-dom-bridge-eth) +* [Learn how to create a standard bridged token](/app-developers/tutorials/bridging/standard-bridge-standard-token) +* [Learn how to create a custom bridged token](/app-developers/tutorials/bridging/standard-bridge-custom-token) ## Superchain Token List diff --git a/pages/app-developers/getting-started.mdx b/pages/app-developers/building-apps.mdx similarity index 95% rename from pages/app-developers/getting-started.mdx rename to pages/app-developers/building-apps.mdx index 81fd2d838..57ecffb24 100644 --- a/pages/app-developers/getting-started.mdx +++ b/pages/app-developers/building-apps.mdx @@ -1,12 +1,12 @@ --- -title: Getting started developing for OP Stack chains +title: Building apps on the Superchain lang: en-US -description: Learn the basics of OP Stack development. +description: Learn the basics of building apps on the Superchain. --- import { Steps } from 'nextra/components' -# Getting started developing for OP Stack chains +# Building apps on the Superchain This guide explains the basics of OP Stack development. OP Stack chains are [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), meaning they run a slightly modified version of the same `geth` you run on mainnet. diff --git a/pages/app-developers/get-started.mdx b/pages/app-developers/get-started.mdx new file mode 100644 index 000000000..ed8ee8db8 --- /dev/null +++ b/pages/app-developers/get-started.mdx @@ -0,0 +1,71 @@ +--- +title: Build interoperable apps on Superchain devnet +lang: en-US +description: Learn about deploying contracts, cross-chain messaging, and tutorials to help you build applications on the Superchain. +--- + +import { Cards, Card, Callout } from 'nextra/components' + +# Build interoperable apps on Superchain devnet + +Reimagine your app with Superchain Interop to deliver the unified UX your users expect. Hack on net-new, bold use cases on Interop devnet. + + + Explore the [Superchain Dev Console](https://console.optimism.io/) to build, launch, and grow your app on the Superchain. + + +## Connect to Superchain Interop + +Select a network to build, test, and quickly iterate on interoperable apps. + +| Local network | Devnet | +| :-------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | +| Build and iterate on your apps with Supersim – a local multi-chain dev environment. | Deploy your app to devnet – a testnet developmental version – to conduct large-scale testing. | +| | | +| [Supersim](tutorials/supersim) | [Devnet Docs](/stack/interop/tools/devnet) | + +## Deploy your app to devnet in minutes + +The SuperchainERC20 Starter Kit allows you to focus on what to deploy, not how to deploy. It's a streamlined toolkit that simplifies deploying your interoperable app, letting you focus on your core business logic. + +* [Get the Starter Kit](starter-kit) + +## Tools & resources for building interoperable apps + +| Tool | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| [Supersim](tools/supersim) | Local multi-chain testing environment for smart contracts. | +| [Super CLI](https://github.com/ethereum-optimism/super-cli) | Command-line tool for seamless multichain app deployment and testing. | +| [Superchain Relayer](https://github.com/ethereum-optimism/superchain-relayer) | UI for monitoring and managing cross-chain transactions. | +| [Interop Docs](/stack/interop) | Comprehensive Interop information in the Optimism Docs. | +| [Superchain Dev Console](https://console.optimism.io/) | Comprensive tool to build, launch, and grow your app on the Superchain. | + +## Handy step-by-step guides + + + } /> + + } /> + + } /> + + } /> + + } /> + + +## Discover and build net-new use cases with Superchain Interop + +There is so much more than just bridge abstraction. Hack on the various cutting-edge applications that are uniquely enabled by Superchain Interop. Here are some ideas to get you started: + +| Superloans | Superlend | SuperCDP | +| :--------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------- | +| Use collateral on ChainA and ChainB to execute an arbitrage opportunity on ChainA. | Deposit ETH into lending protocols across chains for optimal yield, with automatic rebalancing based on best rates. | Collateralized crosschain debt protocol that holds assets and issues a SuperchainERC20 on user preferred chains. | + +* [Join the Super Hackathon at ETH Denver 2024](https://www.ethdenver.com/) + +## Join app dev community and build together + +Join the OP Labs team and fellow Superchain Interop builders to share ideas, provide feedback, ask questions, and get the [support](https://github.com/ethereum-optimism/developers/discussions) you need. + +* [Join Discord community](https://discord.gg/optimism) diff --git a/pages/app-developers/interop.mdx b/pages/app-developers/interop.mdx new file mode 100644 index 000000000..3a996050c --- /dev/null +++ b/pages/app-developers/interop.mdx @@ -0,0 +1,9 @@ +--- +title: Getting started with the OP Stack +lang: en-US +description: Learn the basics of OP Stack development. +--- + +import InteropExplainer from '@/pages/stack/interop/explainer.mdx' + + diff --git a/pages/app-developers/overview.mdx b/pages/app-developers/overview.mdx deleted file mode 100644 index 0b7f02c46..000000000 --- a/pages/app-developers/overview.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: App developer overview -lang: en-US -description: Learn about deploying contracts, cross-chain messaging, and tutorials to help you build applications on OP Mainnet. ---- - -import { Cards, Card } from 'nextra/components' - -# App developer overview - -If you're a developer looking to build on OP Mainnet, you've come to the right place. -In this area of the Optimism Docs you'll find everything you need to know about building OP Mainnet applications. - -## Getting started - -If you're brand new to OP Mainnet, try starting with the guide on [deploying a basic contract](/app-developers/getting-started). -It'll get you familiar with the basic steps required to get a contract deployed to the network. -OP Mainnet is [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306) so you can feel confident that your existing Ethereum smart contract skills will carry over to OP Mainnet. -Just make sure to be aware of the few small [differences between Ethereum and OP Mainnet](/stack/differences). - -You might also want to check out the [testing on OP Networks guide](/app-developers/testing-apps) and the tutorial on [running a local development environment](/stack/dev-node) to help you feel totally confident in your OP Mainnet deployment. - - - } /> - - } /> - - } /> - - -## Bridging and messaging - -Looking to build an application that sends ETH, tokens, or data between OP Mainnet and Ethereum? -You'll find some useful guides and tutorials in this area of the docs. -For instance, if you want to learn how to bridge a token from Ethereum to OP Mainnet (or vice versa!), you should check out the [Standard Token Bridge](bridging/standard-bridge). - -If you're looking for something more advanced, take a look at the guide on [sending data between L1 and L2](bridging/messaging). -Contracts on one chain can trigger contract functions on the other chain, it's pretty cool! -The Standard Token Bridge for OP Mainnet even uses this same message-passing infrastructure under the hood. - - - } /> - - } /> - - } /> - - -## Tutorials - -If you're a bit more familiar with OP Mainnet and Ethereum, you can try walking through one of the tutorials put together by the Optimism community. -They'll help you get a head start when building your first Optimistic project. - -| Tutorial Name | Description | Difficulty Level | -| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| [Deploying Your First Contract on OP Mainnet](tutorials/first-contract) | Learn how to deploy your first contract to OP Mainnet with Remix and MetaMask. | 🟢 Easy | -| [Bridging ETH With viem](tutorials/cross-dom-bridge-eth) | Learn how to use viem to transfer ETH between Layer 1 (Ethereum or Sepolia) and Layer 2 (OP Mainnet or OP Sepolia). | 🟢 Easy | -| [Bridging ERC-20 Tokens With viem](tutorials/cross-dom-bridge-erc20) | Learn how to use viem to transfer ERC-20 tokens between Layer 1 (Ethereum or Sepolia) and Layer 2 (OP Mainnet or OP Sepolia). | 🟢 Easy | -| [Bridging your Standard ERC-20 token using the Standard Bridge](tutorials/standard-bridge-standard-token) | Learn how to bridge your standard ERC-20 token to layer 2 using the standard bridge. | 🟡 Medium | -| [Bridging your Custom ERC-20 token using the Standard Bridge](tutorials/standard-bridge-custom-token) | Learn how to bridge your custom ERC-20 token to layer 2 using the standard bridge. | 🟡 Medium | -| [Tracing Deposits and Withdrawals with viem](tutorials/sdk-trace-txns) | Learn how to use viem to trace deposits and withdrawals. | 🟢 Easy | -| [Viewing Deposits and Withdrawals by address with viem](tutorials/sdk-view-txns) | Learn how to use viem to view deposits and withdrawals by address. | 🟢 Easy | -| [Estimating Transaction Costs With the viem](tutorials/sdk-view-txns) | Learn how to use viem to estimate the cost of a transaction on OP Mainnet. | 🟢 Easy | -| [Sending OP Mainnet Transactions from Ethereum](tutorials/send-tx-from-eth) | Learn how to send transactions to OP Mainnet from Ethereum. | 🟢 Easy | - -You can also [suggest a new tutorial](https://github.com/ethereum-optimism/docs/issues/new?assignees=\&labels=tutorial%2Cdocumentation%2Ccommunity-request\&projects=\&template=suggest_tutorial.yaml\&title=%5BTUTORIAL%5D+Add+PR+title) if you have something specific in mind. We'd love to grow this list! - -## Next steps - -If you still can't find the content you're looking for, there's a few options to get extra help. - -* You can [ask a question in the Optimism developer support forum](https://github.com/ethereum-optimism/developers/discussions). -* If you run into any problems during deployment, visit the [Transactions Troubleshooting Guide](./transactions/troubleshooting) for help. diff --git a/pages/app-developers/quick-start.mdx b/pages/app-developers/quick-start.mdx deleted file mode 100644 index 621ae28fd..000000000 --- a/pages/app-developers/quick-start.mdx +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: Superchain app quick start -lang: en-US -description: Learn how to quickly build and deploy an app to any OP Chain using Scaffold-OP. ---- - -import { Callout, Steps } from 'nextra/components' -import Image from 'next/image' -import { Tabs } from 'nextra/components' - -# Superchain App quick start - -This quick start walks you through an easy three-step process to deploy an app to any OP Chain – in under 15 minutes. -This quick start uses [`Scaffold-OP`](https://github.com/ethereum-optimism/scaffold-op) to build the Superchain App, covers the setup process, and links to more detailed guides, so you can dive a bit deeper when needed. - -## Step 1: Get Testnet ETH from Superchain Faucet - -You'll need some testnet ETH on OP Sepolia to pay for the [gas fees](https://ethereum.org/en/developers/docs/gas/) associated with deploying your test application. -Use the [Optimism Superchain Faucet](https://console.optimism.io/faucet?utm_source=scaffoldop) to get some free ETH on OP Sepolia for multiple OP Chains with just one click. -You can request testnet ETH from the Superchain Faucet in one of two ways: **connect a wallet** or **login with Github**. - -Superchain Faucet sign-up options - -* If you **connect a wallet with an Optimist NFT**, you can get up to 1 testnet ETH per network every 24 hours. -* If you **login with Github**, you can get up to 0.05 testnet ETH per day. - - - Looking for more faucets? - You can also try using [other available OP Sepolia faucets](/app-developers/tools/build/faucets). - - -## Step 2: Build a basic app with Scaffold-OP - -Scaffold-OP is a fork of [`scaffold-ETH2`](https://docs.scaffoldeth.io/) with minimal differences: additional app examples, native support for Superchain testnets, and more low-level instructions. -Scaffold-OP is an open-source toolkit for building decentralized applications on the Ethereum blockchain and is designed to make it easier for developers to create and deploy smart contracts and -build user interfaces that interact with those contracts. - -Scaffold-OP Landing Page - -### Prerequisites - -Before you begin, you need to install the following tools: - -* [node v18.17 or higher](https://nodejs.org/en/download/) -* yarn [v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install) -* [git](https://git-scm.com/downloads) - - - {

Clone the Repo & Install Dependencies

} - - ```sh - git clone https://github.com/ethereum-optimism/scaffold-op.git - cd scaffold-op - yarn install - ``` - - {

Run a Local Network

} - - Use the first terminal to run a local network: - - ```sh - yarn chain - ``` - - This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. - You can customize the network configuration in `hardhat.config.ts`. - - {

Deploy the Test Contract

} - - Use the second terminal to deploy the contract: - - ```sh - yarn deploy - ``` - - This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. - The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. - - - You can also customize the deploy script to **add a new contract** by following these instructions: - - * Create a corresponding deployment file in `package/hardhat/deploy` to specify the deployment process. - * For simpler contract deployment: copy over an existing deployment script in the deploy folder and modify the file name and variables. - * For more advanced usage: refer to [Hardhat's deployment docs](https://github.com/wighawag/hardhat-deploy?tab=readme-ov-file#deploymentsdeployname-options) to see what parameters you can specify. - - - {

Start your NextJS App

} - - Use the second terminal to start your NextJS app: - - ```sh - yarn start - ``` - - * Visit your app on `http://localhost:3000`. - * You can interact with your smart contract using the `Debug Contracts` page. You can tweak the app configuration in `packages/nextjs/scaffold.config.ts`. - - Scaffold-OP Debug Contracts page - - Run smart contract test with `yarn hardhat:test` - - * Edit your smart contract `YourContract.sol` in `packages/hardhat/contracts` - * Edit your frontend in `packages/nextjs/pages` - * Edit your deployment scripts in `packages/hardhat/deploy` -
- -## Step 3: Deploy contracts to Superchain Testnets - -You will follow the steps below to deploy contracts to a remote testnet (e.g., Optimism Sepolia). -Please ensure you have enough Sepolia ETH on all these Superchains before deploying (See [Step 1 above](#step-1-get-testnet-eth-from-superchain-faucet)). - - - {

Make the `.env` file

} - - Inside the `packages/hardhat` directory, copy `.env.example` to `.env.` - - ```sh - cd packages/hardhat && cp .env.example .env - ``` - - {

Specify the Environment Variables

} - - Edit your `.env` to specify the environment variables. At a minimum, you must specify the `DEPLOYER_PRIVATE_KEY`. - - ```sh - DEPLOYER_PRIVATE_KEY = "your_private_key_with_sepolia_ETH"; - ``` - - - The contract will be deployed from the address associated with this private key, so make sure it has enough Sepolia ETH (See [Step 1 above](#step-1-get-testnet-eth-from-superchain-faucet)). - - - {

Deploy Smart Contracts to Selected Networks

} - - This step deploys all smart contracts in `packages/hardhat/contracts` to the selected network(s). Network names are found in `hardhat.config.js`. - - * Inside `scaffold-op`, run one of the following options: - - - - ```sh - yarn deploy --network-options - ``` - - - - ```sh - yarn deploy --network networkName - ``` - - - - * Use spacebar to make your selection(s). - - - If the deployments are successful, you will see the deployment transaction hash on the terminal. - -
- -Congratulations! You now have an OP Mainnet app ready for development, which can also be deployed to more OP Chains! 🎉 - -## Next steps - -* Share feedback about this quick start or `scaffold-op` in the [developer forum](https://github.com/ethereum-optimism/developers/discussions/262). -* You can also [add Foundry to Scaffold-OP](https://github.com/ethereum-optimism/scaffold-op?tab=readme-ov-file#adding-foundry) for more robust and faster testing. -* Visit the [app developer tutorials](overview#tutorials) for guides on how to add bridging, wallet features, and L1-to-L2 transactions. diff --git a/pages/app-developers/starter-kit.mdx b/pages/app-developers/starter-kit.mdx new file mode 100644 index 000000000..684f0831d --- /dev/null +++ b/pages/app-developers/starter-kit.mdx @@ -0,0 +1,140 @@ +--- +title: Deploying a SuperchainERC20 (Starter Kit) +lang: en-US +description: Learn how to quickly build and deploy a SuperchainERC20 token across the Superchain using the SuperchainERC20 Starter Kit. +--- + +import { Callout, Steps } from 'nextra/components' +import Image from 'next/image' +import { Tabs } from 'nextra/components' + +# Deploying a SuperchainERC20 (Starter Kit) + +The [SuperchainERC20 Starter Kit](https://github.com/ethereum-optimism/superchainerc20-starter) is a development toolkit designed to simplify the creation, deployment, and testing of SuperchainERC20 tokens. It leverages cross-chain interoperability for the deployment of ERC20 tokens that can be used across different blockchains in the Superchain ecosystem. + +## How it works + +Here's a breakdown of what's under the hood: + +* **Cross-Chain Interoperability**: SuperchainERC20 tokens can move across multiple chains. This is possible by using the IERC7802 interface, which lets tokens be minted on one chain and burned on another to maintain a consistent supply. + +* **Superchain Network**: The Superchain is a network of connected blockchains, allowing smooth data and asset flow. By using Optimism's scaling solutions, the Superchain reduces gas fees and speeds up transactions. + +* **Deployment**: The kit helps deploy SuperchainERC20 tokens on Ethereum-compatible chains, including setting up contracts, minting, burning, and cross-chain communication. + +* **Testing**: Test scripts simulate real token transfers across chains to ensure everything works properly before going live. + +## Setup + + + ### Install `foundry` + + `supersim` requires `anvil` to be installed. + + Follow the [Foundry toolchain](https://book.getfoundry.sh/getting-started/installation) guide for detailed instructions. + + ### Clone the repo + + Next, you need to clone and navigate to the repo: + + ```sh + git clone git@github.com:ethereum-optimism/superchainerc20-starter.git + cd superchainerc20-starter + ``` + + ### Install dependencies + + Install project dependencies using `pnpm`: + + ```sh + pnpm i + ``` + + ### Initialize .env files + + ```sh + pnpm init:env + ``` + + ### Start the development environment + + This command will: + + * Start the `supersim` local development environment + * Deploy the smart contracts to the test networks + * Launch the example frontend application + + ```sh + pnpm dev + ``` + + +## Deploy SuperchainERC20s + + + ### Configure RPC urls + + This repository includes a script to automatically fetch the public RPC URLs for each chain listed in the [Superchain Registry](https://github.com/ethereum-optimism/superchain-registry/blob/main/chainList.json) and add them to the `[rpc_endpoints]` configuration section of `foundry.toml`. + + The script ensures that only new RPC URLs are appended, preserving any URLs already present in `foundry.toml`. To execute this script, run: + + ```sh + pnpm contracts:update:rpcs + ``` + + ### Modify deploy config parameters + + The deployment configuration for token deployments is managed through the `deploy-config.toml` file. Below is a detailed breakdown of each configuration section: + + #### `[deploy-config]` + + This section defines parameters for deploying token contracts. + + | Parameter | Description | Example | + | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | + | `salt` | A unique identifier used for deploying token contracts via \[`Create2`]. This value along with the contract bytecode ensures that contract deployments are deterministic. | `salt = "ethers phoenix"` | + | `chains` | Lists the chains where the token will be deployed. Each chain must correspond to an entry in the `[rpc_endpoints]` section of `foundry.toml`. | `chains = ["op_chain_a","op_chain_b"]` | + + #### `[token]` + + Deployment configuration for the token that will be deployed. + + | Parameter | Description | Example | + | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | + | `owner_address` | The address designated as the owner of the token. The `L2NativeSuperchainERC20.sol` contract included in this repo extends the [`Ownable`](https://github.com/Vectorized/solady/blob/c3b2ffb4a3334ea519555c5ea11fb0e666f8c2bc/src/auth/Ownable.sol) contract. | `owner_address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"` | + | `name` | The token's name. | `name = "TestSuperchainERC20"` | + | `symbol` | The token's symbol. | `symbol = "TSU"` | + | `decimals` | The number of decimal places the token supports. | `decimals = 18` | + + ### Deploy a token + + * Before proceeding, ensure that your `deploy-config.toml` file is fully configured (see the [Modify Deploy Config Parameters](#modify-deploy-config-parameters) section setup details). + * Also, confirm that the `[rpc_endpoints]` section in `foundry.toml` is properly set up by following the instructions in [Configure RPC urls](#configure-rpc-urls). + + + Deployments are executed through the `SuperchainERC20Deployer.s.sol` script. This script deploys tokens across each specified chain in the deployment configuration using `Create2`, ensuring deterministic contract addresses for each deployment. The script targets the `L2NativeSuperchainERC20.sol` contract by default. If you need to modify the token being deployed, either update this file directly or point the script to a custom token contract of your choice. + + + * To execute a token deployment run: + + ```sh + pnpm contracts:deploy:token + + ``` + + +## Best practices for deploying SuperchainERC20 + +### Use `Create2` to deploy SuperchainERC20 + +`Create2` ensures that the address is deterministically determined by the bytecode of the contract and the provided salt. This is crucial because in order for cross-chain transfers of `SuperchainERC20`s to work with interop, the tokens must be deployed at the same address across all chains. + +### Set safe `crosschainMint` and `crosschainBurn` permissions + +For best security practices `SuperchainERC20Bridge` should be the only contract with permission to call `crosschainMint` and `crosschainBurn`. These permissions are set up by default when using the `SuperchainERC20` contract. + +## Next Steps + +* Test your token deployment on multiple chains using [Supersim](/app-developers/tools/supersim) and run simple [end-to-end integration tests](https://github.com/ethereum-optimism/superchainerc20-starter/blob/main/README.md#-e2e-tests). +* For specific use cases, check out our guides for [bridging a SuperchainERC20 token to another chain](https://github.com/ethereum-optimism/superchainerc20-starter/blob/main/README.md#-example-how-to-bridge-a-superchainerc20-token-to-another-chain) or [modifying an existing ERC20 contract to be interoperable](https://github.com/ethereum-optimism/superchainerc20-starter/blob/main/README.md#updating-an-erc20-contract-to-be-interoperable). +* Questions about Interop? Check out our collection of [interop guides](/stack/interop) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). diff --git a/pages/app-developers/testing-apps.mdx b/pages/app-developers/testing-apps.mdx index 81ce7f19a..55c160f94 100644 --- a/pages/app-developers/testing-apps.mdx +++ b/pages/app-developers/testing-apps.mdx @@ -1,10 +1,10 @@ --- -title: Testing apps for OP Stack chains +title: Testing apps for the Superchain lang: en-US -description: Learn best practices for OP Stack testing. +description: Learn best practices for testing apps on the Superchain. --- -# Testing apps for OP Stack chains +# Testing apps for the Superchain For the most part, running applications on OP Stack chains is identical to running them on Ethereum, so the testing is identical too. In this guide, you learn the best practices for OP Stack testing where there are differences. @@ -17,20 +17,18 @@ Most Ethereum development stacks include features that make testing easier, whic Therefore, it is a good idea to run the majority of tests, which do not rely on OP Stack-specific features, in the development stack. It is a lot faster. -It is a best practice to design and run thorough tests across an OP test network, either in your [local development environment](dev-node) or on [the test network](/superchain/networks#op-sepolia), depending on your use case. +It is a best practice to design and run thorough tests across an OP test network, either in your [local multichain development environment](/app-developers/tools/supersim), our [devnets](/stack/public-devnets), or on [the test network](/superchain/networks#op-sepolia), depending on your use case. Running proper testing is key to identifying fringe cases where the equivalence between OP Stack chains and Ethereum breaks down (or where Ethereum mainnet itself and the development stack may be non-equivalent in a production environment). ## Multilayer integration tests Some apps need OP Stack-specific features that aren't available as part of the development stack. -For example, if your decentralized application relies on [inter-domain communication](/app-developers/bridging/messaging), the effort of developing a stub to let you debug it in a development stack is probably greater than the hassle of having the automated test go to [a local development environment](dev-node) each time. +For example, if your decentralized application relies on [inter-domain communication](/app-developers/bridging/messaging), the effort of developing a stub to let you debug it in a development stack is probably greater than the hassle of having the automated test go to [a local multichain development environment](/app-developers/tools/supersim) each time. ## Integration with other products In many cases a decentralized application requires the services of other contracts. For example, [Perpetual v. 2](https://docs.perp.com/docs/guides/integration-guide) cannot function without [Uniswap v. 3](https://uniswap.org/blog/uniswap-v3). -If that is the case you can use [mainnet forking](https://hardhat.org/hardhat-network/guides/mainnet-forking.html). - -It works with OP Stack chains. -Alternatively, you can connect to our [test network](/superchain/networks#op-sepolia) if those contracts are also deployed there (in many cases they are). +* If that is the case, you can use [mainnet forking](/app-developers/tutorials/supersim/reference/fork). It works with OP Stack chains. +* Alternatively, you can connect to our [test network](/superchain/networks#op-sepolia) if those contracts are also deployed there (in many cases they are). diff --git a/pages/app-developers/tools.mdx b/pages/app-developers/tools.mdx index fd20891c6..cffd29c08 100644 --- a/pages/app-developers/tools.mdx +++ b/pages/app-developers/tools.mdx @@ -1,21 +1,58 @@ --- -title: Tools +title: App developer tools lang: en-US -description: Information on open-source code repositories for OP Stack builders and SuperSim. +description: Learn about app developer tools for the OP Stack. --- import { Card, Cards } from 'nextra/components' -# Tools +# App developer tools -This section provides information on open-source code repositories for OP Stack builders and SuperSim. Users will find references to help understand and work with these topics. +Welcome to the app developer tools! + +If you are already familiar with [building on the OP Stack](/stack/getting-started) and just need the tools to get cracking, you are in the right place! + +## Connecting - - - - - - - + } /> + + } /> + + } /> + + + +## Building + + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> diff --git a/pages/app-developers/tools/_meta.json b/pages/app-developers/tools/_meta.json index c194edc71..2fec35a97 100644 --- a/pages/app-developers/tools/_meta.json +++ b/pages/app-developers/tools/_meta.json @@ -1,7 +1,10 @@ { - "overview": "Overview", + "console": { + "title": "Superchain Dev Console", + "href": "https://console.optimism.io/?utm_source=docs", + "newWindow": true + }, + "supersim": "Supersim Multichain Dev Env", "connect": "Connecting", - "build": "Building", - "monitor": "Monitoring", - "op-tools": "OP tools" + "build": "Building" } diff --git a/pages/app-developers/tools/build.mdx b/pages/app-developers/tools/build.mdx index 7d3d47d24..0a26b9bfc 100644 --- a/pages/app-developers/tools/build.mdx +++ b/pages/app-developers/tools/build.mdx @@ -1,25 +1,39 @@ --- -title: Build +title: Build tools lang: en-US -description: >- - Learn about build in the Optimism ecosystem. This guide provides detailed - information and resources about build. +description: This guide provides detailed information and resources about building in the Optimism ecosystem. --- import { Card, Cards } from 'nextra/components' -# Build +# Build tools -This section provides information on account abstraction, block explorers, testnet faucets, op mainnet nft tools and oracles. You'll find guide, reference, tool, api to help you understand and work with these topics. +This section provides information on account abstraction, block explorers, testnet faucets, OP Mainnet NFT tools and oracles. You'll find guide, reference, tool, API to help you understand and work with these topics. - - + } /> - + } /> - + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> + + } /> - diff --git a/pages/app-developers/tools/build/_meta.json b/pages/app-developers/tools/build/_meta.json index cbd6ef41d..c6a61f289 100644 --- a/pages/app-developers/tools/build/_meta.json +++ b/pages/app-developers/tools/build/_meta.json @@ -3,5 +3,23 @@ "oracles": "Oracles", "nft-tools": "NFT tools", "block-explorers": "Block explorers", - "account-abstraction": "Account abstraction" + "account-abstraction": "Account abstraction", + "ecosystem-overview": "Ecosystem Repo", + "analytics-tools": "Analytics Tools", + "bridge": { + "title": "Superchain bridges", + "href": "https://app.optimism.io/bridge", + "newWindow": true + }, + "gas": { + "title": "Gas tracker", + "type": "page", + "href": "https://optimistic.grafana.net/public-dashboards/c84a5a9924fe4e14b270a42a8651ceb8?orgId=1&refresh=5m", + "newWindow": true + }, + "block-explorer": { + "title": "OP Mainnet explorer", + "href": "https://optimistic.etherscan.io/", + "newWindow": true + } } \ No newline at end of file diff --git a/pages/app-developers/tools/monitor/analytics-tools.mdx b/pages/app-developers/tools/build/analytics-tools.mdx similarity index 100% rename from pages/app-developers/tools/monitor/analytics-tools.mdx rename to pages/app-developers/tools/build/analytics-tools.mdx diff --git a/pages/app-developers/tools/build/block-explorers.mdx b/pages/app-developers/tools/build/block-explorers.mdx index 2da83f348..bdda0e70f 100644 --- a/pages/app-developers/tools/build/block-explorers.mdx +++ b/pages/app-developers/tools/build/block-explorers.mdx @@ -68,7 +68,7 @@ Once Upon currently supports: ## Access to pre-regenesis history Because of our final regenesis on 11 November 2021, older transactions are not part of the current blockchain and do not appear on [Etherscan](https://explorer.optimism.io/). -However, you **can** access transaction history between 23 June 2021 and the final regenesis using a number of different tools. For detailed instructions, see [Regenesis History](/app-developers/tools/monitor/regenesis-history). +However, you **can** access transaction history between 23 June 2021 and the final regenesis using a number of different tools. For detailed instructions, see [Regenesis History](/operators/node-operators/management/regenesis-history). ## Inclusion criteria @@ -84,4 +84,4 @@ You can also promote your tool in the [developer forum](https://github.com/ether ## Next Steps * Please visit the [community block explorers page](https://github.com/ethereum-optimism/developers/blob/main/community/tools/block-explorers.md) for a listing of third-party block explorers used by the Optimism developer community. -* Looking for other developer tools? See [developer tools overview](/app-developers/tools/overview) to explore more options! +* Looking for other developer tools? See [developer tools overview](/app-developers/tools) to explore more options! diff --git a/pages/app-developers/tools/ecosystem-overview.mdx b/pages/app-developers/tools/build/ecosystem-overview.mdx similarity index 76% rename from pages/app-developers/tools/ecosystem-overview.mdx rename to pages/app-developers/tools/build/ecosystem-overview.mdx index b72706916..a491ebca1 100644 --- a/pages/app-developers/tools/ecosystem-overview.mdx +++ b/pages/app-developers/tools/build/ecosystem-overview.mdx @@ -1,15 +1,15 @@ --- -title: Open source code repo +title: Ecosystem code repo lang: en-US description: Learn about an ecosystem of libraries and utilities tailored to help you deploy applications on the OP Stack. --- import { Cards, Card } from 'nextra/components' -# Open source code repo for OP Stack builders +# Superchain Ecosystem repo -The [ecosystem repository](https://github.com/ethereum-optimism/ecosystem) is a comprehensive resource of libraries, utilities, and forkable code examples specifically tailored for builders deploying applications on the OP stack. -The ecosystem repository was developed to help ease and expedite the development process for all builders working on the OP stack, helping them deliver value to the community without the necessity of mastering every detail of how the protocol itself operates. +The [Superchain ecosystem repository](https://github.com/ethereum-optimism/ecosystem) is a comprehensive resource of libraries, utilities, and forkable code examples specifically tailored for builders deploying applications on the OP stack. +The Superchain ecosystem repository was developed to help ease and expedite the development process for all builders working on the OP stack, helping them deliver value to the community without the necessity of mastering every detail of how the protocol itself operates. ## Getting started diff --git a/pages/app-developers/tools/build/faucets.mdx b/pages/app-developers/tools/build/faucets.mdx index 2850701c7..59f799fb0 100644 --- a/pages/app-developers/tools/build/faucets.mdx +++ b/pages/app-developers/tools/build/faucets.mdx @@ -61,4 +61,4 @@ You can also promote your tool in the [developer forum](https://github.com/ether * If you're new to onchain development, check out [Optimism Unleashed](https://cryptozombies.io/en/optimism) by CryptoZombies and [Superchain Builder NFT](https://web.archive.org/web/20231218203510/https://blog.thirdweb.com/guides/optimism-superchain-faucet-nft/) by ThirdWeb. * If you're familiar with onchain development, check out the [Optimism Ecosystem's Contributions Dashboard](https://github.com/ethereum-optimism/ecosystem-contributions) for project ideas that the Optimism Collective is looking for. -* Looking for other developer tools? See [developer tools overview](/app-developers/tools/overview) to explore more options! +* Looking for other developer tools? See [developer tools overview](/app-developers/tools) to explore more options! diff --git a/pages/app-developers/tools/build/oracles.mdx b/pages/app-developers/tools/build/oracles.mdx index f70207126..56d4d2d7e 100644 --- a/pages/app-developers/tools/build/oracles.mdx +++ b/pages/app-developers/tools/build/oracles.mdx @@ -147,4 +147,4 @@ You can also promote your tool in the [developer forum](https://github.com/ether ## Next steps * Please visit the [community oracles page](https://github.com/ethereum-optimism/developers/blob/main/community/tools/oracles.md) for a listing of third-party Oracles used by the Optimism developer community. -* Looking for other developer tools? See [developer tools overview](/app-developers/tools/overview) to explore more options! +* Looking for other developer tools? See [developer tools overview](/app-developers/tools) to explore more options! diff --git a/pages/app-developers/tools/connect.mdx b/pages/app-developers/tools/connect.mdx index 8be23f91b..58698ea5f 100644 --- a/pages/app-developers/tools/connect.mdx +++ b/pages/app-developers/tools/connect.mdx @@ -1,5 +1,5 @@ --- -title: Connect +title: Connect tools lang: en-US description: >- Learn about connect in the Optimism ecosystem. This guide provides detailed @@ -8,12 +8,12 @@ description: >- import { Card, Cards } from 'nextra/components' -# Connect +# Connect tools -This section provides information on networks and rpc & node providers. You'll find reference to help you understand and work with these topics. +This section provides information on networks and RPC & node providers. You'll find reference to help you understand and work with these topics. - + } /> - + } /> diff --git a/pages/app-developers/tools/connect/_meta.json b/pages/app-developers/tools/connect/_meta.json index 5c7bf46ce..2d039e6ea 100644 --- a/pages/app-developers/tools/connect/_meta.json +++ b/pages/app-developers/tools/connect/_meta.json @@ -1,4 +1,4 @@ { "networks": "Networks and RPC endpoints", - "rpc-providers": "RPC providers" + "rpc-providers": "RPC and Node providers" } \ No newline at end of file diff --git a/pages/app-developers/tools/connect/rpc-providers.mdx b/pages/app-developers/tools/connect/rpc-providers.mdx index bf99edc6a..6b4600159 100644 --- a/pages/app-developers/tools/connect/rpc-providers.mdx +++ b/pages/app-developers/tools/connect/rpc-providers.mdx @@ -148,4 +148,4 @@ You can also promote your tool in the [developer forum](https://github.com/ether ## Next steps * Please visit the [community node providers page](https://github.com/ethereum-optimism/developers/blob/main/community/tools/node-providers.md) for a listing of third-party node providers used by the Optimism developer community. -* Looking for other developer tools? See [developer tools overview](/app-developers/tools/overview) to explore more options! +* Looking for other developer tools? See [developer tools overview](/app-developers/tools) to explore more options! diff --git a/pages/app-developers/tools/monitor.mdx b/pages/app-developers/tools/monitor.mdx deleted file mode 100644 index 273430003..000000000 --- a/pages/app-developers/tools/monitor.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Monitor -lang: en-US -description: >- - Learn about monitor in the Optimism ecosystem. This guide provides detailed - information and resources about monitor. ---- - -import { Card, Cards } from 'nextra/components' - -# Monitor - -This section provides information on analytics tools and accessing pre regenesis history. You'll find guide, tool to help you understand and work with these topics. - - - - - - diff --git a/pages/app-developers/tools/monitor/_meta.json b/pages/app-developers/tools/monitor/_meta.json deleted file mode 100644 index f37b60762..000000000 --- a/pages/app-developers/tools/monitor/_meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "analytics-tools": "Analytics", - "regenesis-history": "Historical data" -} \ No newline at end of file diff --git a/pages/app-developers/tools/op-tools.mdx b/pages/app-developers/tools/op-tools.mdx deleted file mode 100644 index 0d1e79319..000000000 --- a/pages/app-developers/tools/op-tools.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Op Tools -lang: en-US -description: >- - Learn about op tools in the Optimism ecosystem. This guide provides detailed - information and resources about op tools. ---- - -import { Card, Cards } from 'nextra/components' - -# Op Tools - -This section provides information on OP-specific tooling. - - - - - - - - - - - - - diff --git a/pages/app-developers/tools/op-tools/_meta.json b/pages/app-developers/tools/op-tools/_meta.json deleted file mode 100644 index df6c6a55d..000000000 --- a/pages/app-developers/tools/op-tools/_meta.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "block-explorer": { - "title": "OP Mainnet explorer", - "href": "https://optimistic.etherscan.io/", - "newWindow": true - }, - "bridge": { - "title": "Superchain bridges", - "href": "https://app.optimism.io/bridge", - "newWindow": true - }, - "faucet": { - "title": "Superchain faucet", - "type": "page", - "href": "https://console.optimism.io/faucet?utm_source=docs", - "newWindow": true - }, - "console": { - "title": "Superchain dev console", - "href": "https://console.optimism.io/?utm_source=docs", - "newWindow": true - }, - "gas": { - "title": "Gas tracker", - "type": "page", - "href": "https://optimistic.grafana.net/public-dashboards/c84a5a9924fe4e14b270a42a8651ceb8?orgId=1&refresh=5m", - "newWindow": true - } -} diff --git a/pages/app-developers/tools/overview.mdx b/pages/app-developers/tools/overview.mdx deleted file mode 100644 index de5a229c4..000000000 --- a/pages/app-developers/tools/overview.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Developer tools -lang: en-US -description: Learn about different developer tools you can use to help you build on Optimism. ---- - -import { Cards, Card } from 'nextra/components' - -# Developer tools - -Welcome to the Optimism developer tools! - -If you are already familiar with [building on the OP Stack](/stack/getting-started) and just need the tools to get cracking, you are in the right place! - -## Connecting - - - } /> - - } /> - - - -## Building - - - } /> - - } /> - - } /> - - } /> - - } /> - - -## Monitoring - - - } /> - - } /> - - -## OP tools - - - } /> - - } /> - - } /> - - } /> - - } /> - - } /> - - } /> - - diff --git a/pages/app-developers/tools/supersim.mdx b/pages/app-developers/tools/supersim.mdx index b08c29d10..93b7f3acf 100644 --- a/pages/app-developers/tools/supersim.mdx +++ b/pages/app-developers/tools/supersim.mdx @@ -1,11 +1,61 @@ --- -title: Supersim +title: Supersim Multichain Development Environment lang: en-US -description: >- - Learn about supersim in the Optimism ecosystem. This guide provides detailed - information and resources about supersim. +description: Learn how to use the Supersim local dev environment tool designed to simulate the Optimism Superchain. --- -import Supersim from '@/pages/stack/interop/tools/supersim.mdx' +import { Callout } from 'nextra/components' - +# Supersim Multichain Development Environment + + + Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. + + +[Supersim](https://github.com/ethereum-optimism/Supersim) is a local development environment tool designed to simulate the Optimism Superchain for developers building multi-chain applications. It provides a simplified way to test and develop applications that interact with multiple chains within the Superchain ecosystem. + +## Supersim workflow + +```mermaid +graph LR + A[Write Smart Contracts] --> B[Deploy on Supersim] + B --> C[Test Cross-Chain Interactions] + C --> D[Debug and Refine] + D --> B + C --> E[Ready for Production] +``` + +This diagram illustrates the typical workflow for developers using supersim, from writing smart contracts to testing and refining cross-chain interactions. + +## Features and benefits + +* Simulates multiple OP Stack chains locally (e.g., chain 901, 902) +* Supports testing of cross-chain messaging and interactions +* Includes pre-deployed interoperability contracts +* Offers a CLI interface for starting and managing Supersim instances +* Provides local JSON-RPC endpoints for each simulated chain +* Allows for custom configuration of chain parameters +* Facilitates testing of Superchain-specific features like SuperchainERC20 tokens +* Easy to use with common Ethereum development tools +* Supports chain forking + +## Supersim CLI interaction + +```mermaid +graph TD + A[Developer] --> B[Supersim CLI] + B --> C[Chain 901] + B --> D[Chain 902] + B --> E[...] + C --> F[JSON-RPC Endpoint] + D --> G[JSON-RPC Endpoint] + E --> H[JSON-RPC Endpoint] +``` + +This diagram illustrates how developers interact with Supersim through the CLI, which simulates OP Stack specific features (specifically interop) on locally run chains, each with its own JSON-RPC endpoint and pre-deployed interoperability contracts. + +## Next steps + +* Check out the collection of [Supersim docs](/app-developers/tutorials/supersim) for tutorials and specific use cases. +* Questions about Interop? Check out our collection of [interop guides](/stack/interop) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). +* For more info about how Superchain interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). diff --git a/pages/app-developers/transactions.mdx b/pages/app-developers/transactions.mdx index 1d633421a..e79de4d0a 100644 --- a/pages/app-developers/transactions.mdx +++ b/pages/app-developers/transactions.mdx @@ -1,5 +1,5 @@ --- -title: Transactions +title: Transaction guides lang: en-US description: >- Guide to understanding and working with transactions on OP Stack, including @@ -8,14 +8,14 @@ description: >- import { Card, Cards } from 'nextra/components' -# Transactions +# Transaction guides This section provides information on transactions in OP Mainnet, including fee estimation, gas parameters, transaction statuses, and troubleshooting. You'll find guides to help you understand and work with these topics. - - - - - + } /> + } /> + } /> + } /> + } /> diff --git a/pages/app-developers/transactions/estimates.mdx b/pages/app-developers/transactions/estimates.mdx index dcb5cf5ab..f81e102ea 100644 --- a/pages/app-developers/transactions/estimates.mdx +++ b/pages/app-developers/transactions/estimates.mdx @@ -51,7 +51,7 @@ Make sure to check out the guide on [Setting Transaction Gas Parameters on OP Ma The Viem library provides a convenient method for estimating the L1 data fee for a transaction. -Check out the tutorial on [Estimating Transaction Costs on OP Mainnet](/app-developers/tutorials/sdk-estimate-costs) to learn how to use the Viem library to estimate the L1 data fee for your transaction. +Check out the tutorial on [Estimating Transaction Costs on OP Mainnet](/app-developers/tutorials/transactions/sdk-estimate-costs) to learn how to use the Viem library to estimate the L1 data fee for your transaction. Keep reading if you'd like to learn how to estimate the L1 data fee without the Viem library. diff --git a/pages/app-developers/tutorials.mdx b/pages/app-developers/tutorials.mdx index 91bc57aad..706f9d522 100644 --- a/pages/app-developers/tutorials.mdx +++ b/pages/app-developers/tutorials.mdx @@ -1,23 +1,55 @@ --- -title: Tutorials +title: App dev tutorials lang: en-US description: A collection of tutorials for app developers building on OP Stack, covering topics such as bridging tokens, deploying contracts, and estimating transaction costs. --- import { Card, Cards } from 'nextra/components' -# Tutorials +# App dev tutorials -This section provides information on bridging erc 20 tokens to op mainnet with viem, bridging eth to op mainnet with viem, communicating between op mainnet and ethereum in solidity, deploying your first contract on op mainnet, estimating transaction costs on op mainnet, tracing deposits and withdrawals, viewing deposits and withdrawals by address, triggering op mainnet transactions from ethereum, bridging your custom erc 20 token using the standard bridge and bridging your standard erc 20 token using the standard bridge. You'll find tutorial to help you understand and work with these topics. +If you're a bit more familiar with the OP Stack and Ethereum, you can try walking through one of the tutorials put together by the Optimism community. They'll help you get a head start when building your first Optimistic project. +## Bridging - - - - - - - - - + } /> + } /> + } /> + } /> + } /> + } /> + +## Transactions + + } /> + } /> + } /> + } /> + } /> + + +## Supersim + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + +## Interop + + } /> + } /> + } /> + } /> + } /> + } /> + + +You can also [suggest a new tutorial](https://github.com/ethereum-optimism/docs/issues/new?assignees=\&labels=tutorial%2Cdocumentation%2Ccommunity-request\&projects=\&template=suggest_tutorial.yaml\&title=%5BTUTORIAL%5D+Add+PR+title) if you have something specific in mind. We'd love to grow this list! diff --git a/pages/app-developers/tutorials/_meta.json b/pages/app-developers/tutorials/_meta.json index a1f44203f..2a0f94f98 100644 --- a/pages/app-developers/tutorials/_meta.json +++ b/pages/app-developers/tutorials/_meta.json @@ -1,11 +1,6 @@ { - "cross-dom-solidity": "Communicating between chains in Solidity", - "cross-dom-bridge-eth": "Bridging ETH with viem", - "cross-dom-bridge-erc20": "Bridging ERC-20 tokens with viem", - "standard-bridge-custom-token": "Bridging your custom ERC-20 token to OP Mainnet", - "standard-bridge-standard-token": "Bridging your standard ERC-20 token to OP Mainnet", - "sdk-view-txns": "Viewing deposits and withdrawals by address", - "sdk-trace-txns": "Tracing deposits and withdrawals", - "sdk-estimate-costs": "Estimating transaction costs", - "send-tx-from-eth": "Triggering OP Mainnet transactions from Ethereum" +"bridging": "Bridging tutorials", +"transactions": "Transaction tutorials", +"supersim": "Supersim tutorials", +"interop": "Interop tutorials" } diff --git a/pages/app-developers/tutorials/bridging.mdx b/pages/app-developers/tutorials/bridging.mdx new file mode 100644 index 000000000..f18adb02e --- /dev/null +++ b/pages/app-developers/tutorials/bridging.mdx @@ -0,0 +1,19 @@ +--- +title: Bridging tutorials +lang: en-US +description: A collection of app developer tutorials focused on bridging. +--- + +import { Card, Cards } from 'nextra/components' + +# Bridging tutorials + +This is a collection of app developer tutorials focused on bridging. + + + } /> + } /> + } /> + } /> + } /> + diff --git a/pages/app-developers/tutorials/bridging/_meta.json b/pages/app-developers/tutorials/bridging/_meta.json new file mode 100644 index 000000000..2aefbf0fc --- /dev/null +++ b/pages/app-developers/tutorials/bridging/_meta.json @@ -0,0 +1,7 @@ +{ + "cross-dom-solidity": "Communicating between chains in Solidity", + "cross-dom-bridge-eth": "Bridging ETH with viem", + "cross-dom-bridge-erc20": "Bridging ERC-20 tokens with viem", + "standard-bridge-custom-token": "Bridging your custom ERC-20 token to OP Mainnet", + "standard-bridge-standard-token": "Bridging your standard ERC-20 token to OP Mainnet" +} \ No newline at end of file diff --git a/pages/app-developers/tutorials/cross-dom-bridge-erc20.mdx b/pages/app-developers/tutorials/bridging/cross-dom-bridge-erc20.mdx similarity index 99% rename from pages/app-developers/tutorials/cross-dom-bridge-erc20.mdx rename to pages/app-developers/tutorials/bridging/cross-dom-bridge-erc20.mdx index 96389f60d..2b628fd8c 100644 --- a/pages/app-developers/tutorials/cross-dom-bridge-erc20.mdx +++ b/pages/app-developers/tutorials/bridging/cross-dom-bridge-erc20.mdx @@ -31,7 +31,7 @@ Make sure to check out the [Standard Bridge guide](/app-developers/bridging/stan The Optimism SDK supports any of the [Superchain networks](/superchain/networks). [Some Superchain networks](https://sdk.optimism.io/enums/l2chainid) are already included in the SDK by default. -If you want to use a network that isn't included by default, you can simply [instantiate the SDK with the appropriate contract addresses](/app-developers/overview). +If you want to use a network that isn't included by default, you can simply [instantiate the SDK with the appropriate contract addresses](/app-developers/get-started). ## Dependencies diff --git a/pages/app-developers/tutorials/cross-dom-bridge-eth.mdx b/pages/app-developers/tutorials/bridging/cross-dom-bridge-eth.mdx similarity index 100% rename from pages/app-developers/tutorials/cross-dom-bridge-eth.mdx rename to pages/app-developers/tutorials/bridging/cross-dom-bridge-eth.mdx diff --git a/pages/app-developers/tutorials/cross-dom-solidity.mdx b/pages/app-developers/tutorials/bridging/cross-dom-solidity.mdx similarity index 100% rename from pages/app-developers/tutorials/cross-dom-solidity.mdx rename to pages/app-developers/tutorials/bridging/cross-dom-solidity.mdx diff --git a/pages/app-developers/tutorials/standard-bridge-custom-token.mdx b/pages/app-developers/tutorials/bridging/standard-bridge-custom-token.mdx similarity index 100% rename from pages/app-developers/tutorials/standard-bridge-custom-token.mdx rename to pages/app-developers/tutorials/bridging/standard-bridge-custom-token.mdx diff --git a/pages/app-developers/tutorials/standard-bridge-standard-token.mdx b/pages/app-developers/tutorials/bridging/standard-bridge-standard-token.mdx similarity index 100% rename from pages/app-developers/tutorials/standard-bridge-standard-token.mdx rename to pages/app-developers/tutorials/bridging/standard-bridge-standard-token.mdx diff --git a/pages/app-developers/tutorials/interop.mdx b/pages/app-developers/tutorials/interop.mdx new file mode 100644 index 000000000..cf20871f2 --- /dev/null +++ b/pages/app-developers/tutorials/interop.mdx @@ -0,0 +1,19 @@ +--- +title: Interop tutorials +lang: en-US +description: A collection of app developer tutorials focused on interop. +--- + +import { Card, Cards } from 'nextra/components' + +# Interop tutorials + +This is a collection of app developer tutorials focused on interop. + + + } /> + } /> + } /> + } /> + } /> + diff --git a/pages/app-developers/tutorials/interop/_meta.json b/pages/app-developers/tutorials/interop/_meta.json new file mode 100644 index 000000000..ab9c31cc5 --- /dev/null +++ b/pages/app-developers/tutorials/interop/_meta.json @@ -0,0 +1,7 @@ +{ + "transfer-superchainERC20": "Transferring a SuperchainERC20", + "deploy-superchain-erc20": "Issuing new assets with SuperchainERC20", + "bridge-crosschain-eth": "Bridging native cross-chain ETH transfers", + "relay-messages-cast": "Relaying interop messages using `cast`", + "relay-messages-viem": "Relaying interop messages using `viem`" +} \ No newline at end of file diff --git a/pages/app-developers/tutorials/interop/bridge-crosschain-eth.mdx b/pages/app-developers/tutorials/interop/bridge-crosschain-eth.mdx new file mode 100644 index 000000000..7d6e36149 --- /dev/null +++ b/pages/app-developers/tutorials/interop/bridge-crosschain-eth.mdx @@ -0,0 +1,9 @@ +--- +title: Bridging native cross-chain ETH transfers +lang: en-US +description: Learn how to bridge native cross-chain ETH transfers. +--- + +import CrosschainETH from '@/pages/stack/interop/tutorials/bridge-crosschain-eth.mdx' + + diff --git a/pages/app-developers/tutorials/interop/deploy-superchain-erc20.mdx b/pages/app-developers/tutorials/interop/deploy-superchain-erc20.mdx new file mode 100644 index 000000000..7916f5b28 --- /dev/null +++ b/pages/app-developers/tutorials/interop/deploy-superchain-erc20.mdx @@ -0,0 +1,10 @@ +--- +title: Issuing new assets with SuperchainERC20 +lang: en-US +description: >- + Learn how to issue assets on SuperchainERC20. +--- + +import DeploySuperERC20 from '@/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx' + + diff --git a/pages/app-developers/tutorials/interop/relay-messages-cast.mdx b/pages/app-developers/tutorials/interop/relay-messages-cast.mdx new file mode 100644 index 000000000..cb19744b8 --- /dev/null +++ b/pages/app-developers/tutorials/interop/relay-messages-cast.mdx @@ -0,0 +1,9 @@ +--- +title: Relaying interop messages using `cast` +lang: en-US +description: Learn how to relay interop messages using `cast` commands. +--- + +import RelayCast from '@/pages/stack/interop/tutorials/relay-messages-cast.mdx' + + diff --git a/pages/app-developers/tutorials/interop/relay-messages-viem.mdx b/pages/app-developers/tutorials/interop/relay-messages-viem.mdx new file mode 100644 index 000000000..bd7128ec2 --- /dev/null +++ b/pages/app-developers/tutorials/interop/relay-messages-viem.mdx @@ -0,0 +1,9 @@ +--- +title: Relaying interop messages using `viem` +lang: en-US +description: Learn how to relay interop messages using `viem`. +--- + +import RelayViem from '@/pages/stack/interop/tutorials/relay-messages-viem.mdx' + + diff --git a/pages/app-developers/tutorials/interop/transfer-superchainERC20.mdx b/pages/app-developers/tutorials/interop/transfer-superchainERC20.mdx new file mode 100644 index 000000000..64307b322 --- /dev/null +++ b/pages/app-developers/tutorials/interop/transfer-superchainERC20.mdx @@ -0,0 +1,10 @@ +--- +title: Transferring a SuperchainERC20 +lang: en-US +description: >- + Learn how to transfer a SuperchainERC20 between chains using L2ToL2CrossDomainMessenger. +--- + +import TransferSuperERC20 from '@/pages/stack/interop/tutorials/transfer-superchainERC20.mdx' + + diff --git a/pages/app-developers/tutorials/supersim.mdx b/pages/app-developers/tutorials/supersim.mdx new file mode 100644 index 000000000..96e8a7b89 --- /dev/null +++ b/pages/app-developers/tutorials/supersim.mdx @@ -0,0 +1,34 @@ +--- +title: Supersim guides and tutorials +lang: en-US +description: >- + A collection of guides and tutorials to understanding and working with Supersim, including + getting started, CLI reference, and chain environment. +--- + +import { Card, Cards } from 'nextra/components' + +# Supersim guides and tutorials + +This is a collection of guides and tutorials to understanding and working with Supersim, including getting started, CLI reference, and chain environment. + +## General + + } /> + } /> + } /> + } /> + + + +## Tutorials + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + diff --git a/pages/app-developers/tutorials/supersim/_meta.json b/pages/app-developers/tutorials/supersim/_meta.json new file mode 100644 index 000000000..f0aad865e --- /dev/null +++ b/pages/app-developers/tutorials/supersim/_meta.json @@ -0,0 +1,6 @@ +{ + "getting-started": "Getting started", + "reference": "CLI reference", + "chain-env": "Chain environment", + "deposit-transactions": "Deposit transactions" +} \ No newline at end of file diff --git a/pages/app-developers/tutorials/supersim/chain-env.mdx b/pages/app-developers/tutorials/supersim/chain-env.mdx new file mode 100644 index 000000000..0e8205306 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/chain-env.mdx @@ -0,0 +1,19 @@ +--- +title: Chain environment tutorials +lang: en-US +description: A collection of tutorials on understanding and configuring your chain environment using Supersim. +--- + +import { Card, Cards } from 'nextra/components' + +# Chain environment tutorials + +These tutorials are for understanding and configuring your chain environment using Supersim. + + + } /> + + } /> + + } /> + diff --git a/pages/app-developers/tutorials/supersim/chain-env/_meta.json b/pages/app-developers/tutorials/supersim/chain-env/_meta.json new file mode 100644 index 000000000..8376141a5 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/chain-env/_meta.json @@ -0,0 +1,5 @@ +{ + "included-contracts": "Included contracts", + "chain-a": "OPChainA (chainID 901)", + "chain-b": "OPChainB (chainID 902)" +} \ No newline at end of file diff --git a/pages/app-developers/tutorials/supersim/chain-env/chain-a.mdx b/pages/app-developers/tutorials/supersim/chain-env/chain-a.mdx new file mode 100644 index 000000000..036f2c8c8 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/chain-env/chain-a.mdx @@ -0,0 +1,95 @@ +--- +title: OPChainA (chainID 901) +lang: en-US +description: Learn network details and contract addresses for OPChainA (chainID 901). +--- + +import { Callout, Steps } from 'nextra/components' + +# OPChainA (chainID 901) + +This guide provides network details and contract addresses for OPChainA (chainID 901) when running `supersim` vanilla mode. + +## Network details + +| **Parameter** | **Value** | +| ------------- | ---------------------------------------------- | +| **Name** | OPChainA | +| **Chain ID** | 901 | +| **RPC URL** | [http://127.0.0.1:9545](http://127.0.0.1:9545) | + +## Contract addresses + +### L1 contracts + +```json +{ + "AddressManager": "0x78d21C9820A9135215202A9a8D6521483D4b75cD", + "AnchorStateRegistry": "0x21799f09394c50220CCD95E7dAc1cdD774FC871a", + "AnchorStateRegistryProxy": "0xa6F40d5770b3509aB40B2effa5cb544D29743ec7", + "DelayedWETH": "0x49BBFf1629824A1e7993Ab5c17AFa45D24AB28c9", + "DelayedWETHProxy": "0x309DA6B9a8fE16afD7D067528d358E55314bEa6b", + "DisputeGameFactory": "0x20B168142354Cee65a32f6D8cf3033E592299765", + "DisputeGameFactoryProxy": "0x444689B81D485bc58AB81aC02A95a937fAa152D7", + "L1CrossDomainMessenger": "0x094e6508ba9d9bf1ce421fff3dE06aE56e67901b", + "L1CrossDomainMessengerProxy": "0xcd712b03bc6424BF45cE6C29Fc90FFDece228F6E", + "L1ERC721Bridge": "0x5C4F5e749A61a9503c4AAE8a9393e89609a0e804", + "L1ERC721BridgeProxy": "0x018dC24a6617c47cAa00C3fA25097214B2D4F447", + "L1StandardBridge": "0xb7900B27Be8f0E0fF65d1C3A4671e1220437dd2b", + "L1StandardBridgeProxy": "0x8d515eb0e5F293B16B6bBCA8275c060bAe0056B0", + "L2OutputOracle": "0x19652082F846171168Daf378C4fD3ee85a0D4A60", + "L2OutputOracleProxy": "0x6cE0530E823e23be85D8e151FB023605eB4F6d43", + "Mips": "0xB3A0348310a0ff78E5FbDB7f14BB7d3e02d40773", + "OptimismMintableERC20Factory": "0x39Aea2Dd53f2d01c15877aCc2791af6BDD7aD567", + "OptimismMintableERC20FactoryProxy": "0x15c855966C196Be3a8ca747E8A8Bf40928d4741f", + "OptimismPortal": "0x37a418800d0c812A9dE83Bc80e993A6b76511B57", + "OptimismPortal2": "0xfcbb237388CaF5b08175C9927a37aB6450acd535", + "OptimismPortalProxy": "0xF5fe61a258CeBb54CCe428F76cdeD04Cbc12F53d", + "PreimageOracle": "0x3bd7E801E51d48c5d94Ea68e8B801DFFC275De75", + "ProtocolVersions": "0xfbfD64a6C0257F613feFCe050Aa30ecC3E3d7C3F", + "ProtocolVersionsProxy": "0x6dA4f6489039d9f4F3144954DDF5bb2F4986e90b", + "ProxyAdmin": "0xe32a4D31ffD5596542DAc8239a1DE3Fff9d63475", + "SafeProxyFactory": "0x4a05c09875DE2DD5B81Bc01dd46eD4699b181bfA", + "SafeSingleton": "0x99A395CE6d6b37CaaCBad64fB42d556b6CA73a48", + "SuperchainConfig": "0x068E44eB31e111028c41598E4535be7468674D0A", + "SuperchainConfigProxy": "0x7E6c6ebCF109fa23277b86bdA39738035C21BB86", + "SystemConfig": "0x6167B477F8d9138aa509f54b2800443857e28c0f", + "SystemConfigProxy": "0xf32919Ed2490b56EaD65E72749894aE4C9523320", + "SystemOwnerSafe": "0xc052b7316C87390E555aF97D42bCd5FB6d5eEFDa" +} +``` + +### L2 contracts + +```json +{ + // OP Stack predeploys + "L2ToL1MessagePasser": "0x4200000000000000000000000000000000000016", + "L2CrossDomainMessenger": "0x4200000000000000000000000000000000000007", + "L2StandardBridge": "0x4200000000000000000000000000000000000010", + "L2ERC721Bridge": "0x4200000000000000000000000000000000000014", + "SequencerFeeVault": "0x4200000000000000000000000000000000000011", + "OptimismMintableERC20Factory": "0x4200000000000000000000000000000000000012", + "OptimismMintableERC721Factory": "0x4200000000000000000000000000000000000017", + "L1BlockInterop": "0x4200000000000000000000000000000000000015", + "GasPriceOracle": "0x420000000000000000000000000000000000000F", + "ProxyAdmin": "0x4200000000000000000000000000000000000018", + "BaseFeeVault": "0x4200000000000000000000000000000000000019", + "L1FeeVault": "0x420000000000000000000000000000000000001A", + "GovernanceToken": "0x4200000000000000000000000000000000000042", + "SchemaRegistry": "0x4200000000000000000000000000000000000020", + "EAS": "0x4200000000000000000000000000000000000021", + "CrossL2Inbox": "0x4200000000000000000000000000000000000022", + "L2ToL2CrossDomainMessenger": "0x4200000000000000000000000000000000000023", + "SuperchainWETH": "0x4200000000000000000000000000000000000024", + "SuperchainTokenBridge": "0x4200000000000000000000000000000000000028", + + // Periphery + "L2NativeSuperchainERC20": "0x420beeF000000000000000000000000000000001" +} +``` + +## Next steps + +* Learn how to [deposit transactions](/app-developers/tutorials/supersim/deposit-transactions) with Supersim, using a much simpler approach that bypasses the derivation pipeline. +* For more info about how Superchain interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). diff --git a/pages/app-developers/tutorials/supersim/chain-env/chain-b.mdx b/pages/app-developers/tutorials/supersim/chain-env/chain-b.mdx new file mode 100644 index 000000000..03c8ce4d5 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/chain-env/chain-b.mdx @@ -0,0 +1,95 @@ +--- +title: OPChainB (chainID 902) +lang: en-US +description: Learn network details and contract addresses for OPChainB (chainID 902). +--- + +import { Callout, Steps } from 'nextra/components' + +# OPChainB (chainID 902) + +This guide provides network details and contract addresses for OPChainB (chainID 902) when running `supersim` vanilla mode. + +## Network details + +| **Parameter** | **Value** | +| ------------- | ---------------------------------------------- | +| **Name** | OPChainB | +| **Chain ID** | 902 | +| **RPC URL** | [http://127.0.0.1:9546](http://127.0.0.1:9546) | + +## Contract addresses + +### L1 contracts + +```json +{ + "AddressManager": "0xafB51A0f73C8409AeA1207DF7f39885c927BeA46", + "AnchorStateRegistry": "0x05493149c84A71063f7948127bb931f8377F779C", + "AnchorStateRegistryProxy": "0xfd0269a716A59fF125Bd7eb65Cd3427C8555bab7", + "DelayedWETH": "0x49BBFf1629824A1e7993Ab5c17AFa45D24AB28c9", + "DelayedWETHProxy": "0xA63353128502269b4A4A4c2677fE316cd9ad4397", + "DisputeGameFactory": "0x20B168142354Cee65a32f6D8cf3033E592299765", + "DisputeGameFactoryProxy": "0x5F416fEb15c8B382d338FDBDb7D44967ca2b59BC", + "L1CrossDomainMessenger": "0x094e6508ba9d9bf1ce421fff3dE06aE56e67901b", + "L1CrossDomainMessengerProxy": "0xeCA0f912b4bd255f3851951caE5775CC9400aA3B", + "L1ERC721Bridge": "0x5C4F5e749A61a9503c4AAE8a9393e89609a0e804", + "L1ERC721BridgeProxy": "0xDCE41E6C0901586EE27Eac329EBD4b5fe5A7170d", + "L1StandardBridge": "0xb7900B27Be8f0E0fF65d1C3A4671e1220437dd2b", + "L1StandardBridgeProxy": "0x67B2aB287a32bB9ACe84F6a5A30A62597b10AdE9", + "L2OutputOracle": "0x19652082F846171168Daf378C4fD3ee85a0D4A60", + "L2OutputOracleProxy": "0x006Af3fB62c4BE4fB0393995d364BbFe6b0F3CB2", + "Mips": "0xB3A0348310a0ff78E5FbDB7f14BB7d3e02d40773", + "OptimismMintableERC20Factory": "0x39Aea2Dd53f2d01c15877aCc2791af6BDD7aD567", + "OptimismMintableERC20FactoryProxy": "0x1A2A942d891e525D1Ab192578a378980729fD585", + "OptimismPortal": "0x35e67BC631C327b60C6A39Cff6b03a8adBB19c2D", + "OptimismPortal2": "0xfcbb237388CaF5b08175C9927a37aB6450acd535", + "OptimismPortalProxy": "0xdfC9DEAbEEbDaa7620C71e2E76AEda32919DE5f2", + "PreimageOracle": "0x3bd7E801E51d48c5d94Ea68e8B801DFFC275De75", + "ProtocolVersions": "0xfbfD64a6C0257F613feFCe050Aa30ecC3E3d7C3F", + "ProtocolVersionsProxy": "0xE139cB0CDa5EF722870068ea331d0989776A7aDf", + "ProxyAdmin": "0xff5E6C2Af859f70B875BA59B958BEde60E36bf69", + "SafeProxyFactory": "0xb68f3B057fE3c6CdDF9DB35837Ea769FCc81978a", + "SafeSingleton": "0xeeB44D84d505AbD958d032e90704c56443eB3ED0", + "SuperchainConfig": "0x068E44eB31e111028c41598E4535be7468674D0A", + "SuperchainConfigProxy": "0x2ED4AA34573c36bF3856e597501aEf9d9Dc1687C", + "SystemConfig": "0x6167B477F8d9138aa509f54b2800443857e28c0f", + "SystemConfigProxy": "0x2Db03FE998D7c20E4B65afD1f50f04Ec4BfAb694", + "SystemOwnerSafe": "0xBF3830711B7c559042453B7546dB4736eFB4245e" +} +``` + +### L2 contracts + +```json +{ + // OP Stack predeploys + "L2ToL1MessagePasser": "0x4200000000000000000000000000000000000016", + "L2CrossDomainMessenger": "0x4200000000000000000000000000000000000007", + "L2StandardBridge": "0x4200000000000000000000000000000000000010", + "L2ERC721Bridge": "0x4200000000000000000000000000000000000014", + "SequencerFeeVault": "0x4200000000000000000000000000000000000011", + "OptimismMintableERC20Factory": "0x4200000000000000000000000000000000000012", + "OptimismMintableERC721Factory": "0x4200000000000000000000000000000000000017", + "L1BlockInterop": "0x4200000000000000000000000000000000000015", + "GasPriceOracle": "0x420000000000000000000000000000000000000F", + "ProxyAdmin": "0x4200000000000000000000000000000000000018", + "BaseFeeVault": "0x4200000000000000000000000000000000000019", + "L1FeeVault": "0x420000000000000000000000000000000000001A", + "GovernanceToken": "0x4200000000000000000000000000000000000042", + "SchemaRegistry": "0x4200000000000000000000000000000000000020", + "EAS": "0x4200000000000000000000000000000000000021", + "CrossL2Inbox": "0x4200000000000000000000000000000000000022", + "L2ToL2CrossDomainMessenger": "0x4200000000000000000000000000000000000023", + "SuperchainWETH": "0x4200000000000000000000000000000000000024", + "SuperchainTokenBridge": "0x4200000000000000000000000000000000000028", + + // Periphery + "L2NativeSuperchainERC20": "0x420beeF000000000000000000000000000000001" +} +``` + +## Next steps + +* Learn how to [deposit transactions](/app-developers/tutorials/supersim/deposit-transactions) with Supersim, using a much simpler approach that bypasses the derivation pipeline. +* For more info about how Superchain interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). diff --git a/pages/app-developers/tutorials/supersim/chain-env/included-contracts.mdx b/pages/app-developers/tutorials/supersim/chain-env/included-contracts.mdx new file mode 100644 index 000000000..b3b5b4bc6 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/chain-env/included-contracts.mdx @@ -0,0 +1,48 @@ +--- +title: Included contracts +lang: en-US +description: Learn about the Supersim included contracts. +--- + +import { Callout, Steps } from 'nextra/components' + +# Included contracts + +The `supersim` chain environment includes contracts already deployed to help replicate the Superchain environment. See [OP Chain A](op-chain-a) for contract address examples for a L2 system. + +## OP Stack system contracts (L1) + +These are the L1 contracts that are required for a rollup as part of the OP Stack protocol. Examples are the [OptimismPortal](https://github.com/ethereum-optimism/optimism-legacy/blob/8205f678b7b4ac4625c2afe351b9c82ffaa2e795/packages/contracts-bedrock/contracts/L1/OptimismPortal.sol), [L1StandardBridge](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/L1StandardBridge.sol), and [L1CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/L1CrossDomainMessenger.sol). + +For more details, see [example contracts](/superchain/addresses#ethereum-l1) or the [source code](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/src/L1). + +## OP Stack L2 contracts (L2) + +The OP Stack system contracts on the L2 are included at the standard addresses by default. + +* [Standard OP Stack predeploys (L2)](https://specs.optimism.io/protocol/predeploys.html) +* [Interoperability predeploys (*experimental*) (L2)](https://specs.optimism.io/interop/predeploys.html) +* [OP Stack preinstalls (L2)](https://specs.optimism.io/protocol/preinstalls.html) + +## Periphery contracts (L2) + +L2 chains running on `supersim` also includes some useful contracts for testing purposes that are not part of the OP Stack by default. + +### L2NativeSuperchainERC20 + +A simple ERC20 that adheres to the SuperchainERC20 standard. It includes permissionless minting for easy testing. + +Source: [L2NativeSuperchainERC20.sol](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) + +Deployed address: `0x420beeF000000000000000000000000000000001` + +#### Minting new tokens + +```bash +cast send 0x420beeF000000000000000000000000000000001 "mint(address _to, uint256 _amount)" $RECIPIENT_ADDRESS 1ether --rpc-url $L2_RPC_URL +``` + +## Next steps + +* Get network details about the two OP Stack systems spun up in vanilla mode: [OPChainA (chainID 901)](/app-developers/tutorials/supersim/chain-env/chain-a) and [OPChainB (chainID 902)](/app-developers/tutorials/supersim/chain-env/chain-b). +* Learn how to [deposit transactions](/app-developers/tutorials/supersim/deposit-transactions) with Supersim, using a much simpler approach that bypasses the derivation pipeline. diff --git a/pages/app-developers/tutorials/supersim/deposit-transactions.mdx b/pages/app-developers/tutorials/supersim/deposit-transactions.mdx new file mode 100644 index 000000000..38d7eb4de --- /dev/null +++ b/pages/app-developers/tutorials/supersim/deposit-transactions.mdx @@ -0,0 +1,99 @@ +--- +title: Deposit transactions +lang: en-US +description: Learn about using deposit transactions with `supersim`. +--- + +import { Callout, Steps } from 'nextra/components' + +# Deposit transactions + +Supersim supports [deposit transactions](/stack/transactions/deposit-flow). It uses a very lightweight solution without the `op-node` derivation pipeline by listening directly to the `TransactionDeposited` events on the `OptimismPortal` contract and simply forwarding the transaction to the applicable L2. + +The execution engine used with Supersim must support the Optimism [deposit transaction type](https://specs.optimism.io/protocol/deposits.html#the-deposited-transaction-type). + +## `OptimismPortal` + +When starting Supersim, the L1 contracts for each L2 chain are emitted as output to the console. The `L1CrossDomainMessenger`, `L1StandardBridge`, and `OptimismPortal` can be used to initiate deposits in the same manner as one would on a production network like OP Mainnet or Base. + +```bash +Chain Configuration +----------------------- +L1: Name: Local ChainID: 900 RPC: http://127.0.0.1:8545 LogPath: ... + +L2: Predeploy Contracts Spec ( https://specs.optimism.io/protocol/predeploys.html ) + + * Name: OPChainA ChainID: 901 RPC: http://127.0.0.1:9545 LogPath: ... + L1 Contracts: + - OptimismPortal: 0x37a418800d0c812A9dE83Bc80e993A6b76511B57 + - L1CrossDomainMessenger: 0xcd712b03bc6424BF45cE6C29Fc90FFDece228F6E + - L1StandardBridge: 0x8d515eb0e5F293B16B6bBCA8275c060bAe0056B0 + + ... +``` + +If running Supersim in fork mode, the production contracts will be used for each of the forked networks. + +```bash +Chain Configuration +----------------------- +L1: Name: mainnet ChainID: 1 RPC: http://127.0.0.1:8545 LogPath: ... + +L2: Predeploy Contracts Spec ( https://specs.optimism.io/protocol/predeploys.html ) + + * Name: op ChainID: 10 RPC: http://127.0.0.1:9545 LogPath: ... + L1 Contracts: + - OptimismPortal: 0xbEb5Fc579115071764c7423A4f12eDde41f106Ed + - L1CrossDomainMessenger: 0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1 + - L1StandardBridge: 0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1 + + * Name: mode ChainID: 34443 RPC: http://127.0.0.1:9546 LogPath: ... + L1 Contracts: + - OptimismPortal: 0x8B34b14c7c7123459Cf3076b8Cb929BE097d0C07 + - L1CrossDomainMessenger: 0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f + - L1StandardBridge: 0x735aDBbE72226BD52e818E7181953f42E3b0FF21 + + ... +``` + +## Sample Deposit Flow + +We'll run through a sample deposit directly with the `OptimismPortal` using cast. + + + ### Run Supersim + + ```bash + supersim + ``` + + ### Observe OptimismPortal Contract Address + + ```bash + ... + * Name: OPChainA ChainID: 901 ... + L1 Contracts: + - OptimismPortal: 0x37a418800d0c812A9dE83Bc80e993A6b76511B57 + ... + ``` + + ### Send Deposit Transaction On L1 + + We'll be using the first pre-funded account to send this deposit with 1 ether + + ```bash + cast send 0x37a418800d0c812A9dE83Bc80e993A6b76511B57 --value 1ether --rpc-url http://localhost:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + ### Verify With Supersim Logs + + ```bash + INFO [11-28|13:56:06.756] OptimismPortal#depositTransaction chain.id=901 l2TxHash=0x592d6e13016751332115df1fce59904176bfe447854196ed1b97ee00f14be469 + ``` + + +## Next steps + +* See the [transaction guides](/app-developers/transactions) for more detailed information. +* Questions about Interop? Check out collection of [interop guides](/stack/interop) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). +* For more info about how Superchain interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). diff --git a/pages/app-developers/tutorials/supersim/getting-started.mdx b/pages/app-developers/tutorials/supersim/getting-started.mdx new file mode 100644 index 000000000..76e20202f --- /dev/null +++ b/pages/app-developers/tutorials/supersim/getting-started.mdx @@ -0,0 +1,17 @@ +--- +title: Getting started guides +lang: en-US +description: A collection of guides for installing dependencies and getting started with Supersim. +--- + +import { Card, Cards } from 'nextra/components' + +# Getting started guides + +This is a collection of guides for installing dependencies and getting started with Supersim. + + + } /> + + } /> + diff --git a/pages/app-developers/tutorials/supersim/getting-started/_meta.json b/pages/app-developers/tutorials/supersim/getting-started/_meta.json new file mode 100644 index 000000000..551335a15 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/getting-started/_meta.json @@ -0,0 +1,4 @@ +{ + "installation": "Installation", + "first-steps": "First steps" +} \ No newline at end of file diff --git a/pages/app-developers/tutorials/supersim/getting-started/first-steps.mdx b/pages/app-developers/tutorials/supersim/getting-started/first-steps.mdx new file mode 100644 index 000000000..39415358f --- /dev/null +++ b/pages/app-developers/tutorials/supersim/getting-started/first-steps.mdx @@ -0,0 +1,121 @@ +--- +title: First steps +lang: en-US +description: Take your first steps with Supersim. +--- + +import { Callout, Steps } from 'nextra/components' + +# First steps + +`supersim` allows testing multichain features **locally**. Previously, testing multichain features required complex docker setups or using a testnet. To see it in practice, this tutorial walks you through sending some ETH from the L1 to the L2. + +## Deposit ETH from the L1 into the L2 (L1 to L2 message passing) + + + ### Check initial balance on the L2 (chain 901) + + Grab the balance of the sender account on L2: + + ```sh + cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9545 + ``` + + ### Send the Ether + + You can use two different methods to complete this action: `OptimismPortal` or `L1StandardBridge`. + + #### First method: `OptimismPortal` + + * Send the Ether to `OptimismPortal` contract of the respective L2 (on chain 900) + + + For chain 901, the contract is `0x37a418800d0c812A9dE83Bc80e993A6b76511B57`. + + + * Initiate a bridge transaction on the L1: + + ```sh + cast send 0x37a418800d0c812A9dE83Bc80e993A6b76511B57 --value 0.1ether --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + #### Second method: `L1StandardBridge` + + * Call `bridgeETH` function on the `L1StandardBridgeProxy` / `L1StandardBridge` contract of the respective L2 on L1 (chain 900) + + + For chain 901, the contract is `0x8d515eb0e5F293B16B6bBCA8275c060bAe0056B0`. + + + * Initiate a bridge transaction on the L1: + + ```sh + cast send 0x8d515eb0e5F293B16B6bBCA8275c060bAe0056B0 "bridgeETH(uint32 _minGasLimit, bytes calldata _extraData)" 50000 0x --value 0.1ether --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + ### Check the balance on the L2 (chain 901) + + Verify that the ETH balance of the sender has increased on the L2: + + ```sh + cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9545 + ``` + + +## Send an interoperable SuperchainERC20 token from chain 901 to 902 (L2 to L2 message passing) + +In a typical L2 to L2 cross-chain transfer, two transactions are required: + +1. Send transaction on the source chain – This initiates the token transfer on Chain 901. +2. Relay message transaction on the destination chain – This relays the transfer details to Chain 902. + +To simplify this process, you can use the `--interop.autorelay` flag. This flag automatically triggers the relay message transaction once the initial send transaction is completed on the source chain, improving the developer experience by removing the need to manually send the relay message. + + + ### Start `supersim` with the autorelayer enabled + + ```sh + supersim --interop.autorelay + ``` + + ### Mint tokens to transfer on chain 901 + + Run the following command to mint 1000 `L2NativeSuperchainERC20` tokens to the recipient address: + + ```sh + cast send 0x420beeF000000000000000000000000000000001 "mint(address _to, uint256 _amount)" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000 --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + + ``` + + ### Initiate the send transaction on chain 901 + + Send the tokens from Chain 901 to Chain 902 using the following command: + + ```sh + cast send 0x4200000000000000000000000000000000000028 "sendERC20(address _token, address _to, uint256 _amount, uint256 _chainId)" 0x420beeF000000000000000000000000000000001 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000 902 --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + ### Wait for the relayed message to appear on chain 902 + + In a few seconds, you should see the RelayedMessage on chain 902: + + ```sh + # example + INFO [08-30|14:30:14.698] SuperchainTokenBridge#RelayERC20 token=0x420beeF000000000000000000000000000000001 from=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 to=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 amount=1000 source=901 + ``` + + ### Check the balance on chain 902 + + Verify that the balance of the L2NativeSuperchainERC20 on chain 902 has increased: + + ```sh + cast balance --erc20 0x420beeF000000000000000000000000000000001 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9546 + ``` + + +With the steps above, you've now successfully completed both an L1 to L2 ETH bridge and an L2 to L2 interoperable SuperchainERC20 token transfer, all done locally using `supersim`. This approach simplifies multichain testing, allowing you to focus on development without the need for complex setups or relying on external testnets. + +## Next steps + +* Learn how to start Supersim in [vanilla (non-forked) mode](/app-developers/tutorials/supersim/reference/vanilla) or [forked mode](/app-developers/tutorials/supersim/reference/fork). +* Explore the Supersim [included contracts](/app-developers/tutorials/supersim/chain-env/included-contracts) being used to help replicate the Superchain environment. diff --git a/pages/app-developers/tutorials/supersim/getting-started/installation.mdx b/pages/app-developers/tutorials/supersim/getting-started/installation.mdx new file mode 100644 index 000000000..0ff1ff996 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/getting-started/installation.mdx @@ -0,0 +1,49 @@ +--- +title: Installation +lang: en-US +description: Learn how to install Supersim. +--- + +import { Callout, Steps } from 'nextra/components' + +# Installation + +This page provides installation instructions for `supersim`. + + + ### Prerequisites: `foundry` + + `supersim` requires `anvil` to be installed. + + Follow the [Foundry toolchain](https://book.getfoundry.sh/getting-started/installation) guide for detailed instructions. + + ### Install `supersim` + + * Get the precompiled binaries by downloading the executable for your platform from the [GitHub releases page](https://github.com/ethereum-optimism/supersim/releases). + + * Get Homebrew (OS X, Linux). + + ```sh + brew tap ethereum-optimism/tap + brew install supersim + ``` + + ### Start `supersim` in vanilla mode + + ```sh + supersim + ``` + + Vanilla mode will start 3 chains, with the OP Stack contracts already deployed. + + * (1) L1 Chain + * Chain 900 + * (2) L2 Chains + * Chain 901 + * Chain 902 + + +## Next steps + +* Continue to the [First Steps](first-steps) tutorial to try L1 to L2 message passing. +* Explore [Supersim](/app-developers/tutorials/supersim) features, particularly in [vanilla mode](/app-developers/tutorials/supersim/reference/vanilla), which starts 3 chains (L1 and L2). diff --git a/pages/app-developers/tutorials/supersim/reference.mdx b/pages/app-developers/tutorials/supersim/reference.mdx new file mode 100644 index 000000000..3504434a6 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/reference.mdx @@ -0,0 +1,17 @@ +--- +title: CLI reference guides +lang: en-US +description: A collection of guides for using the Superchain CLI with Supersim. +--- + +import { Card, Cards } from 'nextra/components' + +# CLI reference guides + +This is a collection of guides for using the Superchain CLI with Supersim. + + + } /> + + } /> + diff --git a/pages/app-developers/tutorials/supersim/reference/_meta.json b/pages/app-developers/tutorials/supersim/reference/_meta.json new file mode 100644 index 000000000..373337eed --- /dev/null +++ b/pages/app-developers/tutorials/supersim/reference/_meta.json @@ -0,0 +1,4 @@ +{ + "vanilla": "Vanilla mode", + "fork": "Fork mode" +} \ No newline at end of file diff --git a/pages/app-developers/tutorials/supersim/reference/fork.mdx b/pages/app-developers/tutorials/supersim/reference/fork.mdx new file mode 100644 index 000000000..66f73eff0 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/reference/fork.mdx @@ -0,0 +1,128 @@ +--- +title: Fork mode +lang: en-US +description: Learn how to fork Supersim. +--- + +import { Callout, Steps } from 'nextra/components' + +# Fork mode + +Supersim fork mode to simulate and interact with the state of the chain without needing to re-deploy or modify the contracts. This is possible if you're relying on contracts already deployed on testnet / mainnet chains. + +```sh +supersim fork +``` + +## How it works + +The `supersim` fork command simplifies the process of forking multiple chains in the Superchain ecosystem simultaneously. It determines the appropriate block heights for each chain and launches both the L1 and L2 chains based on these values. + +This allows you to locally fork any chain in a superchain network of the [superchain registry](https://github.com/ethereum-optimism/superchain-registry), default `mainnet` versions. + +### Example startup logs + +``` +Available Accounts +----------------------- +(0): 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +--- truncated for brevity --- + +Private Keys +----------------------- +(0): 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 +--- truncated for brevity --- + +Orchestrator Config: +L1: + Name: mainnet Chain ID: 1 RPC: http://127.0.0.1:8545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-1-1521250718 +L2: + Name: op Chain ID: 10 RPC: http://127.0.0.1:9545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-10 + Name: base Chain ID: 8453 RPC: http://127.0.0.1:9546 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-8453 + Name: zora Chain ID: 7777777 RPC: http://127.0.0.1:9547 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-7777777 +``` + +## Configuration + +``` +NAME: + supersim fork - Locally fork a network in the superchain registry + +USAGE: + supersim fork [command options] + +OPTIONS: + + --l1.fork.height value (default: 0) ($SUPERSIM_L1_FORK_HEIGHT) + L1 height to fork the superchain (bounds L2 time). `0` for latest + + --chains value ($SUPERSIM_CHAINS) + chains to fork in the superchain, mainnet options: [base, lyra, metal, mode, op, + orderly, race, tbn, zora]. In order to replace the public rpc endpoint for a + chain, specify the ($SUPERSIM_RPC_URL_) env variable. i.e + SUPERSIM_RPC_URL_OP=http://optimism-mainnet.infura.io/v3/ + + --network value (default: "mainnet") ($SUPERSIM_NETWORK) + superchain network. options: mainnet, sepolia, sepolia-dev-0. In order to + replace the public rpc endpoint for the network, specify the + ($SUPERSIM_RPC_URL_) env variable. i.e + SUPERSIM_RPC_URL_MAINNET=http://mainnet.infura.io/v3/ + + --interop.enabled (default: true) ($SUPERSIM_INTEROP_ENABLED) + enable interop predeploy and functionality + + --l1.port value (default: 8545) ($SUPERSIM_L1_PORT) + Listening port for the L1 instance. `0` binds to any available port + + --l2.starting.port value (default: 9545) ($SUPERSIM_L2_STARTING_PORT) + Starting port to increment from for L2 chains. `0` binds each chain to any + available port + + --interop.autorelay (default: false) ($SUPERSIM_INTEROP_AUTORELAY) + Automatically relay messages sent to the L2ToL2CrossDomainMessenger using + account 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 + + --interop.delay value (default: 0) ($SUPERSIM_INTEROP_DELAY) + Delay before relaying messages sent to the L2ToL2CrossDomainMessenger + + --logs.directory value ($SUPERSIM_LOGS_DIRECTORY) + Directory to store logs + + --log.level value (default: INFO) ($SUPERSIM_LOG_LEVEL) + The lowest log level that will be output + + --log.format value (default: text) ($SUPERSIM_LOG_FORMAT) + Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', + 'json-pretty', + + --log.color (default: false) ($SUPERSIM_LOG_COLOR) + Color the log output if in terminal mode + + --log.pid (default: false) ($SUPERSIM_LOG_PID) + Show pid in the log + + --odyssey.enabled (default: false) ($SUPERSIM_ODYSSEY_ENABLED) + Enable odyssey experimental features + + --help, -h (default: false) + show help +``` + +## Notes + +### Fork height + +The fork height is determined by L1 block height (default `latest`). This is then used to derive the corresponding L2 block to start from. + +### Interoperability contracts + +By default, interop contracts are not deployed on forked networks. To include them, run `supersim` with the `--interop.enabled` flag. + +```sh +supersim fork --chains=op,base,zora --interop.enabled +``` + +## Next steps + +* Explore the Supersim [included contracts](/app-developers/tutorials/supersim/chain-env/included-contracts) being used to help replicate the Superchain environment. +* Learn how to [deposit transactions](/app-developers/tutorials/supersim/deposit-transactions) with Supersim, using a much simpler approach that bypasses the derivation pipeline. diff --git a/pages/app-developers/tutorials/supersim/reference/vanilla.mdx b/pages/app-developers/tutorials/supersim/reference/vanilla.mdx new file mode 100644 index 000000000..00c560ec2 --- /dev/null +++ b/pages/app-developers/tutorials/supersim/reference/vanilla.mdx @@ -0,0 +1,136 @@ +--- +title: Vanilla mode +lang: en-US +description: Learn how to use Supersim in vanilla mode (non-forked). +--- + +import { Callout, Steps } from 'nextra/components' + +# Vanilla mode + +This guide explains how to start `supersim` in vanilla (non-forked) mode. By default, two OP Stack systems will be spun up in vanilla mode: + +* OPChainA (chainID 901) +* OPChainB (chainID 902) + Both "roll up" into a single L1 chain (chainID 900). + +## How it works + +```sh +supersim +``` + +Vanilla mode will start 3 chains, with the OP Stack contracts & periphery contracts already deployed. + +* (1) L1 Chain + * Chain 900 +* (2) L2 Chains + * Chain 901 + * Chain 902 + +### Example startup logs + +``` +Available Accounts +----------------------- +(0): 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +(1): 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 +(2): 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC +(3): 0x90F79bf6EB2c4f870365E785982E1f101E93b906 +(4): 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 +(5): 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc +(6): 0x976EA74026E726554dB657fA54763abd0C3a0aa9 +(7): 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955 +(8): 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f +(9): 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 + +Private Keys +----------------------- +(0): 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 +(1): 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d +(2): 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a +(3): 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6 +(4): 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a +(5): 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba +(6): 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e +(7): 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 +(8): 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 +(9): 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 + +Orchestrator Config: +L1: + Name: L1 Chain ID: 900 RPC: http://127.0.0.1:8545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-900 +L2: + Name: OPChainA Chain ID: 901 RPC: http://127.0.0.1:9545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-901 + Name: OPChainB Chain ID: 902 RPC: http://127.0.0.1:9546 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-902 +``` + +## Configuration + +``` +NAME: + supersim - Superchain Multi-L2 Simulator + +USAGE: + supersim [global options] command [command options] + +VERSION: + untagged + +DESCRIPTION: + Local multichain optimism development environment + +COMMANDS: + fork Locally fork a network in the superchain registry + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + + --interop.autorelay (default: false) ($SUPERSIM_INTEROP_AUTORELAY) + Automatically relay messages sent to the L2ToL2CrossDomainMessenger using + account 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 + + --interop.delay value (default: 0) ($SUPERSIM_INTEROP_DELAY) + Delay before relaying messages sent to the L2ToL2CrossDomainMessenger + + --l1.port value (default: 8545) ($SUPERSIM_L1_PORT) + Listening port for the L1 instance. `0` binds to any available port + + --l2.starting.port value (default: 9545) ($SUPERSIM_L2_STARTING_PORT) + Starting port to increment from for L2 chains. `0` binds each chain to any + available port + + --log.color (default: false) ($SUPERSIM_LOG_COLOR) + Color the log output if in terminal mode + + --log.format value (default: text) ($SUPERSIM_LOG_FORMAT) + Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', + 'json-pretty', + + --log.level value (default: INFO) ($SUPERSIM_LOG_LEVEL) + The lowest log level that will be output + + --log.pid (default: false) ($SUPERSIM_LOG_PID) + Show pid in the log + + --logs.directory value ($SUPERSIM_LOGS_DIRECTORY) + Directory to store logs + + --odyssey.enabled (default: false) ($SUPERSIM_ODYSSEY_ENABLED) + Enable odyssey experimental features + + MISC + + + --help, -h (default: false) + show help + + --version, -v (default: false) + print the version +``` + +## Next steps + +* Explore the Supersim [included contracts](/app-developers/tutorials/supersim/chain-env/included-contracts) being used to help replicate the Superchain environment. +* Get network details about the two OP Stack systems spun up in vanilla mode: [OPChainA (chainID 901)](/app-developers/tutorials/supersim/chain-env/chain-a) and [OPChainB (chainID 902)](/app-developers/tutorials/supersim/chain-env/chain-b). +* Learn how to [deposit transactions](/app-developers/tutorials/supersim/deposit-transactions) with Supersim, using a much simpler approach that bypasses the derivation pipeline. diff --git a/pages/app-developers/tutorials/transactions.mdx b/pages/app-developers/tutorials/transactions.mdx new file mode 100644 index 000000000..e87bc9928 --- /dev/null +++ b/pages/app-developers/tutorials/transactions.mdx @@ -0,0 +1,18 @@ +--- +title: Transaction tutorials +lang: en-US +description: A collection of app developer tutorials focused on transactions. +--- + +import { Card, Cards } from 'nextra/components' + +# Transaction tutorials + +This is a collection of app developer tutorials focused on transactions. + + + } /> + } /> + } /> + } /> + diff --git a/pages/app-developers/tutorials/transactions/_meta.json b/pages/app-developers/tutorials/transactions/_meta.json new file mode 100644 index 000000000..f07a50495 --- /dev/null +++ b/pages/app-developers/tutorials/transactions/_meta.json @@ -0,0 +1,6 @@ +{ + "sdk-view-txns": "Viewing deposits and withdrawals by address", + "sdk-trace-txns": "Tracing deposits and withdrawals", + "sdk-estimate-costs": "Estimating transaction costs", + "send-tx-from-eth": "Triggering OP Mainnet transactions from Ethereum" +} \ No newline at end of file diff --git a/pages/app-developers/tutorials/sdk-estimate-costs.mdx b/pages/app-developers/tutorials/transactions/sdk-estimate-costs.mdx similarity index 100% rename from pages/app-developers/tutorials/sdk-estimate-costs.mdx rename to pages/app-developers/tutorials/transactions/sdk-estimate-costs.mdx diff --git a/pages/app-developers/tutorials/sdk-trace-txns.mdx b/pages/app-developers/tutorials/transactions/sdk-trace-txns.mdx similarity index 100% rename from pages/app-developers/tutorials/sdk-trace-txns.mdx rename to pages/app-developers/tutorials/transactions/sdk-trace-txns.mdx diff --git a/pages/app-developers/tutorials/sdk-view-txns.mdx b/pages/app-developers/tutorials/transactions/sdk-view-txns.mdx similarity index 100% rename from pages/app-developers/tutorials/sdk-view-txns.mdx rename to pages/app-developers/tutorials/transactions/sdk-view-txns.mdx diff --git a/pages/app-developers/tutorials/send-tx-from-eth.mdx b/pages/app-developers/tutorials/transactions/send-tx-from-eth.mdx similarity index 100% rename from pages/app-developers/tutorials/send-tx-from-eth.mdx rename to pages/app-developers/tutorials/transactions/send-tx-from-eth.mdx diff --git a/pages/connect/contribute/style-guide.mdx b/pages/connect/contribute/style-guide.mdx index d6ffe8e37..0598dbe85 100644 --- a/pages/connect/contribute/style-guide.mdx +++ b/pages/connect/contribute/style-guide.mdx @@ -320,19 +320,18 @@ Developers trust that we will lead them to sites or pages related to their readi Content types help manage technical content by defining the purpose and common structure for each file type. All content types used in these technical docs have attributes or properties, as defined below. -| Document type | Purpose | Examples | -| ------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| Overviews | General introduction to a product or feature, provides a happy-path for readers | [Smart Contract Overview](/stack/smart-contracts) | -| Guides | Explain what things are and how they work | [Standard Bridge Guide](/app-developers/bridging/standard-bridge) | -| Quick Start Guides | Briefly explain how to "minimally" get started with a product, often in 30 minutes or less | [Superchain App Quick Start](/app-developers/quick-start) | -| Tutorials | Provide task-oriented guidance with step-by-step "learn by doing" instructions | [Bridging ERC-20 tokens with viem](/app-developers/tutorials/cross-dom-bridge-erc20) | -| FAQs | Address frequently asked questions | [FAQ: OP Mainnet Security Model](/stack/security/faq-sec-model) | -| Troubleshooting | List common troubleshooting scenarios and solutions | [Troubleshooting: Run a Node](/operators/node-operators/management/troubleshooting) | -| Reference | Provide deep, theoretical knowledge of the internal workings of a system, such as API endpoints and specifications | [Node and RPC Providers](/app-developers/tools/connect/rpc-providers) | +| Document type | Purpose | Examples | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | +| Overviews or Explainers | General introduction to a product or feature, provides a happy-path for readers | [Superchain Explainer](/superchain/superchain-explainer) | +| Guides | Explain what things are and how they work | [Standard Bridge Guide](/app-developers/bridging/standard-bridge) | +| Tutorials | Provide task-oriented guidance with step-by-step "learn by doing" instructions | [Bridging ERC-20 tokens with viem](/app-developers/tutorials/bridging/cross-dom-bridge-erc20) | +| FAQs | Address frequently asked questions | [FAQ: OP Mainnet Security Model](/stack/security/faq-sec-model) | +| Troubleshooting | List common troubleshooting scenarios and solutions | [Troubleshooting: Run a Node](/operators/node-operators/management/troubleshooting) | +| Reference | Provide deep, theoretical knowledge of the internal workings of a system, such as API endpoints and specifications | [Node and RPC Providers](/app-developers/tools/connect/rpc-providers) | -### Overviews +### Overviews (or Explainers) -Overviews provide a general introduction to a product or service and a happy path for readers on how to navigate a particular set of docs or related features; often used at the top-level of a directory, such as `/app-developers/overview`. When done well, overviews accomplish two essential tasks for users: +Overviews or explainers provide a general introduction to a product or service and a happy path for readers on how to navigate a particular set of docs or related features; often used at the top-level of a directory, such as `/superchain/superchain-explainer`. When done well, overviews and explainers accomplish two essential tasks for users: 1. **organize** the related set of documentation pages to keep developers from getting overloaded by too much information, and 2. **establish a 'happy path'** to direct developers to the right pages in the documentation set based on their user scenario or use case. @@ -358,28 +357,6 @@ To maintain consistency, guides should include all these items: * one or more visual elements (e.g., images, screenshots, illustrations, and/or code samples) * next steps section: links to related tutorials, other guides, troubleshooting, etc. -### Quick starts - -A Quick start guide should be brief (thus "quick"), easy to read, and focused on helping customers get started with only the basics of your product or service. It is usually a condensed version of a longer getting started guide (or a longer tutorial), so it is not a replacement but an accompaniment or companion piece to the docs set. -As a rule, this content type should describe only one scenario. It's value lies in its simplicity and ability to speed up onboarding (e.g., installation, deployment, etc.) and developers' first steps, thus improving the developer experience. - -To maintain consistency, quick start guides should include these items: - -* overview of what the quick start guide will cover and estimated time of how long it will take developers to complete -* guide content organized into discrete sections explaining how to set up the product (e.g., cover minimal setup only) -* clear headings for each section written in parallel style -* next steps section: links to advanced setup options for the product, related tutorials, troubleshooting or error codes, etc. - -When writing tutorials or quick starts, steps should be written in parallel style, as sentences with imperative verbs and not gerunds (ending in "ing"). - -**Example**: - - - Step 1: **Create** Your Site
- Step 2: **Choose** Your Framework
- Step 3: **Visit** the Dev Environment -
- ### Tutorials Tutorials are task-oriented pages or videos that include practical, step-by-step instructions for completing a task, activity, or objective. Tutorials are more interactive and hands-on than other technical documentation, often including practical examples, exercises, and demonstrations to help developers learn by doing. diff --git a/pages/get-started/_meta.json b/pages/get-started/_meta.json index 448c98ad4..e8cdef0bc 100644 --- a/pages/get-started/_meta.json +++ b/pages/get-started/_meta.json @@ -21,7 +21,7 @@ }, "app-devs": { "title": "App Developers", - "href": "/app-developers/overview" + "href": "/app-developers/get-started" }, "chain-ops": { "title": "Chain Operators", diff --git a/pages/index.mdx b/pages/index.mdx index 1775f0b56..64807a72e 100644 --- a/pages/index.mdx +++ b/pages/index.mdx @@ -16,7 +16,7 @@ Information about the Optimism Collective's governance, community, and mission c Whether you're a developer building an app on OP Mainnet, a node operator running an OP Mainnet node, or a chain operator launching your own OP Stack chain, you'll find everything you need to get started right here. - } /> + } /> } /> @@ -31,13 +31,13 @@ Check out these amazing tools, so you can get building with Optimism. } /> - } /> + } /> } /> } /> - } /> + } /> } /> diff --git a/pages/operators/chain-operators/_meta.json b/pages/operators/chain-operators/_meta.json index cf36f6f77..a502f517f 100644 --- a/pages/operators/chain-operators/_meta.json +++ b/pages/operators/chain-operators/_meta.json @@ -6,5 +6,5 @@ "features": "Chain features", "deploy": "Deployment", "tutorials": "Tutorials", - "tools": "Chain tools", + "tools": "Chain tools" } diff --git a/pages/operators/chain-operators/self-hosted.mdx b/pages/operators/chain-operators/self-hosted.mdx index d34193fe2..c42ffe315 100644 --- a/pages/operators/chain-operators/self-hosted.mdx +++ b/pages/operators/chain-operators/self-hosted.mdx @@ -80,7 +80,7 @@ Before launching on Mainnet, thoroughly test and debug OP Chain contracts, featu As part of testing your OP Chain, you'll need to send test or example transactions to the new network. * Test [sending L2 transactions](https://github.com/ethereum-optimism/tx-overload) to understand how much load your new chain can handle. - * Trace [deposits and withdrawals](/app-developers/tutorials/sdk-trace-txns) using the SDK or viem. + * Trace [deposits and withdrawals](/app-developers/tutorials/transactions/sdk-trace-txns) using the SDK or viem. * Run [basic transaction tests](https://metamask.io/) using Metamask. diff --git a/pages/operators/chain-operators/tutorials.mdx b/pages/operators/chain-operators/tutorials.mdx index 199a2b939..6cbe3aeef 100644 --- a/pages/operators/chain-operators/tutorials.mdx +++ b/pages/operators/chain-operators/tutorials.mdx @@ -23,5 +23,5 @@ This section provides information on adding attributes to the derivation functio - + diff --git a/pages/operators/node-operators/json-rpc.mdx b/pages/operators/node-operators/json-rpc.mdx index 8131d9a9b..e02839b29 100644 --- a/pages/operators/node-operators/json-rpc.mdx +++ b/pages/operators/node-operators/json-rpc.mdx @@ -14,7 +14,7 @@ There are several OP Mainnet components with an RPC API, which are reviewed in t Use [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) instead of `rollup_gasPrices` for the L2 gas price. For the L1 gas price, you can call the [`GasPriceOracle`'s `l1BaseFee` function](https://optimistic.etherscan.io/address/0x420000000000000000000000000000000000000F#readProxyContract#F11). - If you want to estimate the cost of a transaction, you can [use the SDK](/app-developers/tutorials/sdk-estimate-costs). + If you want to estimate the cost of a transaction, you can [use the SDK](/app-developers/tutorials/transactions/sdk-estimate-costs). ## op-node diff --git a/pages/operators/node-operators/management.mdx b/pages/operators/node-operators/management.mdx index 865817fd6..9d3c90c60 100644 --- a/pages/operators/node-operators/management.mdx +++ b/pages/operators/node-operators/management.mdx @@ -1,9 +1,7 @@ --- title: Management lang: en-US -description: >- - Learn about management in the Optimism ecosystem. This guide provides detailed - information and resources about management. +description: Find detailed information and resources about node management in the Optimism ecosystem. --- import { Card, Cards } from 'nextra/components' @@ -13,13 +11,15 @@ import { Card, Cards } from 'nextra/components' This section provides information on using blobs, node metrics and monitoring, snap sync for node operators, node snapshots, and troubleshooting. Users will find APIs, references, and guides to help understand and work with these topics. - + } /> - + } /> - + } /> - + } /> - + } /> + + } /> diff --git a/pages/operators/node-operators/management/_meta.json b/pages/operators/node-operators/management/_meta.json index 1f68207f3..7a92a8492 100644 --- a/pages/operators/node-operators/management/_meta.json +++ b/pages/operators/node-operators/management/_meta.json @@ -2,6 +2,7 @@ "blobs": "Using blobs", "snap-sync": "Using Snap Sync", "snapshots": "Snapshot downloads", + "regenesis-history": "Historical data", "metrics": "Monitoring", "troubleshooting": "Troubleshooting" } diff --git a/pages/app-developers/tools/monitor/regenesis-history.mdx b/pages/operators/node-operators/management/regenesis-history.mdx similarity index 100% rename from pages/app-developers/tools/monitor/regenesis-history.mdx rename to pages/operators/node-operators/management/regenesis-history.mdx diff --git a/pages/stack/_meta.json b/pages/stack/_meta.json index be8940ea9..1e619786c 100644 --- a/pages/stack/_meta.json +++ b/pages/stack/_meta.json @@ -14,11 +14,7 @@ "fault-proofs": "Fault proofs", "transactions": "Transactions", "features": "Features", - "security": "Security", - "chain": { - "title": "OP Mainnet", - "display": "hidden" - }, + "cross-chain": "Crosschain guides", "+++ Experimental": { "title": "", "type": "separator" diff --git a/pages/stack/fault-proofs.mdx b/pages/stack/fault-proofs.mdx index 4da08bb26..5f4b994f1 100644 --- a/pages/stack/fault-proofs.mdx +++ b/pages/stack/fault-proofs.mdx @@ -11,15 +11,15 @@ import { Card, Cards } from 'nextra/components' Documentation covering Cannon, Challenger, Explainer, Fp Components, Fp Security, Mips in the Fault Proofs section of the OP Stack ecosystem. - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> diff --git a/pages/stack/getting-started.mdx b/pages/stack/getting-started.mdx index db0e20185..0e86a3efc 100644 --- a/pages/stack/getting-started.mdx +++ b/pages/stack/getting-started.mdx @@ -16,7 +16,7 @@ import { Callout } from 'nextra/components' The OP Stack consists of the many different software components managed and maintained by the Optimism Collective that, together, form the backbone of Optimism. The OP Stack is built as a public good for the Ethereum and Optimism ecosystems. -To understand how to operate an OP Stack chain, including roll-up and chain deployment basics, visit [Chain Operator guide](/operators/chain-operators/self-hosted). Check out these guides to get an overview of everything you need to know to properly support OP mainnet within your [exchange](/app-developers/overview) and [wallet](/app-developers/overview). +To understand how to operate an OP Stack chain, including roll-up and chain deployment basics, visit [Chain Operator guide](/operators/chain-operators/self-hosted). Check out these guides to get an overview of everything you need to know to properly support OP mainnet within your [exchange](/app-developers/get-started) and [wallet](/app-developers/get-started). ## The OP Stack powers Optimism diff --git a/pages/stack/interop.mdx b/pages/stack/interop.mdx index 48498bd03..34b1d1544 100644 --- a/pages/stack/interop.mdx +++ b/pages/stack/interop.mdx @@ -11,27 +11,27 @@ import { Card, Cards } from 'nextra/components' Documentation covering Cross Chain Message, Explainer, Message Passing, Op Supervisor, Superchain Erc20, Superchain Weth, Supersim, Transfer Superchainerc20 in the Interop section of the OP Stack ecosystem. - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> - + } /> diff --git a/pages/stack/interop/_meta.json b/pages/stack/interop/_meta.json index 7e9c7649a..6d7f5b060 100644 --- a/pages/stack/interop/_meta.json +++ b/pages/stack/interop/_meta.json @@ -5,7 +5,6 @@ "op-supervisor": "OP Supervisor", "superchain-weth": "Interoperable ETH", "superchain-erc20": "SuperchainERC20", - "security": "Cross-chain security", "tools": "Tools", "tutorials": "Tutorials" } diff --git a/pages/stack/interop/cross-chain.mdx b/pages/stack/interop/cross-chain.mdx new file mode 100644 index 000000000..f70b6046d --- /dev/null +++ b/pages/stack/interop/cross-chain.mdx @@ -0,0 +1,21 @@ +--- +title: Crosschain guides +description: Documentation covering crosschain reads, contract calls, events, and security. +lang: en-US +--- + +import { Card, Cards } from 'nextra/components' + +# Crosschain guides + +Documentation covering crosschain reads, contract calls, events, and security. + + + } /> + + } /> + + } /> + + } /> + diff --git a/pages/stack/interop/cross-chain/_meta.json b/pages/stack/interop/cross-chain/_meta.json new file mode 100644 index 000000000..cc3c19709 --- /dev/null +++ b/pages/stack/interop/cross-chain/_meta.json @@ -0,0 +1,6 @@ +{ + "contract-calls": "Contract calls (ping pong)", + "event-reads": "Event reads (tic-tac-toe)", + "event-contests": "Event composability (contests)", + "security": "Security measures" +} \ No newline at end of file diff --git a/pages/stack/interop/cross-chain/contract-calls.mdx b/pages/stack/interop/cross-chain/contract-calls.mdx new file mode 100644 index 000000000..f7fbb9517 --- /dev/null +++ b/pages/stack/interop/cross-chain/contract-calls.mdx @@ -0,0 +1,193 @@ +--- +title: Crosschain contract calls (ping pong) +lang: en-US +description: Learn about crosschain contract calls using ping pong. +--- + +import { Callout, Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' + + + +# Crosschain contract calls (ping pong) + +This guide walks through the `CrossChainPingPong.sol` contract, focusing on high level design and steps on integrating the `L2ToL2CrossChainMessenger` contract. For more info, view the [source code](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/pingpong/CrossChainPingPong.sol). + +## High level overview + +`CrossChainPingPong.sol` implements a cross-chain ping-pong game using the `L2ToL2CrossDomainMessenger`. + +* Players hit a **virtual ball** back and forth between allowed L2 chains. The game starts with a serve +* from a designated start chain, and each hit increases the rally count. The contract tracks the last hitter's address, chain ID, and the current rally count. + +### Diagram + +```mermaid +sequenceDiagram + participant Chain1 as Chain 1 + participant Chain2 as Chain 2 + + Note over Chain1: 🚀 Game Starts (starting chain) + Note over Chain1: 🏓 Hit Ball + Chain1->>Chain2: 📤 Send PingPongBall {rallyCount: 1, lastHitter: Chain1} + Chain1-->>Chain1: Emit BallSent event + activate Chain2 + Note over Chain2: 📥 Receive Ball + Chain2-->>Chain2: Emit BallReceived event + + Note over Chain2: 🏓 Hit Ball + Chain2->>Chain1: 📤 Send PingPongBall {rallyCount: 2, lastHitter: Chain2} + Chain2-->>Chain2: Emit BallSent event + deactivate Chain2 + activate Chain1 + Note over Chain1: 📥 Receive Ball + Chain1-->>Chain1: Emit BallReceived event + + Note over Chain1,Chain2: Game continues... +``` + +### Flow + + + ### Contract Deployment + + * Deployed on all participating chains + * Utilizes CREATE2 with the same parameter, `_serverChainId`, resulting in the same address and initial state. + + ### Hit the Ball (Starting Move) + + * Call `hitBallTo` on the chain with the ball, specifying a destination chain. + * Contract uses `L2ToL2CrossDomainMessenger` to send the ball data to the specified chain. + * The reference to the ball is deleted from the serving chain. + + ### Receive on Destination Chain + + * `L2ToL2CrossDomainMessenger` on destination chain calls `receiveBall`. + * Contract verifies the message sender and origin. + * Ball data is stored, indicating its presence on this chain. + + ### Continue Game (Hit) + + * Any user on the chain currently holding the ball calls `hitBallTo` to send it to another chain. + * Contract updates the `PingPongBall` data (increment rally count, update last hitter). + * Process repeats from step 2. + + +## Walkthrough + +Here's an explanation of the functions in the contract, with a focus on how it interacts with `L2ToL2CrossChainMessenger`. + +### Initialize contract state + +#### Constructor Setup + +```solidity +constructor(uint256 _serverChainId) { + if (block.chainid == _serverChainId) { + ball = PingPongBall(1, block.chainid, msg.sender); + } +} +``` + +If the starting chain, initialize the ball allowing it to be hittable. + +#### Reliance on CREATE2 for cross chain consistency + +While not explicitly mentioned in the code, this contract's design implicitly assumes the use of CREATE2 for deployment. Here's why CREATE2 is crucial for this setup: + +* **Predictable Addresses**: + CREATE2 enables deployment at the same address on all chains, crucial for cross-chain message verification: + ```solidity + if (messenger.crossDomainMessageSender() != address(this)) revert InvalidCrossDomainSender(); + ``` + +* **Self-referential Messaging**: + The contract sends messages to itself on other chains: + ```solidity + messenger.sendMessage(_toChainId, address(this), _message); + ``` + This requires `address(this)` to be consistent across chains. + +* **Initialization State Considerations**: + + The starting chain id is apart of the initcode, meaning a deployment with a differing value would result in a different address via CREATE2. This is a nice feature as there's an implicit agreement on the starting chain from the address. + + Without CREATE2, you would need to: + + * Manually track contract addresses for each chain. + * Implement a more complex initialization process to register contract addresses across chains. + * Potentially redesign the security model that relies on address matching. + +### Hit the ball + +`hitBallTo`: This function is used to hit the ball, when present, to another chain + +#### Hitting constraints + +```solidity +function hitBallTo(uint256 _toChainId) public { + if (ball.lastHitterAddress == address(0)) revert BallNotPresent(); + if (_toChainId == block.chainid) revert InvalidDestination(); + ... +} +``` + +* The `ball` contract variable is populated on the chain, indicating its presence +* The destination must be a different chain + +### Define receiving handler + +```solidity +modifier onlyCrossDomainCallback() { + if (msg.sender != address(messenger)) revert CallerNotL2ToL2CrossDomainMessenger(); + if (messenger.crossDomainMessageSender() != address(this)) revert InvalidCrossDomainSender(); + + _; +} + +function receiveBall(PingPongBall memory _ball) onlyCrossDomainCallback() external { + // Hold reference to the ball + ball = _ball; + + emit BallReceived(messenger.crossDomainMessageSource(), block.chainid, _ball); +} +``` + +* The handler simply stores reference to the received ball +* The handler can only be invokable by the cross chain messenger +* Since the contract is self-referential, the cross chain sender must be the same contract address + +### Hit the ball cross-chain + +```solidity +function hitBallTo(uint256 _toChainId) public { + ... + + // Construct a new ball + PingPongBall memory newBall = PingPongBall(ball.rallyCount + 1, block.chainid, msg.sender); + + // Delete current reference + delete ball; + + // Send to the destination + messenger.sendMessage(_toChainId, address(this), abi.encodeCall(this.receiveBall, (newBall))); + + emit BallSent(block.chainid, _toChainId, newBall); +} +``` + +* Populate a new ball with updated properties +* Delete reference to the current ball so it's no longer hittable +* Invoke the contract on the destination chain matching the `receiveBall` handler defined in (2). + +## Takeaways + +This is just one of many patterns to use the `L2ToL2CrossDomainMessenger` in your contract to power cross chain calls. Key points to remember: + +* **Simple Message Passing**: This design sends simple messages between identical contracts on different chains. Each message contains only the essential game state (rally count, last hitter). More complex systems might involve multiple contracts, intermediary relayers. + +* **Cross Chain Sender Verification**: Always verify the sender of cross-chain messages. This includes checking both the immediate caller (the messenger) and the original sender on the source chain. + +* **Cross Chain Contract Coordination**: This design uses CREATE2 for consistent contract addresses across chains, simplifying cross-chain verification. Alternative approaches include: + * Beacon proxy patterns for upgradeable contracts + * Post-deployment setup where contract addresses are specified after deployment diff --git a/pages/stack/interop/cross-chain/event-contests.mdx b/pages/stack/interop/cross-chain/event-contests.mdx new file mode 100644 index 000000000..04a3a0ab6 --- /dev/null +++ b/pages/stack/interop/cross-chain/event-contests.mdx @@ -0,0 +1,199 @@ +--- +title: Crosschain event composability (contests) +lang: en-US +description: Learn about crosschain event composability using contests. +--- + +import { Callout, Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' + + + +# Crosschain event composability (contests) + +We showcase cross chain composability through the implementation of contests. Leveraging the same underlying mechanism powering [TicTacToe](event-reads), these contests can permissionlessly integrate with the events emitted by any contract in the Superchain. + + + See the [frontend documentation](https://github.com/ethereum-optimism/supersim/tree/main/examples/contests) for how the contests UI is presented to the user. + + +## How it works + +Unlike [TicTacToe](event-reads) which is deployed on every participating chain, the contests are deployed on a single L2, behaving like an application-specific OP Stack chain rather than a horizontally scaled app. + + + ### Implement contests + + [Contests.sol](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/contests/Contests.sol) contains the implementation of the contests. We won't go into the details of the implementation here, but instead focus on how the contests can leverage cross chain event reading to compose with other contracts in the Superchain. + + ### Read cross-chain events + + The system predeploy that enables pulling in validated cross-chain events is the [CrossL2Inbox](https://specs.optimism.io/interop/predeploys.html#crossl2inbox). + + ```solidity + contract ICrossL2Inbox { + function validateMessage(Identifier calldata _id, bytes32 _msgHash) external view; + } + ``` + + ### Create the contest + + The two contest options are detailed below: [BlockHash contest](#blockhash-contest) and [TicTacToe contest](#tictactoe-contest). + + #### BlockHash contest + + With the existence of an event that emits the blockhash and height of a block, we can create a contest on the parity of the blockhash being even or odd. + + ```solidity + contract BlockHashEmitter { + event BlockHash(uint256 blockHeight, bytes32 blockHash); + + function emitBlockHash(uint256 _blockHeight) external { + bytes32 hash = blockhash(_blockHeight); + require(hash != bytes32(0)); + + emit BlockHash(_blockHeight, hash); + } + } + ``` + + Integrating this emitter into a contest is extremely simple. The `BlockHashContestFactory` is a simple factory that creates a new contest for a given chain and block height. + + #### TicTacToe contest + + A contest for TicTacToe is created on an accepted game between two players, captured by the emitted `AcceptedGame` event. When decoding the event, the game is uniquely identified by the chain it was created on, `chainId`, and the associated `gameId`. These identifying properties of the game are used to create the resolver for the game. + + ```solidity + contract TicTacToeContestFactory { + Contests public contests; + TicTacToe public tictactoe; + + function newContest(Identifier calldata _id, bytes calldata _data) public payable { + // Validate Log + require(_id.origin == address(tictactoe), "not an event from the TicTacToe contract"); + CrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_id, keccak256(_data)); + + bytes32 selector = abi.decode(_data[:32], (bytes32)); + require(selector == TicTacToe.AcceptedGame.selector, "incorrect event"); + + // Decode the event data + (uint256 chainId, uint256 gameId, address creator,) = abi.decode(_data[32:], (uint256, uint256, address, address)); + + IContestResolver resolver = new TicTacToeGameResolver(contests, tictactoe, chainId, gameId, creator); + contests.newContest{ value: msg.value }(resolver, msg.sender); + } + } + ``` + + ### Resolve contest + + A contest is identified by and has its outcome determined by the `IContestResolver` instance. The resolver starts in the `UNDECIDED` state, updated into `YES` or `NO` when resolving itself + with the contest. + + ```solidity + enum ContestOutcome { + UNDECIDED, + YES, + NO + } + + interface IContestResolver { + function outcome() external returns (ContestOutcome); + } + ``` + + #### Resolve BlockHash contest + + When live, **anyone** can resolve the BlockHash contest by simply providing the right `BlockHash` event to the deployed resolver. + + ```solidity + contract BlockHashContestFactory { + Contests public contests; + BlockHashEmitter public emitter; // Same emitter deployed on every chain + + function newContest(uint256 _chainId, uint256 _blockNumber) public payable { + IContestResolver resolver = new BlockHashResolver(contests, emitter, _chainId, _blockNumber); + contests.newContest{ value: msg.value }(resolver, msg.sender); + } + } + + contract BlockHashResolver is IContestResolver { + Contests public contests; + ContestOutcome public outcome; + BlockHashEmitter public emitter; + + // The target chain & block height + uint256 public chainId; + uint256 public blockNumber; + + function resolve(Identifier calldata _id, bytes calldata _data) external { + require(outcome == ContestOutcome.UNDECIDED); + + // Validate Log + require(_id.origin == address(emitter), "not an event from the emitter"); + require(_id.chainId == chainId, "must match target chain"); + CrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_id, keccak256(_data)); + + bytes32 selector = abi.decode(_data[:32], (bytes32)); + require(selector == BlockHashEmitter.BlockHash.selector, "incorrect event"); + + // Event should correspond to the right contest + uint256 dataBlockNumber = abi.decode(_data[32:64], (uint256)); + require(dataBlockNumber == blockNumber, "must match target block height"); + + // Resolve the contest (yes if odd, no if even) + bytes32 blockHash = abi.decode(_data[64:], (bytes32)); + outcome = uint256(blockHash) % 2 != 0 ? ContestOutcome.YES : ContestOutcome.NO; + contests.resolveContest(this); + } + + } + ``` + + #### Resolve TicTacToe contest + + When live, **anyone** can resolve the TicTacToe contest by providing the `GameWon` or `GameDraw` event of the associated game from the TicTacToe contract. + + ```solidity + contract TicTacToeGameResolver is IContestResolver { + Contests public contests; + ContestOutcome public outcome; + TicTacToe public tictactoe; + + // @notice Game for this resolver + Game public game; + + constructor(Contests _contest, TicTacToe _tictactoe, uint256 _chainId, uint256 _gameId, address _creator) { + contests = _contest; + tictactoe = _tictactoe; + + game = Game({chainId: _chainId, gameId: _gameId, creator: _creator}); + outcome = ContestOutcome.UNDECIDED; + } + + // @notice resolve this game by providing the game ending event + function resolve(Identifier calldata _id, bytes calldata _data) external { + // Validate Log + require(_id.origin == address(tictactoe)); + CrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_id, keccak256(_data)); + + // Ensure this is a finalizing event + bytes32 selector = abi.decode(_data[:32], (bytes32)); + require(selector == TicTacToe.GameWon.selector || selector == TicTacToe.GameDraw.selector, "event not a game outcome"); + + // Event should correspond to the right game + (uint256 _chainId, uint256 gameId, address winner,,) = abi.decode(_data[32:], (uint256, uint256, address, uint8, uint8)); + require(_chainId == game.chainId && gameId == game.gameId); + + // Resolve based on if the creator has won (non-draw) + outcome = winner == game.creator && selector != TicTacToe.GameDraw.selector ? ContestOutcome.YES : ContestOutcome.NO; + contests.resolveContest(this); + } + } + ``` + + +## Takeaways + +* Leveraging superchain interop, contracts in the superchain can compose with each other in a similar fashion to how they would on a single chain. No restrictions are placed on the kinds of events a contract can consume via the `CrossL2Inbox`. +* In this example, the `BlockHashContestFactory` and `TicTacToeContestFactory` can be seen as just starting points for the `Contests` app chain. As more contracts and apps are created in the superchain, developers can compose with them in a similar fashion without needing to change the `Contests` contract at all. diff --git a/pages/stack/interop/cross-chain/event-reads.mdx b/pages/stack/interop/cross-chain/event-reads.mdx new file mode 100644 index 000000000..fd482faee --- /dev/null +++ b/pages/stack/interop/cross-chain/event-reads.mdx @@ -0,0 +1,199 @@ +--- +title: Crosschain event reads (tic-tac-toe) +lang: en-US +description: Learn about crosschain event reads using tic-tac-toe. +--- + +import { Callout, Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' + + + +# Crosschain event reads (tic-tac-toe) + +This guide reviews a horizontally scalable implementation of TicTacToe. This [implementation](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/tictactoe/TicTacToe.sol) allows players to play each other from any chain without cross-chain calls, instead relying on cross-chain event reading. Since superchain interop can allow for event reading with a 1-block latency, the experience is the **same as a single-chain implementation**. + + + Check out the [frontend documentation](https://github.com/ethereum-optimism/supersim/tree/main/examples/tictactoe) to see how the game UI is presented to the player. + + +## How it works + +We use events to define the ordering of the a game with players only maintaining a local view. By default, a chain is also apart of its own interopble dependency set, which means players on the same chain can also play each other **with no code changes**! + +The system predeploy that enables pulling in validated cross-chain events is the [CrossL2Inbox](https://specs.optimism.io/interop/predeploys.html#crossl2inbox). + +```solidity +contract ICrossL2Inbox { + function validateMessage(Identifier calldata _id, bytes32 _msgHash) external view; +} +``` + +This contract relies on a **CREATE2** deployment to ensure a consistent address across all chains, used to assert the origin of the pulled in game event. + + + ### Intent to play + + A game is uniquely identified by the chain it was started from with a unqiue nonce. This identifier is included in all event fields such that each player can uniquely reference it locally. + + To start a game, a player invokes `newGame` which broadcasts a `NewGame` event that any opponent **on any chain** can react to. + + ```solidity + event NewGame(uint256 chainId, uint256 gameId, address player); + + function newGame() external { + emit NewGame(block.chainid, nextGameId, msg.sender); + nextGameId++; + } + ``` + + ### Accepting a game + + When a `NewGame` event is observed, any player can declare their intent to play via `acceptGame`, referencing the `NewGame` event. An `AcceptedGame` event is emitted to signal to the creator that a game is ready to begin. + + ```solidity + event AcceptedGame(uint256 chainId, uint256 gameId, address opponent, address player); + + function acceptGame(ICrossL2Inbox.Identifier calldata _newGameId, bytes calldata _newGameData) external { + if (_newGameId.origin != address(this)) revert IdOriginNotTicTacToe(); + ICrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_newGameId, keccak256(_newGameData)); + + bytes32 selector = abi.decode(_newGameData[:32], (bytes32)); + if (selector != NewGame.selector) revert DataNotNewGame(); + + ... + + emit AcceptedGame(chainId, gameId, game.opponent, game.player); + } + ``` + + To prepare for the game, the event data is decoded and a local view of this game is stored. + + ```solidity + (uint256 chainId, uint256 gameId, address opponent) = abi.decode(_newGameData[32:], (uint256, uint256, address)); + if (opponent == msg.sender) revert SenderIsOpponent(); + + // Record Game Metadata (no moves) + Game storage game = games[chainId][gameId][msg.sender]; + game.player = msg.sender; + game.opponent = opponent; + game.gameId = gameId; + game.lastOpponentId = _newGameId; + game.movesLeft = 9; + + emit AcceptedGame(chainId, gameId, game.opponent, game.player); + ``` + + ### Starting the game + + As `AcceptedGame` events are emmited, the player must pick one opponent to play. The opponent's `AcceptedGame` event is used to instantiate the game and play the starting move via the `MovePlayed` event. + + ```solidity + event MovePlayed(uint256 chainId, uint256 gameId, address player, uint8 _x, uint8 _y); + + function startGame(ICrossL2Inbox.Identifier calldata _acceptedGameId, bytes calldata _acceptedGameData, uint8 _x, uint8 _y) external { + if (_acceptedGameId.origin != address(this)) revert IdOriginNotTicTacToe(); + ICrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_acceptedGameId, keccak256(_acceptedGameData)); + + bytes32 selector = abi.decode(_acceptedGameData[:32], (bytes32)); + if (selector != AcceptedGame.selector) revert DataNotAcceptedGame(); + + ... + + emit MovePlayed(chainId, gameId, game.player, _x, _y); + ``` + + The event fields contain the information required to perform the neccessary validation. + + * The game identifier for lookup + * The caller is the appropriate player + * The player is accepting from the same starting chain + + ```solidity + (uint256 chainId, uint256 gameId, address player, address opponent) = // player, opponent swapped in local view + abi.decode(_acceptedGameData[32:], (uint256, uint256, address, address)); + + // The accepted game was started from this chain, from the sender + if (chainId != block.chainid) revert GameChainMismatch(); + if (msg.sender != player) revert SenderNotPlayer(); + + // Game has not already been started with an opponent. + Game storage game = games[chainId][gameId][msg.sender]; + if (game.opponent != address(0)) revert GameStarted(); + + // Store local view of this game + ... + + // Locally record the move by the player with 1 + game.moves[_x][_y] = 1; + game.lastOpponentId = _acceptedGameId; + + emit MovePlayed(chainId, gameId, game.player, _x, _y); + ``` + + ### Making moves + + Once a game is started, players can continually make moves by invoking `makeMove`, reacting to a `MovePlayed` event of their opponent. + + ```solidity + function makeMove(ICrossL2Inbox.Identifier calldata _movePlayedId, bytes calldata _movePlayedData, uint8 _x, uint8 _y) external { + if (_movePlayedId.origin != address(this)) revert IdOriginNotTicTacToe(); + ICrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_movePlayedId, keccak256(_movePlayedData)); + + bytes32 selector = abi.decode(_movePlayedData[:32], (bytes32)); + if (selector != MovePlayed.selector) revert DataNotMovePlayed(); + } + ``` + + Similar to `acceptGame`, validation is performed and the move of their opponent is first locally recorded. + + * The game identifier for lookup + * The caller is the player for this game + * The opponent event corresponds to the same game + * Ordering is enforced by ensuring that the supplied event is always forward progressing. + + ```solidity + (uint256 chainId, uint256 gameId,, uint8 oppX, uint8 oppY) = abi.decode(_movePlayedData[32:], (uint256, uint256, address, uint8, uint8)); + + // Game was instantiated for this player & the move is for the same game + Game storage game = games[chainId][gameId][msg.sender]; + if (game.player != msg.sender) revert GameNotExists(); + if (game.gameId != gameId) revert GameNotExists(); + + // The move played event is forward progressing from the last observed event + if (_movePlayedId.chainId != game.lastOpponentId.chainId) revert IdChainMismatch(); + if (_movePlayedId.blockNumber <= game.lastOpponentId.blockNumber) revert MoveNotForwardProgressing(); + game.lastOpponentId = _movePlayedId; + + // Mark the opponents move + game.moves[oppX][oppY] = 2; + game.movesLeft--; + ``` + + When a move is played we check if the game has been drawn or won, determining the subsequent event to emit. + + The `makeMove` function is only callable when an opponent has a new `MovePlayed` event. Therefore, if the game is won or drawn, it cannot be progressed any further by the opponent. + + ```solidity + // Make the players move + game.moves[_x][_y] = 1; + game.movesLeft--; + + // Determine the status of the game + if (_isGameWon(game)) { + emit GameWon(chainId, gameId, game.player, _x, _y); + } else if (game.movesLeft == 0) { + emit GameDraw(chainId, gameId, game.player, _x, _y); + } else { + emit MovePlayed(chainId, gameId, game.player, _x, _y); + } + ``` + + +## Takeaways + +Leveraging superchain interop, we can build new types of horizontally scalable contracts that do not rely on hub/spoke messaging with relayers. + +* As new chains are added to the superchain, this contract can be installed by anyone and immediately playable with no necessary code changes. The frontend simply needs to react the addition of a new chain. +* The concept of a "chain" can be completely abstracted away from the user. When connecting their wallet, the frontend can simply pick the chain which the user has funds on with the lowest gas fees. +* Event reading enables a new level of composability for cross-chain interactions. Imagine [contests](event-contests) contract that resolves based on the outcome of a TicTacToe game via the `GameWon` or `GameLost` event without the need for a trusted oracle, nor permission or native integration with the TicTacToe contract. diff --git a/pages/stack/interop/security.mdx b/pages/stack/interop/cross-chain/security.mdx similarity index 99% rename from pages/stack/interop/security.mdx rename to pages/stack/interop/cross-chain/security.mdx index d3979ca37..5215f7313 100644 --- a/pages/stack/interop/security.mdx +++ b/pages/stack/interop/cross-chain/security.mdx @@ -1,5 +1,5 @@ --- -title: Cross-chain security +title: Crosschain security measures lang: en-US description: Security measures for safe interoperability --- @@ -11,7 +11,7 @@ import { InteropCallout } from '@/components/WipCallout' -# Security considerations +# Crosschain security measures ## The trust model diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index 2ad26b111..3499de8c4 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -223,7 +223,8 @@ This means ETH and ERC-20s can seamlessly and securely move across L2s, and inte ## Next steps -* Watch this video that gives an [overview of OP Stack interoperability](https://www.youtube.com/watch?v=FKc5RgjtGes). -* Learn more about the [predeploys that have been added to the OP Stack to enable interoperability](/stack/interop/predeploy). -* Use [Supersim](/stack/interop/tools/supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. +* For more interop docs, check out our collection of [interop guides](/stack/interop). +* Watch this video that gives an overview of [OP Stack interoperability](https://www.youtube.com/watch?v=FKc5RgjtGes). +* Learn more about the [predeploys](/stack/interop/predeploy) added to the OP Stack to enable interoperability. +* Use [Supersim](/stack/interop/tools/supersim), a multichain dev environment that simulates interop for testing applications against a local version of the Superchain. * For more info about how OP Stack interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). diff --git a/pages/stack/interop/message-passing.mdx b/pages/stack/interop/message-passing.mdx index 7d25f156e..4a867a5fa 100644 --- a/pages/stack/interop/message-passing.mdx +++ b/pages/stack/interop/message-passing.mdx @@ -101,6 +101,6 @@ sequenceDiagram * Read how [messages get from one blockchain to another (`CrossL2Inbox`)](explainer#how-messages-get-from-one-chain-to-the-other). * Try [Supersim](tools/supersim) for testing cross-chain messages locally. -* Learn about [manually relaying messages](https://supersim.pages.dev/guides/interop/viem?#viem-to-send-and-relay-interop-messages). +* Learn about [manually relaying messages](/stack/interop/tutorials/relay-messages-viem). {/* After the tutorial for L2ToL2CrossDomainMessenger is written, need to add a link here */} diff --git a/pages/stack/interop/superchain-erc20.mdx b/pages/stack/interop/superchain-erc20.mdx index 51bc1e98b..e32aaac08 100644 --- a/pages/stack/interop/superchain-erc20.mdx +++ b/pages/stack/interop/superchain-erc20.mdx @@ -129,5 +129,5 @@ Once a `SuperchainERC20` contract is properly deployed on the destination chain, * Watch the [ERC20 to SuperchainERC20 video walkthrough](https://www.youtube.com/watch?v=Gb8glkyBdBA) to learn how to modify an existing ERC20 contract to make it interoperable within the Superchain. * Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details. -* Check out the [SuperchainERC20 starter kit](https://github.com/ethereum-optimism/superchainerc20-starter) to get started with implementation. +* Check out the [SuperchainERC20 starter kit](/app-developers/starter-kit) to get started with implementation. * Review the [Deploy SuperchainERC20 tutorial](/stack/interop/tutorials/deploy-superchain-erc20) to learn how to deploy a SuperchainERC20. diff --git a/pages/stack/interop/tools.mdx b/pages/stack/interop/tools.mdx index bdbc47009..11258bc0d 100644 --- a/pages/stack/interop/tools.mdx +++ b/pages/stack/interop/tools.mdx @@ -11,8 +11,8 @@ import { Card, Cards } from 'nextra/components' Documentation covering Interop devnet, Supersim in the Interop section of the OP Stack ecosystem. - + } /> - + } /> diff --git a/pages/stack/interop/tools/supersim.mdx b/pages/stack/interop/tools/supersim.mdx index 674485a66..fb0a2fc44 100644 --- a/pages/stack/interop/tools/supersim.mdx +++ b/pages/stack/interop/tools/supersim.mdx @@ -1,61 +1,10 @@ --- title: Supersim multichain development environment lang: en-US -description: Learn how to use the Supersim local dev environment tool designed to simulate the Optimism Superchain. +description: >- + Learn how to use the Supersim local dev environment tool designed to simulate the Optimism Superchain. --- -import { Callout } from 'nextra/components' +import Supersim from '@/pages/app-developers/tools/supersim.mdx' -# Supersim multichain development environment - - - Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. - - -[Supersim](https://github.com/ethereum-optimism/Supersim) is a local development environment tool designed to simulate the Optimism Superchain for developers building multi-chain applications. It provides a simplified way to test and develop applications that interact with multiple chains within the Superchain ecosystem. - -## Supersim workflow - -```mermaid -graph LR - A[Write Smart Contracts] --> B[Deploy on Supersim] - B --> C[Test Cross-Chain Interactions] - C --> D[Debug and Refine] - D --> B - C --> E[Ready for Production] -``` - -This diagram illustrates the typical workflow for developers using Supersim, from writing smart contracts to testing and refining cross-chain interactions. - -## Features and benefits - -* Simulates multiple OP Stack chains locally (e.g., chain 901, 902) -* Supports testing of cross-chain messaging and interactions -* Includes pre-deployed interoperability contracts -* Offers a CLI interface for starting and managing Supersim instances -* Provides local JSON-RPC endpoints for each simulated chain -* Allows for custom configuration of chain parameters -* Facilitates testing of Superchain-specific features like SuperchainERC20 tokens -* Easy to use with common Ethereum development tools -* Supports chain forking - -## Supersim CLI interaction - -```mermaid -graph TD - A[Developer] --> B[Supersim CLI] - B --> C[Chain 901] - B --> D[Chain 902] - B --> E[...] - C --> F[JSON-RPC Endpoint] - D --> G[JSON-RPC Endpoint] - E --> H[JSON-RPC Endpoint] -``` - -This diagram illustrates how developers interact with Supersim through the CLI, which simulates OP Stack specific features (specifically interop) on locally run chains, each with its own JSON-RPC endpoint and pre-deployed interoperability contracts. - -## Next steps - -* Check out the dedicated [Supersim docs](https://Supersim.pages.dev/) for tutorials and specific use cases. -* Questions about Interop? Check out the FAQ section in the [Superchain Interop Explainer](/stack/interop/explainer#faqs) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). -* For more info about how Superchain interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). + diff --git a/pages/stack/interop/tutorials.mdx b/pages/stack/interop/tutorials.mdx index c034d48a9..3373e513c 100644 --- a/pages/stack/interop/tutorials.mdx +++ b/pages/stack/interop/tutorials.mdx @@ -1,18 +1,24 @@ --- -title: Tutorials +title: Interop tutorials description: Documentation covering Interop related tutorials. lang: en-US --- import { Card, Cards } from 'nextra/components' -# Interop +# Interop tutorials Documentation covering Interop related tutorials. - + } /> - + } /> + + } /> + + } /> + + } /> diff --git a/pages/stack/interop/tutorials/_meta.json b/pages/stack/interop/tutorials/_meta.json index 6d2bdacfa..1cc4da1b6 100644 --- a/pages/stack/interop/tutorials/_meta.json +++ b/pages/stack/interop/tutorials/_meta.json @@ -1,4 +1,7 @@ { - "transfer-superchainERC20": "How to transfer a SuperchainERC20", - "deploy-superchain-erc20": "Deploy assets using SuperchainERC20" + "transfer-superchainERC20": "Transferring a SuperchainERC20", + "deploy-superchain-erc20": "Issuing new assets with SuperchainERC20", + "bridge-crosschain-eth": "Bridging native cross-chain ETH transfers", + "relay-messages-cast": "Relaying interop messages using `cast`", + "relay-messages-viem": "Relaying interop messages using `viem`" } diff --git a/pages/stack/interop/tutorials/bridge-crosschain-eth.mdx b/pages/stack/interop/tutorials/bridge-crosschain-eth.mdx new file mode 100644 index 000000000..3ab2d6df3 --- /dev/null +++ b/pages/stack/interop/tutorials/bridge-crosschain-eth.mdx @@ -0,0 +1,60 @@ +--- +title: Bridging native cross-chain ETH transfers +lang: en-US +description: Learn how to bridge native cross-chain ETH transfers. +--- + +import { Callout } from 'nextra/components' +import { Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' + + + +# Bridging native cross-chain ETH transfers + +Crosschain ETH transfers in the Superchain are facilitated through the [SuperchainWETH](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainWETH.sol) contract. +This tutorial walks through how to send native ETH from chain 901 to 902. To simplify these steps, [supersim](/stack/interop/tools/supersim) will be run with the `--interop.autorelay` flag. The `--interop.autorelay` flag automatically triggers the relay message transaction once the initial send transaction is completed on the source chain, improving the developer experience by removing the need to manually send the relay message. + + + If the source chain uses native ETH as their gas token, but the destination chain uses a custom gas token, then the recipient will receive `SuperchainWETH` on the destination chain. + + + + ### Start `supersim` with the autorelayer enabled + + ```sh + supersim --interop.autorelay + ``` + + ### Initiate the send transaction on chain 901 + + * In this step, you'll send ETH from Chain 901 to Chain 902 through `SuperchainWETH` contract deployed at `0x4200000000000000000000000000000000000024`. + * Use the following command: + + ```sh + cast send 0x4200000000000000000000000000000000000024 "sendETH(address _to, uint256 _chainId)" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 902 --value 10ether --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + ### Wait for the relayed message to appear on chain 902 + + In a few seconds, you should see the relayed message on chain 902: + + ```sh + # example + INFO [12-02|14:53:02.434] SuperchainWETH#RelayETH chain.id=902 from=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 to=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 amount=10,000,000,000,000,000,000 source=901 + ``` + + ### Check the balance on chain 902 + + Verify that the balance of the ETH on chain 902 has increased: + + ```sh + cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9546 + ``` + + +## Next steps + +* Checkout the [SuperchainWETH guide](/stack/interop/superchain-weth) for more information. +* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy your token across the Superchain. +* Review the [Superchain Interop Explainer](/stack/interop/explainer) for answers to common questions about interoperability. diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 96a0c5ff1..00017fa5f 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -1,17 +1,16 @@ --- -title: Deploy assets using SuperchainERC20 +title: Issuing new assets with SuperchainERC20 lang: en-US description: Learn about the basic details of deploying assets on SuperchainERC20 --- import { Callout } from 'nextra/components' import { Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' -# Issuing new assets with SuperchainERC20 + - - Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. - +# Issuing new assets with SuperchainERC20 This guide explains how to issue new assets with the `SuperchainERC20` and bridge them effectively using the `SuperchainERC20Bridge`. If you want more information about the `SuperchainERC20 standard`, see our [`SuperchainERC20` standard explainer](/stack/interop/superchain-erc20) @@ -27,7 +26,7 @@ Note that bridging assets through the Superchain using `SuperchainERC20` never a * `Create2Deployer`: A smart contract that enables deploying contracts with predictable addresses. * `OptimismSuperchainERC20Factory`: A factory contract designed for L1-native tokens to ensure uniform deployments across chains. - There are [many ways to do this](https://github.com/Arachnid/deterministic-deployment-proxy), but [here's an example smart contract to start](https://github.com/ethereum-optimism/superchainerc20-starter/blob/main/packages/contracts/src/L2NativeSuperchainERC20.sol). For an in-depth guide on how to deploy a `SuperchainERC20` use the [SuperchainERC20 Starter Kit](https://console.optimism.io/build). + There are [many ways to do this](https://github.com/Arachnid/deterministic-deployment-proxy), but [here's an example smart contract to start](https://github.com/ethereum-optimism/superchainerc20-starter/blob/main/packages/contracts/src/L2NativeSuperchainERC20.sol). For an in-depth guide on how to deploy a `SuperchainERC20` use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). By deploying assets at identical addresses across multiple chains, we abstract away the complexity of cross-chain validation. @@ -44,6 +43,6 @@ Note that bridging assets through the Superchain using `SuperchainERC20` never a ## Next steps -* Use the [SuperchainERC20 Starter Kit](https://console.optimism.io/build) to deploy your token across the Superchain +* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy your token across the Superchain. * Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details. * Review the [Superchain Interop Explainer](../explainer) for answers to common questions about interoperability. diff --git a/pages/stack/interop/tutorials/relay-messages-cast.mdx b/pages/stack/interop/tutorials/relay-messages-cast.mdx new file mode 100644 index 000000000..71da5e455 --- /dev/null +++ b/pages/stack/interop/tutorials/relay-messages-cast.mdx @@ -0,0 +1,193 @@ +--- +title: Relaying interop messages using `cast` +lang: en-US +description: Learn how to relay interop messages using `cast` commands. +--- + +import { Callout } from 'nextra/components' +import { Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' + + + +# Relaying interop messages using `cast` + +This tutorial walks through how to form a [message identifier](https://specs.optimism.io/interop/messaging.html#message-identifier) to relay a [L2ToL2CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol) cross-chain call. + +We'll perform the SuperchainERC20 interop transfer in [Supersim first steps](/app-developers/tutorials/supersim/getting-started/first-steps##send-an-interoperable-superchainerc20-token-from-chain-901-to-902-l2-to-l2-message-passing) by manually relaying the message without the autorelayer. + +## Contracts used + +* [L2NativeSuperchainERC20](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) + * `0x420beeF000000000000000000000000000000001` +* [L2ToL2CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/92ed64e171c6eb9c6a080c626640e8836f0653cc/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol) + * `0x4200000000000000000000000000000000000023` + +## High level steps + +Sending an interop message using the `L2ToL2CrossDomainMessenger`: + +### On source chain (OPChainA 901) + +1. Invoke `L2NativeSuperchainERC20.sentERC20` to bridge funds + * this leverages `L2ToL2CrossDomainMessenger.sendMessage` to make the cross chain call +2. Retrieve the log identifier and the message payload for the `SentMessage` event. + +### On destination chain (OPChainB 902) + +3. Relay the message with `L2ToL2CrossDomainMessenger.relayMessage` + * which then calls `L2NativeSuperchainERC20.relayERC20` + +## Message identifier + +A message identifier uniquely identifies a log emitted on a chain. +The sequencer and smart contracts (CrossL2Inbox) use the identifier to perform [invariant checks](https://specs.optimism.io/interop/messaging.html#messaging-invariants) to confirm that the message is valid. + +```solidity +struct Identifier { + address origin; // Account (contract) that emits the log + uint256 blocknumber; // Block number in which the log was emitted + uint256 logIndex; // Index of the log in the array of all logs emitted in the block + uint256 timestamp; // Timestamp that the log was emitted + uint256 chainid; // Chain ID of the chain that emitted the log +} +``` + +## Steps + + + ### Start `supersim` + + ```sh + supersim + ``` + + ### Mint tokens to transfer on chain 901 + + Run the following command to mint 1000 `L2NativeSuperchainERC20` tokens to the recipient address: + + ```sh + cast send 0x420beeF000000000000000000000000000000001 "mint(address _to, uint256 _amount)" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000 --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + ### Initiate the send transaction on chain 901 + + Send the tokens from Chain 901 to Chain 902 using the following command: + + ```sh + cast send 0x4200000000000000000000000000000000000028 "sendERC20(address _token, address _to, uint256 _amount, uint256 _chainId)" 0x420beeF000000000000000000000000000000001 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000 902 --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + ### Get the log emitted by the `L2ToL2CrossDomainMessenger` + + The token contract calls the [L2ToL2CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/92ed64e171c6eb9c6a080c626640e8836f0653cc/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol), which emits a message (log) that can be relayed on the destination chain. + + ```sh + $ cast logs --address 0x4200000000000000000000000000000000000023 --rpc-url http://127.0.0.1:9545 + + address: 0x4200000000000000000000000000000000000023 + blockHash: 0x3905831f1b109ce787d180c1ed977ebf0ff1a6334424a0ae8f3731b035e3f708 + blockNumber: 4 + data: 0x000000000000000000000000420beef00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064d9f50046000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000 + logIndex: 1 + topics: [ + 0x382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f320 + 0x0000000000000000000000000000000000000000000000000000000000000386 + 0x000000000000000000000000420beef000000000000000000000000000000001 + 0x0000000000000000000000000000000000000000000000000000000000000000 + ] + ... + ``` + + ### Retrieve the block timestamp the log was emitted in + + Since the message identifier requires the block timestamp, fetch the block info to get the timestamp. + + ```sh + $ cast block 0xREPLACE_WITH_CORRECT_BLOCKHASH --rpc-url http://127.0.0.1:9545 + ... + timestamp 1728507703 + ... + ``` + + ### Prepare the message identifier & payload + + Now we have all the information needed for the message (log) identifier. + + | **Parameter** | **Value** | **Note** | + | ------------- | ------------------------------------------ | -------------------------- | + | origin | 0x4200000000000000000000000000000000000023 | L2ToL2CrossDomainMessenger | + | blocknumber | 4 | from step 4 | + | logIndex | 1 | from step 4 | + | timestamp | 1728507703 | from step 5 | + | chainid | 901 | OPChainA chainID | + + The message payload is the concatenation of the \[...topics, data] in order. + + ``` + 0x + 382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f320 + + 0000000000000000000000000000000000000000000000000000000000000386 + + 000000000000000000000000420beef000000000000000000000000000000001 + + 0000000000000000000000000000000000000000000000000000000000000000 + + 000000000000000000000000420beef00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064d9f50046000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000 + ``` + + Payload: `0x382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f3200000000000000000000000000000000000000000000000000000000000000386000000000000000000000000420beef0000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000420beef00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064d9f50046000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000` + + ### Send the relayMessage transaction + + Call `relayMessage` on the [L2ToL2CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/92ed64e171c6eb9c6a080c626640e8836f0653cc/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol#L126) + + ```solidity + // L2ToL2CrossDomainMessenger.sol (truncated for brevity) + + contract L2ToL2CrossDomainMessenger { + + // ... + + function relayMessage( + ICrossL2Inbox.Identifier calldata _id, + bytes calldata _sentMessage + ) payable + + // ... + } + ``` + + #### `relayMessage` parameters + + * `ICrossL2Inbox.Identifier calldata _id`: identifier pointing to the `SentMessage` log on the source chain + * `bytes memory _sentMessage`: encoding of the log topics & data + + Below is an example call, but make sure to replace them with the correct values you received in previous steps. + + ```sh + $ cast send 0x4200000000000000000000000000000000000023 --gas-limit 200000 \ + "relayMessage((address, uint256, uint256, uint256, uint256), bytes)" \ + "(0x4200000000000000000000000000000000000023, 4, 1, 1728507703, 901)" \ + 0x382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f3200000000000000000000000000000000000000000000000000000000000000386000000000000000000000000420beef0000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000420beef00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064d9f50046000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000 \ + --rpc-url http://127.0.0.1:9546 \ + --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + ``` + + ### Check the balance on chain 902 + + Verify that the balance of the L2NativeSuperchainERC20 on chain 902 has increased: + + ```sh + cast balance --erc20 0x420beeF000000000000000000000000000000001 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9546 + ``` + + +## Alternatives + +This is obviously very tedious to do by hand 😅. Here are some alternatives: + +* use `supersim --interop.autorelay` - this only works on supersim, but relayers for the testnet/prod environment will be available soon! +* [use `viem` bindings/actions](relay-using-viem.md) - if you're using typescript, we have bindings available to make fetching identifiers and relaying messages easy + +## Next steps + +* Check out the collection of [Supersim tutorials](/app-developers/tutorials/supersim) for more resources on building with Interop. +* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy your token across the Superchain. +* Review the [Superchain Interop Explainer](../explainer) for answers to common questions about interoperability. diff --git a/pages/stack/interop/tutorials/relay-messages-viem.mdx b/pages/stack/interop/tutorials/relay-messages-viem.mdx new file mode 100644 index 000000000..7ed258661 --- /dev/null +++ b/pages/stack/interop/tutorials/relay-messages-viem.mdx @@ -0,0 +1,283 @@ +--- +title: Relaying interop messages using `viem` +lang: en-US +description: Learn how to relay interop messages using `viem`. +--- + +import { Callout } from 'nextra/components' +import { Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' + + + +# Relaying interop messages using `viem` + +This tutorials walks through how to use [`viem`](https://viem.sh/) to send and relay interop messages using the `L2ToL2CrossDomainMessenger`. + +We'll perform the SuperchainERC20 interop transfer in [Supersim first steps](/app-developers/tutorials/supersim/getting-started/first-steps##send-an-interoperable-superchainerc20-token-from-chain-901-to-902-l2-to-l2-message-passing) and [Manually relaying interop messages with `cast`](relay-messages-cast), but use `viem` to relay the message without the autorelayer. + + +If you'd like to skip ahead, the full code snippet can be found at the [end of the tutorial](#full-code-snippet). + + +## Steps + + +### Start `supersim` + +```sh +supersim +``` + +### Install TypeScript packages +```sh +npm i viem @eth-optimism/viem +``` + +### Imports & Setup +```ts +import { + http, + encodeFunctionData, + createWalletClient, + parseAbi, + defineChain, + publicActions, +} from "viem"; +import { privateKeyToAccount } from "viem/accounts"; +import { + contracts, + publicActionsL2, + walletActionsL2, + supersimL2A, + supersimL2B, + createInteropSentL2ToL2Messages, + decodeRelayedL2ToL2Messages, +} from "@eth-optimism/viem"; + +// SuperERC20 is in development so we manually define the address here +const L2_NATIVE_SUPERCHAINERC20_ADDRESS = "0x420beeF000000000000000000000000000000001"; +const SUPERCHAIN_TOKEN_BRIDGE_ADDRESS = "0x4200000000000000000000000000000000000028"; + +// Account for 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +const account = privateKeyToAccount("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"); + +// Define chains +// ... left out as we'll use the supersim chain definitions + +// Configure clients with optimism extension +const opChainAClient = createWalletClient({ + transport: http(), + chain: supersimL2A, + account, +}).extend(walletActionsL2()) + .extend(publicActionsL2()) + .extend(publicActions); + +const opChainBClient = createWalletClient({ + transport: http(), + chain: supersimL2B, + account, +}).extend(walletActionsL2()) + .extend(publicActionsL2()) + .extend(publicActions); +``` + +### Mint and Bridge `L2NativeSuperchainERC20` from source chain +```ts +// ####### +// OP Chain A +// ####### + +// 1. Mint 1000 `L2NativeSuperchainERC20` token on chain A + +const mintTxHash = await opChainAClient.writeContract({ + address: L2_NATIVE_SUPERCHAINERC20_ADDRESS, + abi: parseAbi(["function mint(address to, uint256 amount)"]), + functionName: "mint", + args: [account.address, 1000n], +}); + +await opChainAClient.waitForTransactionReceipt({ hash: mintTxHash }); + +// 2. Initiate sendERC20 tx to bridge funds to chain B + +console.log("Initiating sendERC20 on OPChainA to OPChainB..."); +const sendERC20TxHash = await opChainAClient.writeContract({ + address: SUPERCHAIN_TOKEN_BRIDGE_ADDRESS, + abi: parseAbi([ + "function sendERC20(address _token, address _to, uint256 _amount, uint256 _chainId)", + ]), + functionName: "sendERC20", + args: [L2_NATIVE_SUPERCHAINERC20_ADDRESS, account.address, 1000n, BigInt(supersimL2B.id)], +}); + +const sendERC20Receipt = await opChainAClient.waitForTransactionReceipt({ hash: sendERC20TxHash }); + +// 3. Construct the interoperable log data from the sent message + +const { sentMessages } = await createInteropSentL2ToL2Messages(opChainAClient, { receipt: sendERC20Receipt }) +const sentMessage = sentMessages[0] // We only sent 1 message +``` + +### Relay the sent message on the destination chain +```ts + +// ########## +// OP Chain B +// ########## + +// 4. Relay the sent message + +console.log("Relaying message on OPChainB..."); +const relayTxHash = await opChainBClient.relayL2ToL2Message({ + sentMessageId: sentMessage.id, + sentMessagePayload: sentMessage.payload, +}); + +const relayReceipt = await opChainBClient.waitForTransactionReceipt({ hash: relayTxHash }); + +// 5. Ensure the message was relayed successfully + +const { successfulMessages, failedMessages } = decodeRelayedL2ToL2Messages({ receipt: relayReceipt }); +if (successfulMessages.length != 1) { + throw new Error("failed to relay message!") +} + +// 6. Check balance on OPChainB +const balance = await opChainBClient.readContract({ + address: L2_NATIVE_SUPERCHAINERC20_ADDRESS, + abi: parseAbi(["function balanceOf(address) view returns (uint256)"]), + functionName: "balanceOf", + args: [account.address], +}); + +console.log(`Balance on OPChainB: ${balance}`); +``` + + +## Next steps +* Check out the collection of [Supersim tutorials](/app-developers/tutorials/supersim) for more resources on building with Interop. +* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy your token across the Superchain. +* Review the [Superchain Interop Explainer](../explainer) for answers to common questions about interoperability. + +## Full code snippet + +
+ Click to view + +```ts +// Using viem to transfer L2NativeSuperchainERC20 + +import { + http, + encodeFunctionData, + createWalletClient, + parseAbi, + defineChain, + publicActions, +} from "viem"; +import { privateKeyToAccount } from "viem/accounts"; +import { + contracts, + publicActionsL2, + walletActionsL2, + supersimL2A, + supersimL2B, + createInteropSentL2ToL2Messages, + decodeRelayedL2ToL2Messages, +} from "@eth-optimism/viem"; + +// SuperERC20 is in development so we manually define the address here +const L2_NATIVE_SUPERCHAINERC20_ADDRESS = + "0x420beeF000000000000000000000000000000001"; + +// account for 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +const account = privateKeyToAccount("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"); + +// Define chains +// ... left out as we'll use the supersim chain definitions + +// Configure op clients +const opChainAClient = createWalletClient({ + transport: http(), + chain: supersimL2A, + account, +}).extend(walletActionsL2()) + .extend(publicActionsL2()) + .extend(publicActions); + +const opChainBClient = createWalletClient({ + transport: http(), + chain: supersimL2B, + account, +}).extend(walletActionsL2()) + .extend(publicActionsL2()) + .extend(publicActions); + +// ####### +// OP Chain A +// ####### + +// 1. Mint 1000 `L2NativeSuperchainERC20` token + +const mintTxHash = await opChainAClient.writeContract({ + address: L2_NATIVE_SUPERCHAINERC20_ADDRESS, + abi: parseAbi(["function mint(address to, uint256 amount)"]), + functionName: "mint", + args: [account.address, 1000n], +}); + +await opChainAClient.waitForTransactionReceipt({ hash: mintTxHash }); + +// 2. Initiate sendERC20 tx to bridge funds to chain B + +console.log("Initiating sendERC20 on OPChainA..."); +const sendERC20TxHash = await opChainAClient.writeContract({ + address: SUPERCHAIN_TOKEN_BRIDGE_ADDRESS, + abi: parseAbi([ + "function sendERC20(address _token, address _to, uint256 _amount, uint256 _chainId)", + ]), + functionName: "sendERC20", + args: [L2_NATIVE_SUPERCHAINERC20_ADDRESS, account.address, 1000n, BigInt(supersimL2B.id)], +}); + +const sendERC20Receipt = await opChainAClient.waitForTransactionReceipt({ hash: sendERC20TxHash }); + +// 3. Construct the interoperable log data from the sent message + +const { sentMessages } = await createInteropSentL2ToL2Messages(opChainAClient, { receipt: sendERC20Receipt }) +const sentMessage = sentMessages[0] // We only sent 1 message + +// ########## +// OP Chain B +// ########## + +// 4. Relay the sent message + +console.log("Relaying message on OPChainB..."); +const relayTxHash = await opChainBClient.relayL2ToL2Message({ + sentMessageId: sentMessage.id, + sentMessagePayload: sentMessage.payload, +}); + +const relayReceipt = await opChainBClient.waitForTransactionReceipt({ hash: relayTxHash }); + +// 5. Ensure the message was relayed successfully + +const { successfulMessages, failedMessages } = decodeRelayedL2ToL2Messages({ receipt: relayReceipt }); +if (successfulMessages.length != 1) { + throw new Error("failed to relay message!") +} + +// 6. Check balance on OPChainB +const balance = await opChainBClient.readContract({ + address: L2_NATIVE_SUPERCHAINERC20_ADDRESS, + abi: parseAbi(["function balanceOf(address) view returns (uint256)"]), + functionName: "balanceOf", + args: [account.address], +}); + +console.log(`Balance on OPChainB: ${balance}`); +``` +
diff --git a/pages/stack/interop/tutorials/transfer-superchainERC20.mdx b/pages/stack/interop/tutorials/transfer-superchainERC20.mdx index b5dead9f9..53f29596c 100644 --- a/pages/stack/interop/tutorials/transfer-superchainERC20.mdx +++ b/pages/stack/interop/tutorials/transfer-superchainERC20.mdx @@ -1,16 +1,15 @@ --- -title: How to transfer a SuperchainERC20 +title: Transferring a SuperchainERC20 lang: en-US description: Learn how to transfer a SuperchainERC20 between chains using L2ToL2CrossDomainMessenger. --- import { Callout, Steps } from 'nextra/components' +import { InteropCallout } from '@/components/WipCallout' -# How to transfer a SuperchainERC20 + - - Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. - +# Transferring a SuperchainERC20 This guide provides an overview of transferring `SuperchainERC20` tokens between chains. @@ -64,15 +63,15 @@ sequenceDiagram ``` - ### Step 1: Prepare your tokens + ### Prepare your tokens Ensure you have tokens on the source chain using one of these methods: * Use existing tokens you already own - * Mint new tokens using the [SuperchainERC20](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) contract if you have minting permissions + * Mint new tokens using the [SuperchainERC20 contract](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) if you have minting permissions * Acquire tokens through a supported exchange or transfer - ### Step 2: Initiate the transfer + ### Initiate the transfer To start the transfer: @@ -82,7 +81,7 @@ sequenceDiagram * Lock or burn your tokens on the source chain * Emit a message that will be used to mint tokens on the destination chain - ### Step 3: Complete the transfer + ### Complete the transfer To finalize the transfer on the destination chain: @@ -91,10 +90,10 @@ sequenceDiagram 3. The message relay will trigger the minting of tokens on the destination chain - The transfer isn't complete until the message is successfully relayed on the destination chain. See the [technical reference guide](https://supersim.pages.dev/guides/interop/viem?#viem-to-send-and-relay-interop-messages) for specific relay instructions. + The transfer isn't complete until the message is successfully relayed on the destination chain. See the [technical reference guide](/stack/interop/tutorials/relay-messages-viem) for specific relay instructions. - ### Step 4: Verify completion + ### Verify completion After relaying the message: @@ -103,15 +102,15 @@ sequenceDiagram 3. The tokens should now be available for use on the destination chain -For detailed technical instructions including contract addresses, specific commands, and message relaying details, refer to our [technical reference guide](https://supersim.pages.dev/guides/interop/viem?#viem-to-send-and-relay-interop-messages). +For detailed technical instructions including contract addresses, specific commands, and message relaying details, refer to our [technical reference guide](/stack/interop/tutorials/relay-messages-viem). ## Alternative methods You can also use: -* [viem bindings/actions](https://supersim.pages.dev/guides/interop/viem) for TypeScript integration +* [viem bindings/actions](/stack/interop/tutorials/relay-messages-viem) for TypeScript integration ## Next steps -* Read the [Superchain Interop Explainer](/stack/interop/explainer#faqs) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes) -* Use [Supersim](supersim), a local dev environment that simulates Superchain interop for testing applications against a local version of the Superchain +* Read the [Superchain Interop Explainer](/stack/interop/explainer#faqs) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). +* Use [Supersim](/app-developers/tools/supersim), a local dev environment that simulates Superchain interop for testing applications against a local version of the Superchain. diff --git a/pages/stack/transactions/withdrawal-flow.mdx b/pages/stack/transactions/withdrawal-flow.mdx index 2a9e07132..f74db2ff7 100644 --- a/pages/stack/transactions/withdrawal-flow.mdx +++ b/pages/stack/transactions/withdrawal-flow.mdx @@ -17,7 +17,7 @@ Withdrawals require the user to submit three transactions: 3. **Withdrawal finalizing transaction**, which the user submits on L1 after the fault challenge period has passed, to actually run the transaction on L1. - You can see an example of how to do this [in the bridging tutorials](/app-developers/tutorials/cross-dom-bridge-erc20). + You can see an example of how to do this [in the bridging tutorials](/app-developers/tutorials/bridging/cross-dom-bridge-erc20). ## Withdrawal initiating transaction diff --git a/public/_redirects b/public/_redirects index b76cea90b..0b5932371 100644 --- a/public/_redirects +++ b/public/_redirects @@ -5,17 +5,17 @@ /builders/tools/oracles /app-developers/tools/build/oracles /builders/tools/nft-tools /app-developers/tools/build/nft-tools /builders/tools/account-abstraction /app-developers/tools/build/account-abstraction -/builders/tools/analytics-tools /app-developers/tools/monitor/analytics-tools -/builders/tools/regenesis-history /app-developers/tools/monitor/regenesis-history +/builders/tools/analytics-tools /app-developers/tools/build/analytics-tools +/builders/tools/regenesis-history /operators/node-operators/management/regenesis-history /builders/dapp-developers/contracts/account-abstraction /app-developers/tools/build/account-abstraction /stack/security/forced-transfers /stack/security/faq -/builders/dapp-developers/dapp-developer-overview /app-developers/overview +/builders/dapp-developers/dapp-developer-overview /app-developers/get-started /tokenlist /chain/tokenlist /addresses /chain/addresses /identity/optimist-profile /chain/identity/overview /chain/identity/optimist-profile /chain/identity/overview /stack/transactions/transaction-fees /stack/transactions/fees -/builders/tools/monitoring/regenesis-history /app-developers/tools/monitor/regenesis-history +/builders/tools/monitoring/regenesis-history /operators/node-operators/management/regenesis-history /builders/dapp-developers/bridging/basics /app-developers/bridging/basics /resources/glossary /connect/resources/glossary /differences-op-stack /stack/differences @@ -26,7 +26,7 @@ /chain-operators/hacks/overview /operators/chain-operators/hacks/overview /getting-started-op-stack /stack/getting-started /builders/tools/javascript/sdk /operators/chain-operators/tutorials/sdk -/builders/tools/monitoring/analytics-tools /app-developers/tools/monitor/analytics-tools +/builders/tools/monitoring/analytics-tools /app-developers/tools/build/analytics-tools /builders/chain-operators/operations /operators/chain-operators/management/operations /builders/dapp-developers/contracts/cheap-dapp /app-developers/contracts/optimization /builders/dapp-developers/contracts/compatibility /app-developers/contracts/compatibility @@ -38,21 +38,21 @@ /builders/node-operators/network-upgrades/canyon /operators/node-operators/network-upgrades /builders/node-operators/network-upgrades/delta /operators/node-operators/network-upgrades /builders/node-operators/network-upgrades/ecotone /operators/node-operators/network-upgrades -/builders/dapp-developers/code-examples/ecosystem-overview /app-developers/tools/ecosystem-overview -/builders/dapp-developers/quick-start /app-developers/quick-start +/builders/dapp-developers/code-examples/ecosystem-overview /app-developers/tools/build/ecosystem-overview +/builders/dapp-developers/quick-start /app-developers/starter-kit /builders/dapp-developers/bridging/messaging /app-developers/bridging/messaging /builders/dapp-developers/bridging/standard-bridge /app-developers/bridging/standard-bridge /builders/dapp-developers/bridging/custom-bridge /app-developers/bridging/custom-bridge -/builders/dapp-developers/tutorials/first-contract /app-developers/tutorials/first-contract -/builders/dapp-developers/tutorials/cross-dom-bridge-eth /app-developers/tutorials/cross-dom-bridge-eth -/builders/dapp-developers/tutorials/cross-dom-bridge-erc20 /app-developers/tutorials/cross-dom-bridge-erc20 -/builders/dapp-developers/tutorials/sdk-estimate-costs /app-developers/tutorials/sdk-estimate-costs -/builders/dapp-developers/tutorials/sdk-view-txns /app-developers/tutorials/sdk-view-txns -/builders/dapp-developers/tutorials/sdk-trace-txns /app-developers/tutorials/sdk-trace-txns -/builders/dapp-developers/tutorials/send-tx-from-eth /app-developers/tutorials/send-tx-from-eth -/builders/dapp-developers/tutorials/cross-dom-solidity /app-developers/tutorials/cross-dom-solidity -/builders/dapp-developers/tutorials/standard-bridge-standard-token /app-developers/tutorials/standard-bridge-standard-token -/builders/dapp-developers/tutorials/standard-bridge-custom-token /app-developers/tutorials/standard-bridge-custom-token +/builders/dapp-developers/tutorials/first-contract /app-developers/get-started +/builders/dapp-developers/tutorials/cross-dom-bridge-eth /app-developers/tutorials/bridging/cross-dom-bridge-eth +/builders/dapp-developers/tutorials/cross-dom-bridge-erc20 /app-developers/tutorials/bridging/cross-dom-bridge-erc20 +/builders/dapp-developers/tutorials/sdk-estimate-costs /app-developers/tutorials/transactions/sdk-estimate-costs +/builders/dapp-developers/tutorials/sdk-view-txns /app-developers/tutorials/transactions/sdk-view-txns +/builders/dapp-developers/tutorials/sdk-trace-txns /app-developers/tutorials/transactions/sdk-trace-txns +/builders/dapp-developers/tutorials/send-tx-from-eth /app-developers/tutorials/transactions/send-tx-from-eth +/builders/dapp-developers/tutorials/cross-dom-solidity /app-developers/tutorials/bridging/cross-dom-solidity +/builders/dapp-developers/tutorials/standard-bridge-standard-token /app-developers/tutorials/bridging/standard-bridge-standard-token +/builders/dapp-developers/tutorials/standard-bridge-custom-token /app-developers/tutorials/bridging/standard-bridge-custom-token /builders/dapp-developers/transactions/estimates /app-developers/transactions/estimates /builders/dapp-developers/transactions/fees /app-developers/transactions/fees /builders/dapp-developers/transactions/transactions/parameters /app-developers/transactions/parameters @@ -105,20 +105,20 @@ /builders/notices/granite-changes https://github.com/ethereum-optimism/docs/blob/ef619668ae44276edecdfd657157254b9809e2d6/pages/builders/notices/granite-changes.mdx /builders/notices/fp-changes https://github.com/ethereum-optimism/docs/blob/ef619668ae44276edecdfd657157254b9809e2d6/pages/builders/notices/fp-changes.mdx /chain/differences /stack/differences -/builders/app-developers/contracts/optimization /app-developers/overview +/builders/app-developers/contracts/optimization /app-developers/get-started /builders/app-developers/contracts/system-contracts /stack/smart-contracts /builders/app-developers/contracts/compatibility /stack/differences -/builders/app-developers/tutorials/first-contract /app-developers/overview -/builders/cex-wallet-developers/cex-support /app-developers/overview -/builders/cex-wallet-developers/wallet-support /app-developers/overview -/builders/cex-wallet-developers /app-developers/overview +/builders/app-developers/tutorials/first-contract /app-developers/get-started +/builders/cex-wallet-developers/cex-support /app-developers/get-started +/builders/cex-wallet-developers/wallet-support /app-developers/get-started +/builders/cex-wallet-developers /app-developers/get-started /stack/interop/assets/superchain-erc20 /stack/interop/superchain-erc20 /stack/interop/assets/superchain-weth /stack/interop/superchain-weth /stack/interop/transfer-superchainERC20 /stack/interop/tutorials/transfer-superchainERC20 /stack/interop/assets/transfer-superchainERC20 /stack/interop/tutorials/transfer-superchainERC20 /stack/interop/assets/deploy-superchain-erc20 /stack/interop/tutorials/deploy-superchain-erc20 /builders/app-developers/contracts/superchain-erc20 /stack/interop/superchain-erc20 -/builders/chain-operators/tutorials/sdk /app-developers/overview +/builders/chain-operators/tutorials/sdk /app-developers/get-started /stack/explainer /superchain/superchain-explainer /stack/interop/architecture /stack/interop/explainer#interoperability-architecture /stack/interop/cross-chain-message /stack/interop/explainer#how-messages-get-from-one-chain-to-the-other @@ -134,7 +134,7 @@ /builders/tools/fee-calculator /operators/chain-operators/tools/fee-calculator /builders/app-developers/tools/supersim /app-developers/tools/supersim /builders/app-developers/tools/ecosystem-overview /app-developers/tools/ecosystem-overview -/chain/getting-started /app-developers/getting-started +/chain/getting-started /app-developers/building-apps /chain/networks /superchain/networks /chain/addresses /superchain/addresses /chain/tokenlist /superchain/tokenlist @@ -143,6 +143,20 @@ /chain/security/privileged-roles /superchain/privileged-roles /chain/security/faq /stack/security/faq-sec-model /chain/security/security-policy /stack/security/security-policy +/app-developers/tools/overview /app-developers/tools +/app-developers/tools/ecosystem-overview /app-developers/tools/build/ecosystem-overview +/app-developers/quick-start /app-developers/starter-kit +/app-developers/tutorials/cross-dom-bridge-eth /app-developers/tutorials/bridging/cross-dom-bridge-eth +/app-developers/tutorials/cross-dom-bridge-erc20 /app-developers/tutorials/bridging/cross-dom-bridge-erc20 +/app-developers/tutorials/sdk-estimate-costs /app-developers/tutorials/transactions/sdk-estimate-costs +/app-developers/tutorials/sdk-view-txns /app-developers/tutorials/transactions/sdk-view-txns +/app-developers/tutorials/sdk-trace-txns /app-developers/tutorials/transactions/sdk-trace-txns +/app-developers/tutorials/send-tx-from-eth /app-developers/tutorials/transactions/send-tx-from-eth +/app-developers/tutorials/cross-dom-solidity /app-developers/tutorials/bridging/cross-dom-solidity +/app-developers/tutorials/standard-bridge-standard-token /app-developers/tutorials/bridging/standard-bridge-standard-token +/app-developers/tutorials/standard-bridge-custom-token /app-developers/tutorials/bridging/standard-bridge-custom-token +/stack/interop/security /stack/interop/cross-chain/security +/app-developers/getting-started /app-developers/building-apps /builders/chain-operators/tools/proxyd /operators/chain-operators/tools/proxyd /builders/chain-operators/tools/chain-monitoring /operators/chain-operators/tools/chain-monitoring /builders/chain-operators/tools/explorer /operators/chain-operators/tools/explorer @@ -151,3 +165,5 @@ /builders/chain-operators/tools/op-deployer /operators/chain-operators/tools/op-deployer /builders/chain-operators/tools/op-txproxy /operators/chain-operators/tools/op-txproxy /builders/chain-operators/tools/fee-calculator /operators/chain-operators/tools/fee-calculator +/app-developers/tools/monitor/analytics-tools /app-developers/tools/build/analytics-tools +/app-developers/tools/monitor/regenesis-history /operators/node-operators/management/regenesis-history diff --git a/words.txt b/words.txt index e05c8949b..b68ce5f2a 100644 --- a/words.txt +++ b/words.txt @@ -20,6 +20,7 @@ Ankr Apeworx Arweave authrpc +autorelayer basefee Betanet betanet @@ -62,6 +63,7 @@ callouts CCIP Celestia Celestia's +chainid Chainlink chainlist Chainstack @@ -69,8 +71,10 @@ chaosnet Chugsplash Clabby codebases +Collateralized collateralized compr +Comprensive COMPUTEPENDINGBLOCK computependingblock confs @@ -78,6 +82,7 @@ Consen corsdomain counterfactually Crosschain +crosschain Crossmint Dapphub daserver @@ -101,6 +106,7 @@ dripcheck Drippie Eigen EIPs +emmited ENABLEDEPRECATEDPERSONAL enabledeprecatedpersonal enginekind @@ -146,6 +152,7 @@ GLOBALSLOTS globalslots gokzg growthepie +Hackathon hardfork hardforks HEALTHCHECK @@ -167,6 +174,9 @@ Inator inator INFLUXDBV influxdbv +initcode +interopble +invokable IPCDISABLE ipcdisable ipcfile @@ -222,10 +232,12 @@ MTHI MTLO MULT multiaddr +Multichain multichain multiclient multisigs MULTU +neccessary nethermind NETRESTRICT netrestrict @@ -314,8 +326,10 @@ QRNG Quicknode quicknode quickstarts +rebalancing Regenesis regenesis +Reimagine REJOURNAL rejournal REMOTEDB @@ -358,7 +372,6 @@ Snapsync snapsync Soneium soyboy -spacebar Spearbit SRAV SRLV @@ -376,7 +389,8 @@ Superchain superchain Superchain's Superchainerc -Superchains +Superlend +Superloans Superscan Supersim supersim @@ -405,6 +419,7 @@ undercollateralize Unichain unmetered Unprotect +unqiue unsubmitted UPNP VERKLE