Skip to content

Migrate docs to Mintlify #1691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
90 changes: 45 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,48 +66,48 @@ jobs:
# NEXT_PUBLIC_ALGOLIA_INDEX_NAME
pnpm run index:docs

breadcrumbs:
description: Check breadcrumbs in documentation
executor: ubuntu
steps:
- checkout
- setup-node
- run:
name: Run breadcrumb check
command: pnpm check-breadcrumbs
# breadcrumbs:
# description: Check breadcrumbs in documentation
# executor: ubuntu
# steps:
# - checkout
# - setup-node
# - run:
# name: Run breadcrumb check
# command: pnpm check-breadcrumbs

lint:
description: Lint Markdown files and validate metadata
executor: ubuntu
steps:
- checkout
- setup-node
- run:
name: Get changed files
command: |
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | rev | cut -d'/' -f1 | rev)
CHANGED_FILES=$(curl -s "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUMBER/files" | jq -r '.[].filename' | grep '\.mdx$' || true)
echo "export CHANGED_FILES=\"$CHANGED_FILES\"" >> $BASH_ENV
fi
- run:
name: Lint Markdown files
command: pnpm lint
- run:
name: "Metadata Validation (Warning Only)"
command: |
echo "Running metadata validation (warnings will not block PR)..."
pnpm validate-pr-metadata || true
# lint:
# description: Lint Markdown files and validate metadata
# executor: ubuntu
# steps:
# - checkout
# - setup-node
# - run:
# name: Get changed files
# command: |
# if [ -n "$CIRCLE_PULL_REQUEST" ]; then
# PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | rev | cut -d'/' -f1 | rev)
# CHANGED_FILES=$(curl -s "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUMBER/files" | jq -r '.[].filename' | grep '\.mdx$' || true)
# echo "export CHANGED_FILES=\"$CHANGED_FILES\"" >> $BASH_ENV
# fi
# - run:
# name: Lint Markdown files
# command: pnpm lint
# - run:
# name: "Metadata Validation (Warning Only)"
# command: |
# echo "Running metadata validation (warnings will not block PR)..."
# pnpm validate-pr-metadata || true

links:
description: Check broken links in documentation
executor: ubuntu
steps:
- checkout
- setup-node
- run:
name: Run link checker
command: pnpm link-checker
# links:
# description: Check broken links in documentation
# executor: ubuntu
# steps:
# - checkout
# - setup-node
# - run:
# name: Run link checker
# command: pnpm link-checker

developer-metrics:
description: Monthly Metrics Report
Expand Down Expand Up @@ -152,11 +152,11 @@ workflows:
branches:
only: main

pr-workflow:
jobs:
- breadcrumbs
- links
- lint
# pr-workflow:
# jobs:
# - breadcrumbs
# - links
# - lint
monthly-workflow:
when:
equal: [build_monthly, <<pipeline.schedule.name>>]
Expand Down
5 changes: 0 additions & 5 deletions .husky/install.sh

This file was deleted.

31 changes: 0 additions & 31 deletions .husky/pre-push

This file was deleted.

33 changes: 0 additions & 33 deletions .remarkrc.mjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ title: Bridging basics
description: >-
Learn about the fundamentals of sending data and tokens between Ethereum and
OP Mainnet.
lang: en-US
content_type: guide
topic: bridging-basics
personas:
- app-developer
categories:
- cross-chain-messaging
- standard-bridge
- mainnet
is_imported_content: 'false'
---

# Bridging basics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@
---
title: Custom bridges
description: Important considerations when building custom bridges for OP Mainnet.
lang: en-US
content_type: guide
topic: custom-bridges
personas:
- app-developer
categories:
- cross-chain-messaging
- standard-bridge
- mainnet
- testnet
is_imported_content: 'false'
---

import { Callout } from 'nextra/components'

# Custom bridges

Custom token bridges are any bridges other than the [Standard Bridge](./standard-bridge).
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.
This guide provides important information you should be aware of when building a custom bridge.

<Callout>
<Info>
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/bridging/standard-bridge-custom-token) is often sufficient for projects that need more flexibility.
</Callout>
</Info>

## Guidelines

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,18 @@ title: Sending data between L1 and L2
description: >-
Learn how bridging works between L1 and L2, how to use it, and what to watch
out for.
lang: en-US
content_type: guide
topic: sending-data-between-l1-and-l2
personas:
- app-developer
categories:
- cross-chain-messaging
- standard-bridge
- mainnet
- testnet
is_imported_content: 'false'
---

import { Callout } from 'nextra/components'

# Sending data between L1 and L2

Smart contracts on L1 (Ethereum) can interact with smart contracts on L2 (OP Mainnet) through a process called "bridging".
This page explains how bridging works, how to use it, and what to watch out for.

<Callout type="info">
<Info>
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/bridging/cross-dom-solidity).
</Callout>
</Info>

## Understanding contract calls

