Skip to content
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

Update prod branch from develop #88

Merged
merged 16 commits into from
Sep 18, 2023
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
![Contribute to Scroll](./src/assets/banner.png)

[![Twitter Follow](https://img.shields.io/twitter/follow/Scroll_ZKP?style=social)](https://twitter.com/Scroll_ZKP)
[![Discord](https://img.shields.io/discord/984015101017346058?color=%235865F2&label=Discord&logo=discord&logoColor=%23fff)](https://discord.gg/scroll)

This is the open source project for the Scroll documentation.

## Developing
Expand All @@ -8,13 +13,9 @@ npm install && npm run dev

## Docs architecture

- All docs are markdown and stored in `/src/pages`.
- All articles are markdown and stored in `/src/content/docs/`.
- Navigation is JSON in `/src/config/sidebar.ts`

## Deployment

Managed by Scroll using Netlify at https://app.netlify.com/sites/scroll-documentation/overview.

## Credits

- Special thanks to the Chainlink team whose documentation we forked. Their repo is available [here](https://github.com/smartcontractkit/documentation) and viewable at [https://docs.chain.link/](https://docs.chain.link/).
1 change: 1 addition & 0 deletions astro-i18next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export default {
defaultLocale: "en",
showDefaultLocale: true,
locales: ["en", "zh"],
load: ["server", "client"],
}
Binary file added src/assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/Footer/PureFooter/PureFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Footer = () => {
<p className={styles.title}>Follow Us</p>
<div>
{mediaList.map((item) => (
<a external href={item.href} key={item.name}>
<a external href={item.href} key={item.name} target="_blank">
{<item.icon />}
</a>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ contract L1Token is ERC20 {

## Step 2: Launch the counterpart token on Scroll Sepolia testnet

Next, launch you'll launch a counterpart to this token on Scroll, which will represent the original token on Sepolia. This token can implement custom logic to match that of the L1 token or even add additional features beyond those of the L1 token.
Next, you'll launch a counterpart to this token on Scroll, which will represent the original token on Sepolia. This token can implement custom logic to match that of the L1 token or even add additional features beyond those of the L1 token.

For this to work:

- The token must implement the `IScrollStandardERC20`` interface in order to be compatible with the bridge.
- The token must implement the `IScrollStandardERC20` interface in order to be compatible with the bridge.
- The contract should provide the gateway address and the counterpart token addresses (the L1 token we just launched) under the `gateway()` and `counterpart()` functions. It should also allow the L2 gateway to call the token `mint()` and `burn()` functions, which are called when a token is deposited and withdrawn.

The following is a complete example of a token compatible with the bridge. To the constructor, you will pass the official Scroll Custom Gateway address (`0x31C994F2017E71b82fd4D8118F140c81215bbb37`) and the address of the token launched on Sepolia.
The following is a complete example of a token compatible with the bridge. To the constructor, you will pass the official Scroll Custom Gateway address (`0x058dec71E53079F9ED053F3a0bBca877F6f3eAcf`) and the address of the token launched on Sepolia.

```solidity
// SPDX-License-Identifier: MIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: "Contract Deployment Tutorial"
lang: "en"
permalink: "developers/guides/contract-deployment-tutorial"
excerpt: "The Scroll Sepolia Testnet allows the community to deploy smart contracts on Scroll. In this tutorial, we will teach you how to deploy a contract on Scroll Sepolia."
whatsnext: { "Contract Deployment Tutorial": "/developers/developer-quickstart/" }
whatsnext: { "Scroll Messenger Cross-chain Interaction": "/developers/guides/scroll-messenger-cross-chain-interaction/" }
---

import Aside from "../../../../../components/Aside.astro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ date: Last Modified
title: "Scroll Messenger Cross-chain Interaction"
lang: "en"
permalink: "developers/guides/scroll-messenger-cross-chain-interaction"
whatsnext: { "Bridge ERC20 through the Custom Gateway": "/developers/guides/bridge-erc20-through-the-custom-gateway" }
excerpt: "In this example, we will launch a dummy smart contract on either Sepolia or Scroll Sepolia testnet and interact with it from the opposite chain."
---

Expand Down
1 change: 1 addition & 0 deletions src/content/docs/en/developers/scroll-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ date: Last Modified
title: "Scroll Sepolia Contracts"
lang: "en"
permalink: "developers/scroll-contracts"
whatsnext: { "Ethereum & Scroll Differences": "/developers/ethereum-and-scroll-differences" }
excerpt: "The network info and contract addresses you need to start with Scroll Sepolia Testnet."
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function sendMessage(

Next, the cross-domain message hash is appended to `L2MessageQueue` by calling its `appendMessage` function. The `L2MessageQueue` contract maintains the [Withdraw Trie](#withdraw-trie), an append-only Merkle tree. Every time a new message is appended to the queue, the contract inserts it into the Withdraw Trie and updates the trie's root hash.

After the transaction batch containing users' L2-to-L1 messages is finalized on the L1 rollup contract, users need to submit corresponding _Execute Withdrawal_ transactions to call `relayMessageWithProof` method in the `L1ScrollMessenger` contract that executes the withdrawal on L1. Thanks to the Merle proofs, the finalization of withdrawal transactions on L1 is trustless and can be submitted by user themselves or by a third party on behalf of users.
After the transaction batch containing users' L2-to-L1 messages is finalized on the L1 rollup contract, users need to submit corresponding _Execute Withdrawal_ transactions to call `relayMessageWithProof` method in the `L1ScrollMessenger` contract that executes the withdrawal on L1. Thanks to the Merkle proofs, the finalization of withdrawal transactions on L1 is trustless and can be submitted by user themselves or by a third party on behalf of users.

To make it easier to construct a withdraw MIP, Scroll maintains a service called Bridge History API. Bridge History API monitors `SentMessage` events emitted from `L2ScrollMessenger` and maintains a Withdraw Trie internally. It continuously generates Merkle proofs for every withdrawal messages. Users and third-party services can query Merkle proofs from the Bridge History API to include in the _Execute Withdrawal_ transactions.

Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/en/technology/chain/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ First, users can directly submit transactions to L2 sequencers. To do so, users

Second, deposit and enforced transactions are originated on L1. Scroll L1 bridge contract provides three entry points for users and smart contracts to send transactions from the L1. All messages sent through these three entry points will be appended to the `L1MessageQueue` contract.

- The `ScrollGatewayRouter` contract and several standard token gateways allow users and contracts to deposit standard tokens to L2. See more details in the [Deposit Token Gateways](/-oscADc8SoKAOxjtpcEqKg).
- The `L1ScrollMessenger` contract allows users and contracts to send arbitrary messages to L2. See more details in the [Sending Arbitrary Messages](/UPyw7afFQE6q-9CIdIRBag#Sending-Arbitrary-Messages).
- The `EnforcedTxGateway` contract allows EOAs to initiate an enforced transaction from the same address to withdraw tokens or call other contracts on L2. See more details in the [Sending Enforced Transaction](/UPyw7afFQE6q-9CIdIRBag#Sending-Enforced-Transactions).
- The `ScrollGatewayRouter` contract and several standard token gateways allow users and contracts to deposit standard tokens to L2. See more details in the [Deposit Token Gateways](/technology/bridge/deposit-gateways).
- The `L1ScrollMessenger` contract allows users and contracts to send arbitrary messages to L2. See more details in the [Sending Arbitrary Messages](/technology/bridge/cross-domain-messaging#sending-arbitrary-messages).
- The `EnforcedTxGateway` contract allows EOAs to initiate an enforced transaction from the same address to withdraw tokens or call other contracts on L2. See more details in the [Sending Enforced Transaction](/technology/bridge/cross-domain-messaging#sending-enforced-transactions).

The Scroll sequencer periodically starts a new mining job. It pulls the L1 messages from the `L1MessageQueue` contract and transactions in the L2 mempool and seals a block. Once a transaction is included in a L2 block, its status becomes `Confirmed`.

### Commit Transaction Data

The rollup node collects new L2 blocks and packs them into chunks and batches (see more details in [Transaction Batching](/RxRWLFtiQ7W_wbc0jMnQNA)). Periodically it sends a _Commit Transaction_ that posts the data of a batch of transactions to the L1 `ScrollChain` contract. After the Commit Transaction is finalized in a L1 block, the status of the transactions in this batch becomes `Committed`. At this time, users can reconstruct L2 state themselves completely based on the committed data from the L1 contract.
The rollup node collects new L2 blocks and packs them into chunks and batches (see more details in [Transaction Batching](/technology/chain/transactions#transaction-batching)). Periodically it sends a _Commit Transaction_ that posts the data of a batch of transactions to the L1 `ScrollChain` contract. After the Commit Transaction is finalized in a L1 block, the status of the transactions in this batch becomes `Committed`. At this time, users can reconstruct L2 state themselves completely based on the committed data from the L1 contract.

### Finalize Transactions

Expand Down
1 change: 0 additions & 1 deletion src/content/docs/en/technology/zkevm/zkevm-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ title: "zkEVM Overview"
lang: "en"
permalink: "technology/zkevm-overview"
excerpt: "In order to understand how to build a zkEVM, which proves the execution of the EVM, we need to first look at the EVM itself."
whatsnext: { "Bridge Overview": "/technology/bridge/bridge-overview" }
---

import ClickToZoom from "../../../../../components/ClickToZoom.astro"
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/user-guide/bridge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ excerpt: "To start bridging assets from Sepolia, navigate to the portal bridge a
{/* TODO: Update all instructions after being able to walk through the whole flow. */}

Visit our [Bridge](https://scroll.io/bridge) app to get started![^thanks-hop] The Bridge supports both **Deposit** and **Withdraw** operations, allowing users to trustlessly move assets from Sepolia Testnet to Scroll Sepolia Testnet.
[^thanks-hop]: Forked from [Hop Exchange]('https://hop.exchange/')'s UI 🙌
[^thanks-hop]: Forked from [Hop Exchange](https://hop.exchange/)'s UI 🙌

Deposits can take up to 15 minutes to be available on Scroll.

Expand Down