Skip to content

Commit

Permalink
Merge pull request #181 from ethereum-optimism/sc/page-folders
Browse files Browse the repository at this point in the history
feat: move sections into folders
  • Loading branch information
cpengilly authored Nov 21, 2023
2 parents b141fff + 97e8793 commit 44484ac
Show file tree
Hide file tree
Showing 115 changed files with 216 additions and 188 deletions.
91 changes: 42 additions & 49 deletions pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,13 @@
"pagination": false
}
},
"---1": {
"type": "separator",
"title": "BUILDERS"
},
"dapp-developers": "Dapp Developers",
"chain-operators": "Chain Operators",
"node-operators": "Node Operators",
"cex-wallet-developers": "Wallets & CEXs",
"tools": "Developer Tools",
"---2": {
"type": "separator"
},

"faucet": {
"title": "Superchain Faucet",
"type": "page",
"href": "https://app.optimism.io/faucet?utm_source=docs",
"newWindow": true
},
"---3": {
"type": "separator",
"title": "OP MAINNET"
},
"getting-started-op-mainnet": "Getting Started: OP Mainnet",
"differences": "Ethereum <> OP Mainnet",
"op-networks": "OP Networks",
"addresses": "Contract Addresses",
"tokenlist": "Bridged Token Addresses",
"identity": "Identity",
"testing": "Testing",
"security": "Security",
"---4": {
"type": "separator"
},