Expand Down Expand Up @@ -129,9 +117,9 @@ contract MyContract {
}
```

<Callout type="info">
<Info>
You can find the addresses of the `L1CrossDomainMessenger` and the `L2CrossDomainMessenger` contracts on OP Mainnet and OP Sepolia on the [Contract Addresses](/superchain/addresses) page.
</Callout>
</Info>

## Communication speed

Expand Down Expand Up @@ -202,10 +190,10 @@ L1 to L2 execution also triggers contract execution on L2.
The `OptimismPortal` contract charges you for this L2 execution by burning a dynamic amount of L1 gas during your L1 to L2 transaction, depending on the gas limit you requested on L2.
The amount of L1 gas charged increases when more people are sending L1 to L2 transactions (and decreases when fewer people are sending L1 to L2 transactions).

<Callout>
<Info>
Since the gas amount charged is dynamic, the gas burn can change from block to block.
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.
</Callout>
</Info>

### For L2 to L1 transactions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@ title: Using the Standard Bridge
description: >-
Learn the basics of using the Standard Bridge to move tokens between Layer 1
and Layer 2.
lang: en-US
content_type: guide
topic: using-the-standard-bridge
personas:
- app-developer
categories:
- cross-chain-messaging
- standard-bridge
- mainnet
- testnet
is_imported_content: 'false'
---

import { Callout, Steps } from 'nextra/components'

# Using the Standard Bridge

Expand All @@ -29,9 +17,9 @@ The Standard Bridge is fully permissionless and supports standard ERC-20 tokens.
Other bridging systems also exist that provide different features and security properties.
You may wish to explore some of these options to find the bridge that works best for you and your application.

<Callout type="error">
<Info>
The Standard Bridge **does not** support [**fee on transfer tokens**](https://github.com/d-xo/weird-erc20#fee-on-transfer) or [**rebasing tokens**](https://github.com/d-xo/weird-erc20#balance-modifications-outside-of-transfers-rebasingairdrops) because these types of tokens may cause bridge accounting errors.
</Callout>
</Info>

## Design

Expand Down Expand Up @@ -87,14 +75,14 @@ The process for bridging a native token involves a few steps.
* `uint32 _minGasLimit`: Gas to use to complete the transfer on the receiving side.
* `bytes calldata _extraData`: Optional identify extra data.

<Callout>
<Info>
Users can also trigger the [`bridgeERC20`](https://github.com/ethereum-optimism/optimism/blob/2e647210882d961f04055e656590d90ad98c9934/packages/contracts-bedrock/src/universal/StandardBridge.sol#L168-L191) function instead of `bridgeERC20To` to avoid needing to specify the `address _to` parameter.
Doing so will automatically set the `address _to` parameter to the `msg.sender`.

**The `bridgeERC20` function can be potentially dangerous for users with [smart contract wallets](https://web.archive.org/web/20231012141406/https://blockworks.co/news/what-are-smart-contract-wallets) as some smart contract wallets cannot be deployed at the same address on every blockchain.**
To help users avoid potentially losing access to tokens by accident, the `bridgeERC20` function will always revert when triggered from a smart contract.
Smart contract wallet users and other smart contracts should therefore use the `bridgeERC20To` function instead.
</Callout>
</Info>

{<h3>The Standard Bridge locks the transferred tokens</h3>}

Expand Down Expand Up @@ -203,11 +191,11 @@ The Standard Bridge contracts can also be used to bridge ETH from Ethereum to OP
The ETH bridging process is generally less complex than the ERC-20 bridging process.
Users simply need to trigger and send ETH to the [`bridgeETH`](https://github.com/ethereum-optimism/optimism/blob/2e647210882d961f04055e656590d90ad98c9934/packages/contracts-bedrock/src/universal/StandardBridge.sol#L143-L150) or [`bridgeETHTo`](https://github.com/ethereum-optimism/optimism/blob/2e647210882d961f04055e656590d90ad98c9934/packages/contracts-bedrock/src/universal/StandardBridge.sol#L152-L166) functions on either blockchain.

<Callout>
<Info>
Users can also deposit ETH from Ethereum to OP Mainnet by sending a basic ETH transfer from an EOA to the `L1StandardBridgeProxy`.
This works because the `L1StandardBridgeProxy` contains a [`receive`](https://github.com/ethereum-optimism/optimism/blob/2e647210882d961f04055e656590d90ad98c9934/packages/contracts-bedrock/src/universal/StandardBridge.sol#L119-L121) function.
You can find the mainnet and testnet addresses on the [Contract Addresses](/superchain/addresses) page.
</Callout>
</Info>

## Tutorials

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
---
title: Building apps on the Superchain
description: Learn the basics of building apps on the Superchain.
lang: en-US
content_type: guide
topic: building-apps-on-the-superchain
personas:
- app-developer
categories:
- cross-chain-messaging
- standard-bridge
- mainnet
- testnet
is_imported_content: 'false'
---

import { Steps } from 'nextra/components'

# Building apps on the Superchain

Expand Down
10 changes: 10 additions & 0 deletions app-developers/get-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Build interoperable apps on Superchain devnet
description: >-
Learn about deploying contracts, cross-chain messaging, and tutorials to help
you build applications on the Superchain.
---


<InteropGettingStarted />

7 changes: 7 additions & 0 deletions app-developers/interop.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Getting started with Interop
description: Learn the basics of interoperability on the Superchain.
---


<InteropExplainer />
Loading