You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,6 +23,10 @@ Scroll has an arbitrary message passing bridge that enables token transfers and
22
23
23
24
There are two primary approaches to sending a message from L1 to L2: sending arbitrary messages via `L1ScrollMessenger` and sending enforced transactions via `EnforcedTxGateway`. Both approaches allow users to initiate a L2 transaction on L1 and call arbitrary contracts on L2. For arbitrary messages, the sender of the L2 transactions is the aliased `L1ScrollMessenger` address. For enforced transactions, the L2 sender is an externally-owned account (EOA). In addition, we provide several standard token gateways to make it easier for users to deposit ETH and other standard tokens including ERC-20, ERC-677, ERC-721, and ERC-1155. In essence, these gateways encode token deposits into a message and send it to their counterparts on L2 through the `L1ScrollMessenger` contract. You can find more details about the L1 token gateways in the [Deposit Gateways](/technology/bridge/deposit-gateways).
24
25
26
+
<Asidetype="danger"title="">
27
+
Enforced Transactions are not yet enabled on Scroll. In future upgrades, users will be able to use this functionality to bypass the `L1ScrollMessenger` and send messages directly to the `L1MessageQueue`.
28
+
</Aside>
29
+
25
30
As depicted in Figure 1, both arbitrary messages and enforced transactions are appended to the message queue stored in the `L1MessageQueue` contract. The `L1MessageQueue` contract provides two functions `appendCrossDomainMessage` and `appendEnforcedTransaction` for appending arbitrary messages and enforced transactions respectively.
26
31
27
32
```solidity
@@ -112,6 +117,10 @@ The deposited ETH of `value` amount is locked in the `L1ScrollMessenger` contrac
112
117
113
118
### Sending Enforced Transactions
114
119
120
+
<Aside type="danger" title="">
121
+
Enforced Transactions are not yet enabled on Scroll. In future upgrades, users will be able to use this functionality to bypass the `L1ScrollMessenger` and send messages directly to the `L1MessageQueue`.
122
+
</Aside>
123
+
115
124
The `EnforcedTxGateway` contract provides two `sendTransaction` functions to send an enforced transaction. In the first function, the sender of the generated `L1MessageTx` transaction is the transaction sender. On the other hand, the second function uses the passed `sender` address as the sender of the `L1MessageTx` transaction. This allows a third party to send an enforced transaction on behalf of the user and pay the relay fee. Note that the second function requires providing a valid signature of the generated `L1MessageTx` transaction that matches the `sender` address. Both `sendTransaction` functions enforce the sender to be an EOA account.
116
125
117
126
<ToggleElement anchor="sendTransaction function signatures">
@@ -185,6 +194,13 @@ Because the `L2ScrollMessenger` contract records all L1 messages that were succe
185
194
186
195
The contract `L2GasPriceOracle` deployed on L1 computes the relay fee of a message given its gas limit. This contract stores the `l2BaseFee` in its storage, which is updated by a dedicated relayer run by Scroll currently. The relay fee of L1-to-L2 messages is `gasLimit * l2BaseFee`.
187
196
197
+
<Asidetype="tip"title="Upgrade Notice">
198
+
During the February 2024 Bridge Upgrade, `L2GasPriceOracle` will be deprecated, with its functionality moved into the `L1MessageQueueWithGasPriceOracle` contract.
199
+
200
+
The upgrade is expected to be finalized on February 19th, 2024 after a two-week timelock. Scroll Sepolia has already undergone this upgrade. Read more [here](https://scroll.io/blog/to-do-slug).
201
+
202
+
</Aside>
203
+
188
204
### Address Alias
189
205
190
206
Due to the behavior of the `CREATE` opcode, it is possible that someone deploys a contract at the same address on L1 and L2 but with different bytecode. To avoid malicious users taking advantage of this, the bridge applies an address alias when the message sender is a contract on L1. The aliased sender address of the L1 message transaction is `l1_contract_address + offset` where the `offset` is `0x1111000000000000000000000000000000001111`.
This document describes how users and developers can utilize gateways to deposit tokens from L1 to L2. We provide several gateways for standard tokens and a gateway router on L1, listed in the table below.
@@ -22,6 +23,13 @@ This document describes how users and developers can utilize gateways to deposit
22
23
|`L1ERC721Gateway`| The gateway for ERC-721 token deposits. |
23
24
|`L1ERC1155Gateway`| The gateway for ERC-1155 token deposits. |
24
25
26
+
<Asidetype="tip"title="Upgrade Notice">
27
+
With the February 2024 Bridge Upgrade, `L1GatewayRouter` will now bypass `L1ETHGateway` when bridging ETH to improve gas efficiency.
28
+
29
+
The upgrade is expected to be finalized on February 19th, 2024 after a two-week timelock. Scroll Sepolia has already undergone this upgrade. Read more [here](https://scroll.io/blog/to-do-slug).
@@ -58,6 +66,11 @@ Scroll treats ETH as its native token. We pre-allocate a sufficient amount of ET
58
66
59
67
6. If the user calls `depositETHAndCall` on L1, `finalizeDepositETH` in the `L2ETHGateway` contract will forward the additional data to the target L2 contract.
60
68
69
+
<Asidetype="tip"title="Upgrade Notice">
70
+
With the February 2024 Bridge Upgrade, step 3 will change. `L1GatewayRouter` will now bypass `L1ETHGateway` when depositing ETH to improve gas efficiency.
71
+
</Aside>
72
+
73
+
61
74
## Depositing ERC20 Tokens
62
75
63
76
Several ERC20 gateway contracts are provided to bridge different kinds of ERC20 tokens, such as standard ERC20 tokens, custom ERC20 tokens, and Wrapped ETH token. `L1GatewayRouter` records the canonical mapping of ERC20 tokens to the corresponding ERC20 gateway on the L1. The `L1GatewayRouter` uses `StandardERC20Gateway` as the default ERC20 gateway for new ERC20 tokens unless a custom gateway is already set up.
This document describes how users and developers can utilize gateways to withdraw tokens from L2 to L1. We provide several gateways for standard tokens and a gateway router on L2, listed in the table below.
@@ -22,6 +23,13 @@ This document describes how users and developers can utilize gateways to withdra
22
23
|`L2ERC721Gateway`| The gateway for ERC-721 token withdrawals. |
23
24
|`L2ERC1155Gateway`| The gateway for ERC-1155 token withdrawals. |
24
25
26
+
<Asidetype="tip"title="Upgrade Notice">
27
+
With the February 2024 Bridge Upgrade, `L2GatewayRouter` will now bypass `L2ETHGateway` when bridging ETH to improve gas efficiency.
28
+
29
+
The upgrade is expected to be finalized on February 19th, 2024 after a two-week timelock. Scroll Sepolia has already undergone this upgrade. Read more [here](https://scroll.io/blog/to-do-slug).
@@ -54,6 +62,10 @@ The withdrawal of ETH token works as follows.
54
62
4. The withdrawal execution transaction on L1 calls the `L1ScrollMessenger.relayMessageWithProof` function to finalize the withdrawal. In the case of ETH withdrawal, the `relayMessageWithProof` function calls `L1ETHGateway.finalizeWithdrawETH` to send back ETH to the recipient account on L1.
55
63
5. If the user calls `withdrawETHAndCall` on L2, the `finalizeWithdrawETH` in the `L1ETHGateway` contract will forward the additional data to the target L1 contract.
56
64
65
+
<Asidetype="tip"title="Upgrade Notice">
66
+
With the February 2024 Bridge Upgrade, step 2 will change. `L2GatewayRouter` will now bypass `L2ETHGateway` when depositing ETH to improve gas efficiency.
0 commit comments