"gas": {
"title": "Gas Tracker",
"type": "page",
Expand All @@ -56,29 +29,49 @@
"href": "https://status.optimism.io/",
"newWindow": true
},
"---5": {
"type": "separator",
"title": "OP STACK"

"--- BUILDERS": {
"title": "BUILDERS",
"type": "separator"
},
"builders": {
"title": "Builders",
"display": "children"
},

"+++ OP MAINNET": {
"type": "separator"
},
"--- OP MAINNET": {
"title": "OP MAINNET",
"type": "separator"
},
"chain": {
"title": "OP Mainnet",
"display": "children"
},
"getting-started-op-stack": "Getting Started: OP Stack",
"differences-op-stack": "OP Stack <> L1 Ethereum",
"explainer": "Superchain Explainer",
"landscape": "OP Stack Landscape",
"protocol": "Protocol",
"transaction-fees": "Transaction Fees",
"op-stack-security": "Security",
"---6": {

"+++ OP STACK": {
"type": "separator"
},
"---7": {
"type": "separator",
"title": "CONNECT"
"--- OP STACK": {
"title": "OP STACK",
"type": "separator"
},
"contribute": "Contribute",
"resources": "Resources",
"governance": {
"title": "Optimism Governance",
"href": "https://community.optimism.io/docs/governance/",
"newWindow": true
"stack": {
"title": "OP Stack",
"display": "children"
},

"+++ CONNECT": {
"type": "separator"
},
"--- CONNECT": {
"title": "CONNECT",
"type": "separator"
},
"connect": {
"title": "Connect",
"display": "children"
}
}
}
7 changes: 7 additions & 0 deletions pages/builders/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dapp-developers": "Dapp Developers",
"chain-operators": "Chain Operators",
"node-operators": "Node Operators",
"cex-wallet-developers": "Wallets & CEXs",
"tools": "Developer Tools"
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You connect to OP Mainnet the same way you do to Ethereum, by connecting to a JS

### Endpoints

You can choose between our public endpoints, which are rate limited, and endpoints from [infrastructure providers](/op-networks). Given rate throughput limits, we recommend using a private rpc provider for both mainnet and testnet use cases.
You can choose between our public endpoints, which are rate limited, and endpoints from [infrastructure providers](/chain/op-networks). Given rate throughput limits, we recommend using a private rpc provider for both mainnet and testnet use cases.

### ETH balance

Expand Down Expand Up @@ -46,23 +46,23 @@ The ERC-20 contracts on OP Mainnet function the same way they do on Ethereum, so

Most of the cost of an OP Mainnet transaction is not the gas consumed by the transaction itself (which is rarely above 0.001 gwei per gas), but the cost of writing the transaction in Ethereum. That cost is deducted automatically from the user's balance on OP Mainnet. If you charge your users the cost of withdrawals, you have to account for it.

You can read more about [transaction fees](/transaction-fees/overview).
The relevant code is [here](/tools/javascript/sdk-estimate-gas).
You can read more about [transaction fees](/stack/transaction-fees/overview).
The relevant code is [here](/builders/tools/javascript/sdk-estimate-gas).

## Deposits and withdrawals across chains

As a centralized exchange, there will be times that withdrawals of ETH or an ERC-20 token on either OP Mainnet or Ethereum exceed deposits and you need to transfer assets.
To do that you use a bridge or a gateway.
We have a [standard gateway](https://app.optimism.io/bridge) that receives assets on L1 (Ethereum mainnet), and mints the equivalent asset on OP Mainnet.
When a user wants to withdraw the assets back to L1, the bridge burns the asset on L2 and releases it to the user on L1. If you want to use this gateway automatically, [follow this tutorial for ETH](/dapp-developers/tutorials/cross-dom-bridge-eth) or [this one for ERC-20 tokens](/dapp-developers/tutorials/cross-dom-bridge-erc20).
When a user wants to withdraw the assets back to L1, the bridge burns the asset on L2 and releases it to the user on L1. If you want to use this gateway automatically, [follow this tutorial for ETH](/builders/dapp-developers/tutorials/cross-dom-bridge-eth) or [this one for ERC-20 tokens](/builders/dapp-developers/tutorials/cross-dom-bridge-erc20).

Note that while L1 to L2 transactions typically take minutes, L2 to L1 transaction on the gateway require [a seven day challenge period](https://help.optimism.io/hc/en-us/articles/4411895558171-Why-do-I-need-to-wait-a-week-when-moving-assets-out-of-Optimism-).

Alternatively, you can use a [third party bridge](https://www.optimism.io/apps/bridges). These bridges usually rely on liquidity pools to allow for faster withdrawals and support multiple L2 chains. However, their token selection might be more limited and they may not be as decentralized as our gateway.

When an ERC-20 token does not have an OP Mainnet equivalent you can create one.
If there is no need for custom business logic, you can [follow the steps in this tutorial](/dapp-developers/tutorials/standard-bridge-standard-token).
If you need to implement some kind of custom logic, [see this tutorial](/dapp-developers/tutorials/standard-bridge-custom-token).
If there is no need for custom business logic, you can [follow the steps in this tutorial](/builders/dapp-developers/tutorials/standard-bridge-standard-token).
If you need to implement some kind of custom logic, [see this tutorial](/builders/dapp-developers/tutorials/standard-bridge-custom-token).

## Audit reports

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ These fee discrepancies are an inherent result of the fact that OP Mainnet is a

## Connect to OP Mainnet

OP Mainnet shares the [Ethereum JSON-RPC API](https://eth.wiki/json-rpc/API) with only [a few minor differences](/node-operators/json-rpc).
You'll find all of the important information about OP Mainnet, as well as any test networks, on [our Networks page](/op-networks).
You can choose to connect to OP Mainnet via our rate-limited public endpoints, [private endpoints from infrastructure providers](/op-networks), or [by running your own node](/node-operators/tutorials/node-from-source).
Because of throughput limits, we recommend using private node [providers](/tools/rpc-providers) or running your own node for production applications.
OP Mainnet shares the [Ethereum JSON-RPC API](https://eth.wiki/json-rpc/API) with only [a few minor differences](/builders/node-operators/json-rpc).
You'll find all of the important information about OP Mainnet, as well as any test networks, on [our Networks page](/chain/op-networks).
You can choose to connect to OP Mainnet via our rate-limited public endpoints, [private endpoints from infrastructure providers](/chain/op-networks), or [by running your own node](/builders/node-operators/tutorials/node-from-source).
Because of throughput limits, we recommend using private node [providers](/builders/tools/rpc-providers) or running your own node for production applications.

## Canonical token addresses

Expand Down Expand Up @@ -47,16 +47,16 @@ Transactions are considered "Sequencer Confirmed" as soon as their transaction r

## Transaction fees

In OP Mainnet transaction fees include both an [L1 data fee](/transaction-fees/overview#estimating-the-l1-data-fee) and an [L2 execution fee](/transaction-fees/overview#the-l2-execution-fee).
To display the entire estimated cost of a transaction to your users we recommend you [use the SDK](/tools/javascript/sdk-estimate-gas).
In OP Mainnet transaction fees include both an [L1 data fee](/stack/transaction-fees/overview#estimating-the-l1-data-fee) and an [L2 execution fee](/stack/transaction-fees/overview#the-l2-execution-fee).
To display the entire estimated cost of a transaction to your users we recommend you [use the SDK](/builders/tools/javascript/sdk-estimate-gas).
We **highly recommend** displaying fees on OP Mainnet (and any other OP Stack chain that uses the same mechanism) as one unified fee to minimize user confusion.

In Bedrock we support [EIP 1559](https://eips.ethereum.org/EIPS/eip-1559).
Therefore, the L2 execution fee is composed of two components: a fixed (per-block) base fee and a user selected priority fee.

### Base fee

[The EIP 1559 parameters](/differences-op-stack#pre--EIP--155-support) have different values in OP Mainnet (and many other OP Stack chains) than those on L1 Ethereum.
[The EIP 1559 parameters](/stack/differences-op-stack#pre--EIP--155-support) have different values in OP Mainnet (and many other OP Stack chains) than those on L1 Ethereum.
As a result, in every block the base fee can be between 98% and 110% of the previous value.
As blocks are produced every two seconds, the base fee can be between 54% and 1,745% of the value a minute earlier.
If it takes the user fourteen seconds to approve the transaction in the wallet, the base fee can almost double in that time.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ These fields apply to output root proposals.

### L1 data fee

These fields apply to the cost of the [L1 data fee](/transaction-fees/overview#the-l1-data-fee) for L2 transactions.
These fields apply to the cost of the [L1 data fee](/stack/transaction-fees/overview#the-l1-data-fee) for L2 transactions.

| Key | Type | Description | Default value |
| --- | --- | --- | --- |
Expand All @@ -99,7 +99,7 @@ These fields apply to the cost of the [L1 data fee](/transaction-fees/overview#t

### EIP 1559 gas algorithm

These fields apply to [the EIP 1559 algorithm](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) used for the [L2 execution costs](/transaction-fees/overview/#the-l2-execution-fee) of transactions on the blockchain.
These fields apply to [the EIP 1559 algorithm](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) used for the [L2 execution costs](/stack/transaction-fees/overview/#the-l2-execution-fee) of transactions on the blockchain.

| Key | Type | Description | Default value | Value on L1 Ethereum |
| --- | --- | --- | --- | --- |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You'll need to create a separate archive node and install a Docker Engine to wor

Blockscout expects to interact with an Ethereum execution client in [archive mode](https://www.alchemy.com/overviews/archive-nodes#archive-nodes).
If your `op-geth` is running in full mode, you can create a separate archive node.
To do so, follow the [directions to add a node](/getting-started-op-stack#adding-nodes), but in the command you use to start `op-geth` replace:
To do so, follow the [directions to add a node](/stack/getting-started-op-stack#adding-nodes), but in the command you use to start `op-geth` replace:

```sh
--gcmode=full \
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Like with events, transactions on an OP Stack chain can be triggered whenever a

The Derivation layer is one of the most flexible layers of the stack. Transactions can be generated from all sorts of raw input data and can be triggered from all sorts of conditions. You can derive transactions from any piece of data that can be found in the Data Availability layer modules!

[Tutorial: Adding attributes to the derivation function](/chain-operators/sample-hacks/adding-derivation-attributes).
[Tutorial: Adding attributes to the derivation function](/builders/chain-operators/sample-hacks/adding-derivation-attributes).
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ It’s also possible to create alternative execution client implementations to i

The OP Stack allows you to replace the EVM with *any* state transition function, as long as the transition can be triggered via the Engine API. This has, for example, been used to implement an OP Stack chain that runs a GameBoy emulator rather than the EVM.

[Tutorial: Adding a precompile](/chain-operators/sample-hacks/adding-precompiles).
[Tutorial: Adding a precompile](/builders/chain-operators/sample-hacks/adding-precompiles).
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Callout } from 'nextra/components'

Welcome to OP Stack Hacks, the **highly experimental** region of the OP Stack docs. OP Stack Hacks are an unofficial guide for messing around with the OP Stack. Here you’ll find information about ways that the OP Stack can be modified in interesting ways.

OP Stack Hacks create blockchains that aren’t exactly OP Stack, and may be insecure. Hacked OP Stack chains can break key invariants that are required to interoperate with [the Optimism Superchain](/explainer). **Developers of chains that wish to interoperate with [the Optimism Superchain](/explainer) should *not* include any hacks**. When in doubt, stick with the official components within [the current release of the OP Stack](/getting-started-op-stack#the-op-stack-today).
OP Stack Hacks create blockchains that aren’t exactly OP Stack, and may be insecure. Hacked OP Stack chains can break key invariants that are required to interoperate with [the Optimism Superchain](/stack/explainer). **Developers of chains that wish to interoperate with [the Optimism Superchain](/stack/explainer) should *not* include any hacks**. When in doubt, stick with the official components within [the current release of the OP Stack](/stack/getting-started-op-stack#the-op-stack-today).

<Callout type="warning">
OP Stack Hacks are explicitly things that you can do with the OP Stack that are *not* currently intended for production use.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Steps } from 'nextra/components'
This tutorial explains how to use the OP Stack Client SDK when working with native and non-native supported chains.

* [The OP Stack Client SDK](https://sdk.optimism.io/) *natively* supports multiple OP Chains: OP, Base, etc. To see whether a specific OP Chain is supported directly, [see the documentation](https://sdk.optimism.io/enums/l2chainid).
* If you are using a chain that is *not* natively supported, for example an OP Stack chain [you just created](/getting-started-op-stack), you can continue to use [the OP Stack Client SDK](https://sdk.optimism.io/).
* If you are using a chain that is *not* natively supported, for example an OP Stack chain [you just created](/stack/getting-started-op-stack), you can continue to use [the OP Stack Client SDK](https://sdk.optimism.io/).
You just need to provide some contract addresses to the `CrossDomainMessenger` because they aren't preconfigured. This tutorial walks you through that process.

## Before You Begin
Expand All @@ -20,7 +20,7 @@ To configure the `CrossDomainMessenger`, you'll first need to locate the L1 cont

### L1 contract addresses

If you followed the directions in [Getting Started](/getting-started-op-stack), the contract addresses are in `.../optimism/packages/contracts-bedrock/deployments`, which you created when you deployed the L1 contracts.
If you followed the directions in [Getting Started](/stack/getting-started-op-stack), the contract addresses are in `.../optimism/packages/contracts-bedrock/deployments`, which you created when you deployed the L1 contracts.

| Contract name when creating `CrossDomainMessenger` | File with address |
| - | - |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Each message from L2 to L1 requires three transactions:

2. An L1 transaction that *proves* the transaction.
This transaction can only be submitted after L2 block including your L2 transaction is proposed on L1.
This transaction is expensive because it includes verifying a [Merkle trie](/resources/glossary#merkle-patricia-trie) inclusion proof on L1.
This transaction is expensive because it includes verifying a [Merkle trie](/connect/resources/glossary#merkle-patricia-trie) inclusion proof on L1.

3. An L1 transaction that *finalizes* the transaction.
This transaction can only be submitted after the transaction challenge period (7 days on mainnet) has passed.
Expand All @@ -216,7 +216,7 @@ The L1 proof and finalization transactions are typically significantly more expe

One of the most important things to understand about L1 ⇔ L2 interaction is that **mainnet messages sent from Layer 2 to Layer 1 cannot be relayed for at least 7 days**.
This means that any messages you send from Layer 2 will only be received on Layer 1 after this one week period has elapsed.
We call this period of time the "challenge period" because it is the time during which a transaction can be challenged with a [fault proof](/protocol/overview#fault-proofs).
We call this period of time the "challenge period" because it is the time during which a transaction can be challenged with a [fault proof](/stack/protocol/overview#fault-proofs).

Optimistic Rollups are "optimistic" because they're based around the idea of publishing the *result* of a transaction to Ethereum without actually executing the transaction on Ethereum.
In the "optimistic" case, this transaction result is correct and we can completely avoid the need to perform complicated (and expensive) logic on Ethereum.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Certain interactions, like transferring ETH and ERC-20 tokens between the two ne

The standard bridge functionality provides a method for an ERC-20 token to be deposited and locked on L1 in exchange of the same amount of an equivalent token on L2. This process is known as "bridging a token", e.g. depositing 100 USDC on L1 in exchange for 100 USDC on L2 and also the reverse - withdrawing 100 USDC on L2 in exchange for the same amount on L1. In addition to bridging tokens the standard bridge is also used for ETH.

The Standard Bridge is composed of two main contracts the [`L1StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/65ec61dde94ffa93342728d324fecf474d228e1f/packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol) (for Layer 1) and the [`L2StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/65ec61dde94ffa93342728d324fecf474d228e1f/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol) (for Layer 2). The contract addresses can be found [here](/op-networks#contract-addresses).
The Standard Bridge is composed of two main contracts the [`L1StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/65ec61dde94ffa93342728d324fecf474d228e1f/packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol) (for Layer 1) and the [`L2StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/65ec61dde94ffa93342728d324fecf474d228e1f/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol) (for Layer 2). The contract addresses can be found [here](/chain/op-networks#contract-addresses).

Here we'll go over the basics of using this bridge to move ERC-20 assets between Layer 1 and Layer 2.

Expand Down Expand Up @@ -132,7 +132,7 @@ Instead, you can use the `withdraw` or `withdrawTo` functions on the [`L2Standar
## The Superchain token list

The Standard bridge allows a one-to-many mapping between L1 and L2 tokens, meaning that there can be many OP Mainnet implementations of an L1 token.
However there is always a one-to-one mapping between L1 and L2 tokens in the [Superchain token list](/tokenlist).
However there is always a one-to-one mapping between L1 and L2 tokens in the [Superchain token list](/chain/tokenlist).
The Superchain token list is used as the source of truth for the [OP Mainnet bridge UI](https://app.optimism.io/bridge/deposit) which is the main portal for moving assets between Layer 1 and Layer 2.

If you want to have your token added to the Superchain token list, you must make a pull request against the [Superchain token list repository](https://github.com/ethereum-optimism/ethereum-optimism.github.io#adding-a-token-to-the-list).
Expand Down
File renamed without changes.
Loading

0 comments on commit 44484ac

Please sign in to comment.