Skip to content

Commit fee614a

Browse files
committed
fix merged conflict
2 parents 32bb82d + 1efa7de commit fee614a

File tree

170 files changed

+1612
-1512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+1612
-1512
lines changed

.coderabbit.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ reviews:
1111
"ALWAYS review Markdown content THOROUGHLY with the following criteria:
1212
- Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
1313
- Avoid gender-specific language and use the imperative form.
14-
- Monitor capitalization for emphasis. Use **bold** for prominence instead of all caps or italics.
14+
- Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
1515
- Ensure proper nouns are capitalized in sentences.
1616
- Apply the Oxford comma.
1717
- Use proper title case for headers, buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
1818
- Use correct spelling and grammar at all times (IMPORTANT).
19+
- Use sentence case for H1, H2, and H3 headers, capitalizing only the first word and any proper nouns.
20+
- For all headers (H1, H2, H3), do not change the capitalization of proper nouns; keep them as they are.
1921
"
2022
auto_review:
2123
enabled: true

components/WipCallout.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,21 @@ export function InfoCallout({ context }: Props): ReactElement {
7373
);
7474
}
7575

76-
export function AltCallout({ context }: Props): ReactElement {
76+
interface BetaCalloutProps extends Props {
77+
featureName: string;
78+
}
79+
80+
function BetaCallout({ context, featureName }: BetaCalloutProps): ReactElement {
7781
return (
7882
<div className="custom-callouts nx-w-full nx-mt-6 nx-flex nx-justify-center nx-items-center nx-bg-white dark:nx-bg-black">
79-
<div className="nx-w-full nx-px-4 nx-text-center nx-font-medium nx-text-sm nx-text-left">
83+
<div className="nx-w-full nx-px-4 nx-text-center nx-font-medium nx-text-sm nx-text-left">
8084
{context ? (
8185
context
8286
) : (
83-
<div className="nx-text-left">
84-
The Alt-DA Mode feature is currently in <strong>Beta</strong> within
87+
<div className="nx-text-left" role="alert" aria-live="polite">
88+
The {featureName} feature is currently in <strong>Beta</strong> within
8589
the MIT-licensed OP Stack. Beta features are built and reviewed by
86-
the Optimism Collectives core contributors, and provide developers
90+
the Optimism Collective's core contributors, and provide developers
8791
with early access to highly requested configurations. These features
8892
may experience stability issues, and we encourage feedback from our
8993
early users.
@@ -93,3 +97,11 @@ export function AltCallout({ context }: Props): ReactElement {
9397
</div>
9498
);
9599
}
100+
101+
export function AltCallout(props: Props): ReactElement {
102+
return <BetaCallout {...props} featureName="Alt-DA Mode" />;
103+
}
104+
105+
export function CGTCallout(props: Props): ReactElement {
106+
return <BetaCallout {...props} featureName="Custom Gas Token" />;
107+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"algoliasearch": "^4.23.3",
2323
"clsx": "^2.1.1",
2424
"escape-string-regexp": "^5.0.0",
25-
"next": "13.5.1",
25+
"next": "14.2.10",
2626
"next-sitemap": "^4.2.3",
2727
"nextra": "2.13.2",
2828
"nextra-theme-docs": "2.13.2",

pages/builders/app-developers/bridging/basics.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
---
2-
title: Bridging Basics
2+
title: Bridging basics
33
lang: en-US
44
description: Learn about the fundamentals of sending data and tokens between Ethereum and OP Mainnet.
55
---
66

7-
# Bridging Basics
7+
# Bridging basics
88

99
OP Mainnet is a "Layer 2" system and is fundamentally connected to Ethereum.
1010
However, OP Mainnet is also a distinct blockchain with its own blocks and transactions.
1111
App developers commonly need to move data and tokens between OP Mainnet and Ethereum.
1212
This process of moving data and tokens between the two networks is called "bridging".
1313

14-
## Sending Tokens
14+
## Sending tokens
1515

1616
One of the most common use cases for bridging is the need to send ETH or ERC-20 tokens between OP Mainnet and Ethereum.
1717
OP Mainnet has a system called the [Standard Bridge](./standard-bridge) that makes it easy to move tokens in both directions.
1818
If you mostly need to bridge tokens, make sure to check out the [Standard Bridge](./standard-bridge) guide.
1919

20-
## Sending Data
20+
## Sending data
2121

2222
Under the hood, the Standard Bridge is just an application that uses the OP Mainnet [message passing system to send arbitrary data between Ethereum and OP Mainnet](./messaging).
2323
Applications can use this system to have a contract on Ethereum interact with a contract on OP Mainnet, and vice versa.
2424
All of this is easily accessible with a simple, clean API.
2525

26-
## Next Steps
26+
## Next steps
2727

2828
Ready to start bridging?
2929
Check out these tutorials to get up to speed fast.

pages/builders/app-developers/bridging/custom-bridge.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Custom Bridges
2+
title: Custom bridges
33
lang: en-US
44
description: Important considerations when building custom bridges for OP Mainnet.
55
---
66

77
import { Callout } from 'nextra/components'
88

9-
# Custom Bridges
9+
# Custom bridges
1010

1111
Custom token bridges are any bridges other than the [Standard Bridge](./standard-bridge).
1212
You may find yourself in a position where you need to build a custom token bridge because the Standard Bridge doesn't completely support your use case.
@@ -35,7 +35,7 @@ The [Superchain Token List](/chain/tokenlist) exists to help users and developer
3535
Once you've built and tested your custom bridge, make sure to register any tokens meant to flow through this bridge by [making a pull request against the Superchain Token List repository](https://github.com/ethereum-optimism/ethereum-optimism.github.io#adding-a-token-to-the-list).
3636
You **must** deploy your bridge to OP Sepolia before it can be added to the Superchain Token List.
3737

38-
## Next Steps
38+
## Next steps
3939

4040
You can explore several examples of custom bridges for OP Mainnet:
4141

pages/builders/app-developers/bridging/messaging.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Sending Data Between L1 and L2
2+
title: Sending data between L1 and L2
33
lang: en-US
44
description: Learn how bridging works between L1 and L2, how to use it, and what to watch out for.
55
---
66

77
import { Callout } from 'nextra/components'
88

9-
# Sending Data Between L1 and L2
9+
# Sending data between L1 and L2
1010

1111
Smart contracts on L1 (Ethereum) can interact with smart contracts on L2 (OP Mainnet) through a process called "bridging".
1212
This page explains how bridging works, how to use it, and what to watch out for.
@@ -16,7 +16,7 @@ This page explains how bridging works, how to use it, and what to watch out for.
1616
For a step-by-step tutorial on how to send data between L1 and L2, check out the [Solidity tutorial](/builders/app-developers/tutorials/cross-dom-solidity).
1717
</Callout>
1818

19-
## Understanding Contract Calls
19+
## Understanding contract calls
2020

2121
It can be easier to understand bridging if you first have a basic understanding of how contracts on EVM-based blockchains like OP Mainnet and Ethereum communicate within the *same* network.
2222
The interface for sending messages *between* Ethereum and OP Mainnet is designed to mimic the standard contract communication interface as much as possible.
@@ -57,7 +57,7 @@ Here you're using the [low-level "call" function](https://docs.soliditylang.org/
5757
Although these two code snippets look a bit different, they're doing the exact same thing.
5858
Because of limitations of Solidity, **the OP Stack's bridging interface is designed to look like the second code snippet**.
5959

60-
## Basics of Communication Between Layers
60+
## Basics of communication between layers
6161

6262
At a high level, the process for sending data between L1 and L2 is pretty similar to the process for sending data between two contracts on Ethereum (with a few caveats).
6363
Communication between L1 and L2 is made possible by a pair of special smart contracts called the "messenger" contracts.
@@ -121,17 +121,17 @@ contract MyContract {
121121
You can find the addresses of the `L1CrossDomainMessenger` and the `L2CrossDomainMessenger` contracts on OP Mainnet and OP Sepolia on the [Contract Addresses](/chain/addresses) page.
122122
</Callout>
123123

124-
## Communication Speed
124+
## Communication speed
125125

126126
Unlike calls between contracts on the same blockchain, calls between Ethereum and OP Mainnet are *not* instantaneous.
127127
The speed of a cross-chain transaction depends on the direction in which the transaction is sent.
128128

129-
### For L1 to L2 Transactions
129+
### For L1 to L2 transactions
130130

131131
Transactions sent from L1 to L2 take **approximately 1-3 minutes** to get from Ethereum to OP Mainnet, or from Sepolia to OP Sepolia.
132132
This is because the Sequencer waits for a certain number of L1 blocks to be created before including L1 to L2 transactions to avoid potentially annoying [reorgs](https://www.alchemy.com/overviews/what-is-a-reorg).
133133

134-
### For L2 to L1 Transactions
134+
### For L2 to L1 transactions
135135

136136
Transactions sent from L2 to L1 take **approximately 7 days** to get from OP Mainnet to Ethereum, or from OP Sepolia to Sepolia.
137137
This is because the bridge contract on L1 must wait for the L2 state to be *proven* to the L1 chain before it can relay the message.
@@ -177,9 +177,9 @@ modifier onlyOwner() {
177177
}
178178
```
179179

180-
## Fees For Sending Data Between L1 and L2
180+
## Fees for sending data between L1 and L2
181181

182-
### For L1 to L2 Transactions
182+
### For L1 to L2 transactions
183183

184184
The majority of the cost of an L1 to L2 transaction comes from the smart contract execution on L1.
185185
When sending an L1 to L2 transaction, you send to the [`L1CrossDomainMessenger`](https://github.com/ethereum-optimism/optimism/blob/111f3f3a3a2881899662e53e0f1b2f845b188a38/packages/contracts-bedrock/src/L1/L1CrossDomainMessenger.sol) contract, which then sends a call to the [`OptimismPortal`](https://github.com/ethereum-optimism/optimism/blob/111f3f3a3a2881899662e53e0f1b2f845b188a38/packages/contracts-bedrock/src/L1/OptimismPortal.sol) contract.
@@ -195,7 +195,7 @@ The amount of L1 gas charged increases when more people are sending L1 to L2 tra
195195
You should always add a buffer of at least 20% to the gas limit for your L1 to L2 transaction to avoid running out of gas.
196196
</Callout>
197197

198-
### For L2 to L1 Transactions
198+
### For L2 to L1 transactions
199199

200200
Each message from L2 to L1 requires three transactions:
201201

@@ -211,11 +211,11 @@ Each message from L2 to L1 requires three transactions:
211211
The total cost of an L2 to L1 transaction is therefore the combined cost of the L2 initialization transaction and the two L1 transactions.
212212
The L1 proof and finalization transactions are typically significantly more expensive than the L2 initialization transaction.
213213

214-
## Understanding the Challenge Period
214+
## Understanding the challenge period
215215

216216
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**.
217217
This means that any messages you send from Layer 2 will only be received on Layer 1 after this one week period has elapsed.
218-
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/rollup/overview#fault-proofs).
218+
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/rollup/overview#fault-proofs).
219219

220220
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.
221221
In the "optimistic" case, this transaction result is correct and one can completely avoid the need to perform complicated (and expensive) logic on Ethereum.

pages/builders/app-developers/bridging/standard-bridge.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The Standard Bridge is composed of two contracts, the [`L1StandardBridge`](https
3636
These two contracts interact with one another via the `CrossDomainMessenger` system for sending messages between Ethereum and OP Mainnet.
3737
You can read more about the `CrossDomainMessenger` in the guide on [Sending Data Between L1 and L2](./messaging).
3838

39-
### Bridged Tokens
39+
### Bridged tokens
4040

4141
The Standard Bridge utilizes bridged representations of tokens that are native to another blockchain.
4242
Before a token native to one chain can be bridged to the other chain, a bridged representation of that token must be created on the receiving side.
@@ -50,7 +50,7 @@ A native token may have more than one bridged representation at the same time.
5050
Users must always specify which bridged token they wish to use when using the bridge.
5151
Different bridged representations of the same native token are considered entirely independent tokens.
5252

53-
### Bridging Native Tokens
53+
### Bridging native tokens
5454

5555
The Standard Bridge uses a "lock-and-mint" mechanism to convert native tokens into their bridged representations.
5656
This means that **native tokens are locked** into the Standard Bridge on one side, after which **bridged tokens are minted** on the other side.
@@ -129,7 +129,7 @@ The process for bridging a native token involves a few steps.
129129
This process is identical in both the Ethereum to OP Mainnet and OP Mainnet to Ethereum directions.
130130
</Steps>
131131

132-
### Bridging Non-Native Tokens
132+
### Bridging non-native tokens
133133

134134
The Standard Bridge uses a "burn-and-unlock" mechanism to convert bridged representations of tokens back into their native tokens.
135135
This means that **bridged tokens are burned** on the Standard Bridge on one side, after which **native tokens are unlocked** on the other side.
@@ -237,7 +237,7 @@ The address of this entry is the address of the bridged representation of the to
237237

238238
</Steps>
239239

240-
## Special Considerations
240+
## Special considerations
241241

242242
### USDC
243243

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compatibility": "Solidity Compatibility",
33
"system-contracts": "System Contracts",
4-
"optimization": "Cost Optimization"
4+
"optimization": "Cost Optimization",
5+
"superchain-erc20": "SuperchainERC20 Token Standard"
56
}

pages/builders/app-developers/contracts/compatibility.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
title: Solidity Compatibility
2+
title: Solidity compatibility
33
lang: en-US
44
description: Learn about the differences between OP Mainnet and Ethereum when building Solidity contracts.
55
---
66

7-
# Solidity Compatibility
7+
# Solidity compatibility
88

99
OP Mainnet is designed to be [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), which means OP Mainnet looks exactly like Ethereum in every way possible.
1010
Almost all Ethereum tooling works out of the box on OP Mainnet, including the [Solidity](https://soliditylang.org/) smart contract language.
1111
However, there are a few minor differences between OP Mainnet and Ethereum that you should be aware of when building Solidity contracts.
1212

13-
## EVM/Opcode Differences
13+
## EVM/Opcode differences
1414

1515
Most smart contracts will work on OP Mainnet without any changes.
1616
Check out the [Differences Between Ethereum and OP Mainnet](/chain/differences#opcodes) page for a detailed list of the few differences you should know about.
1717

18-
## Gas Differences
18+
## Gas differences
1919

2020
OP Mainnet uses the same gas costs as Ethereum.
2121
However, OP Mainnet also charges an [L1 Data Fee](/stack/transactions/fees#l1-data-fee) for the cost of publishing an L2 transaction to L1.

pages/builders/app-developers/contracts/optimization.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Contract Optimization on OP Mainnet
2+
title: Contract optimization on OP Mainnet
33
lang: en-US
44
description: Learn how to optimize contracts for OP Mainnet and what to look out for when you do so.
55
---
66

77
import { Callout } from 'nextra/components'
88

9-
# Contract Optimization on OP Mainnet
9+
# Contract optimization on OP Mainnet
1010

1111
OP Mainnet is designed to be [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), which means OP Mainnet looks exactly like Ethereum in every way possible.
1212
One large and mostly unavoidable discrepancy between OP Mainnet and Ethereum is a slight [difference in transaction fee models](/stack/transactions/fees).
@@ -36,12 +36,12 @@ This is the basic premise that makes OP Mainnet contract optimization slightly d
3636

3737
## Considerations
3838

39-
### Additional Complexity
39+
### Additional complexity
4040

4141
Contract optimizations can create additional complexity, which can in turn create additional risk.
4242
Developers should always consider whether this added complexity is worth the reduction in cost.
4343

44-
### Changing Economics
44+
### Changing economics
4545

4646
Various potential upgrades to OP Mainnet may also make optimizations to the L1 Data Fee less relevant.
4747
For instance, [EIP-4844](https://www.eip4844.com/), if adopted, should significantly reduce the cost of publishing data to Ethereum and would therefore also decrease the L1 Data Fee.
@@ -57,7 +57,7 @@ If you expect your contracts to be used mostly in the short term or you have the
5757

5858
## Techniques
5959

60-
### Calldata Compression
60+
### Calldata compression
6161

6262
Compressing user data on the client side and decompressing it on the contract side can be an effective way to decrease costs on OP Mainnet.
6363
This technique decreases the amount of data provided by the user in exchange for a significant increase in onchain computation.
@@ -66,7 +66,7 @@ Although several libraries exist to perform this calldata compression, none of t
6666
As a result, links to these libraries have been explicitly omitted here to avoid encouraging developers from using potentially buggy software.
6767
Most of these libraries can be found with a quick search online but, as always, be careful with code you find on the internet.
6868

69-
### Custom Encoding
69+
### Custom encoding
7070

7171
The [Solidity ABI encoding scheme](https://docs.soliditylang.org/en/v0.8.23/abi-spec.html#argument-encoding) is not particularly data efficient.
7272
Contracts can often reduce the amount of calldata provided by defining a custom argument encoding protocol.

0 commit comments

Comments
 (0)