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
Copy file name to clipboardExpand all lines: docs/arbitrum-essentials/bridging/configure-token-gateway/custom.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -768,7 +768,7 @@ In this case, when using this function, a single action occurs:
768
768
769
769
1. Call the function `setGateway` of `L1GatewayRouter`. This call updates the `l1TokenToGateway` internal mapping and sends a retryable ticket to the counterpart `L2GatewayRouter` contract on the child chain to set its mapping to the new values.
770
770
771
-
To simplify the process, we’ll use Arbitrum’s SDK and call the method [`registerCustomToken`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) of the [`AdminErc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) class, which will call the `registerTokenOnL2` method of the token passed by parameter.
771
+
To simplify the process, we'll use Arbitrum's SDK and call the method [`registerCustomToken`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) of the [`AdminErc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) class, which will call the `registerTokenOnL2` method of the token passed by parameter.
Copy file name to clipboardExpand all lines: docs/arbitrum-essentials/bridging/configure-token-gateway/generic-custom.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -306,7 +306,7 @@ When using this function, you will take two actions:
306
306
1. Call the function `registerTokenToL2` of `L1CustomGateway`. This call will change the `l1ToL2Token` internal mapping it holds and send a retryable ticket to the counterpart `L2CustomGateway` contract on the child chain, setting its mapping to the new values as well.
307
307
2. Call the function `setGateway` of `L1GatewayRouter`. This call will update the `l1TokenToGateway` internal mapping it holds and send a retryable ticket to the counterpart `L2GatewayRouter` contract on the child chain to set its mapping to the new values.
308
308
309
-
To simplify the process, we’ll use Arbitrum’s SDK. We’ll call the [`registerCustomToken`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) method of the [`AdminErc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) class, which will call the `registerTokenOnL2` method on the token passed as a parameter.
309
+
To simplify the process, we'll use Arbitrum's SDK. We'll call the [`registerCustomToken`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) method of the [`AdminErc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) class, which will call the `registerTokenOnL2` method on the token passed as a parameter.
The <adata-quicklook-from="arbitrum">Arbitrum</a> protocol and related tooling make it easy for developers to build cross-chain applications; i.e., applications that involve sending messages from Ethereum to an <adata-quicklook-from="arbitrum-chain">Arbitrum chain</a>, and/or from an Arbitrum chain to Ethereum.
13
15
16
+
<ArbitrumSdkInfo />
17
+
14
18
## Ethereum-to-Arbitrum messaging
15
19
16
20
Creating an arbitrary parent-to-child chain contract call occurs via the Inbox's `createRetryableTicket` method. Upon publishing the <adata-quicklook-from="parent-chain">parent chain</a> <adata-quicklook-from="transaction">transaction</a>, the <adata-quicklook-from="child-chain">child chain</a> side will typically be included within minutes. Commonly, the child chain execution will automatically succeed, but if it reverts, it can be re-executed via a call to the `redeem` method of the [`ArbRetryableTx`](/arbitrum-essentials/precompiles/reference.mdx#arbretryabletx) <adata-quicklook-from="precompile">precompile</a>.
@@ -210,6 +214,6 @@ if (childTxReceipt.status === ParentToChildMessageStatus.REDEEMED) {
Copy file name to clipboardExpand all lines: docs/arbitrum-essentials/bridging/custom-gas-token-chains.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ You should use `EthBridger` when bridging the native token between the parent ch
36
36
- You should use `Erc20Bridger` when bridging an **ERC-20** token between the parent chain and the Arbitrum chain.
37
37
- These APIs are only needed for [`custom gas token`](/launch-arbitrum-chain/chain-config/costs/custom-gas-token-rollup.mdx) <adata-quicklook-from="arbitrum-chains">Arbitrum Chains</a>. For **ETH**-powered rollup and AnyTrust Arbitrum chains, you don't need to use them.
38
38
- When native tokens are transferred to the custom gas token Arbitrum chain, they function equivalently to **ETH** on EVM chains. This means these tokens will exhibit behavior identical to that of **ETH**, the native currency on EVM chains. This similarity in functionality is a key feature to consider in <adata-quicklook-from="transaction">transactions</a> and operations within the Arbitrum chain.
39
-
- Everything else is under the hood, and the custom gas token code paths will be executed just if the `L2Network` object config has a `nativeToken` field.
39
+
- Everything else is handled under the hood, and the custom gas token code paths will be executed only if the `ArbitrumNetwork` object config has a `nativeToken` field.
@@ -249,6 +249,48 @@ Retryable tickets can auto-redeem if sufficient gas is provided. If the initial
249
249
ArbRetryableTx(address(110)).redeem(ticketId);
250
250
```
251
251
252
+
## Deposit ETH using the Arbitrum SDK
253
+
254
+
The [Arbitrum SDK](https://github.com/OffchainLabs/arbitrum-sdk) provides an `EthBridger` class that simplifies depositing `ETH` from the parent chain to the child chain:
To deposit `ETH` to a recipient address that differs from the sender, use `depositTo`:
279
+
280
+
```ts
281
+
const depositTx =awaitethBridger.depositTo({
282
+
amount: ethers.utils.parseEther('0.1'),
283
+
parentSigner,
284
+
childProvider,
285
+
destinationAddress: '0x...recipient',
286
+
});
287
+
```
288
+
289
+
### Tutorials
290
+
291
+
-[eth-deposit tutorial](https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/eth-deposit) — full walkthrough of depositing `ETH` using the SDK
292
+
-[eth-deposit-to-different-address tutorial](https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/eth-deposit-to-different-address) — depositing `ETH` to a different recipient
293
+
252
294
## Next steps
253
295
254
296
- For protocol-level details, see [Parent to child chain messaging](/how-arbitrum-works/deep-dives/l1-to-l2-messaging.mdx)
After the 6.4-day challenge period, use the outbox execution flow described above (or the SDK's `ChildToParentMessage.execute`) to claim your `ETH` on the parent chain.
225
+
226
+
For a complete example, see the [eth-withdraw tutorial](https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/eth-withdraw).
227
+
200
228
## Message lifecycle
201
229
202
230
Child-to-parent messages go through these stages:
@@ -211,4 +239,4 @@ Child-to-parent messages go through these stages:
211
239
212
240
- For protocol-level details, see [Child to parent chain messaging](/how-arbitrum-works/deep-dives/l2-to-l1-messaging.mdx)
213
241
- For token bridging concepts, see [Token bridging overview](/how-arbitrum-works/deep-dives/token-bridging.mdx)
214
-
- For the Arbitrum SDK documentation, see [SDK reference](/sdk)
242
+
- For the Arbitrum SDK documentation, see [Arbitrum SDK](https://github.com/OffchainLabs/arbitrum-sdk)
0 commit comments