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
This monorepo will help you get started with building on Arbitrum. It provides various simple demos showing and explaining how to interact with Arbitrum — deploying and using contracts directly on L2, moving Ether and tokens betweens L1 and L2, and more.
3
+
This monorepo will help you get started with building on Arbitrum chains. It provides various simple demos showing and explaining how to interact with Arbitrum chains (including Orbit chains) — deploying and using contracts directly on Arbitrum, moving Ether and tokens betweens the parent and child chains, and more.
4
4
5
5
We show how you can use broadly supported Ethereum ecosystem tooling (Hardhat, Ethers-js, etc.) as well as our special [Arbitrum SDK](https://github.com/OffchainLabs/arbitrum-sdk) for convenience.
- 🌀 [Deposit Ether or Tokens from L1 to L3](./packages/l1-l3-teleport/)
44
44
45
+
## How to run the tutorials against a custom network
46
+
47
+
As mentioned above, these tutorials use the [Arbitrum SDK](https://github.com/OffchainLabs/arbitrum-sdk), which loads the regular Arbitrum chains by default (Arbitrum One, Arbitrum Nova and Arbitrum Sepolia). You can use these tutorials against any other Arbitrum chain (including Orbit chains), by loading it to the Arbitrum SDK.
48
+
49
+
To do that, fill the information of your chain in the [`customNetwork.json`](./customNetwork.json) file., which is automatically loaded in all tutorials.
50
+
51
+
To obtain the information of a specific chain, you can use the method [`prepareArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/src/utils/registerNewNetwork.ts#L18) of the Orbit SDK.
Copy file name to clipboardExpand all lines: packages/address-table/README.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Address Table Demo
1
+
# Address table demo
2
2
3
-
The Address table is a precompiled contract on Arbitrum for registering addresses which are then retrievable by an integer index; this saves gas by minimizing precious calldata required to input an address as a parameter.
3
+
The Address table is a precompiled contract on Arbitrum chains for registering addresses which are then retrievable by an integer index; this saves gas by minimizing precious calldata required to input an address as a parameter.
4
4
5
5
This demo shows a simple contract with affordances to retrieve an address from a contract by its index in the address table, and a client-side script to pre-register the given address (if necessary).
6
6
@@ -12,15 +12,17 @@ See `exec.js` for inline comments / explanation.
12
12
yarn run exec
13
13
```
14
14
15
-
## Config Environment Variables
15
+
## Set environment variables
16
16
17
17
Set the values shown in `.env-sample` as environmental variables. To copy it into a `.env` file:
18
18
19
19
```bash
20
20
cp .env-sample .env
21
21
```
22
22
23
-
(you'll still need to edit some variables, i.e., `PRIVATE_KEY` and `CHAIN_RPC`)
23
+
You'll still need to edit some variables, i.e., `PRIVATE_KEY` and `CHAIN_RPC`.
24
+
25
+
Note that you can also set the environment variables in an `.env` file in the root of the monorepo, which will be available in all tutorials.
Copy file name to clipboardExpand all lines: packages/contract-deposit/README.md
+11-10
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,34 @@
1
-
# L2 alias control and fundtransfer guide
1
+
# Contract alias control in the child chain, and fund-transfer guide
2
2
3
-
`L2 Alias Control and Fund Transfer Guide` is a simple demonstration of how Arbitrum facilitates sending deposits from an L1 contract to L2.
3
+
`Contract alias control in the child chain, and fund-transfer guide` is a simple demonstration of how Arbitrum facilitates sending deposits from a contract in the parent chain, to the child chain.
4
4
5
-
It will deposit funds to l2 via a l1 contract, and because the inbox contract will alias the sender address if it is a contract,
6
-
this tutorial shows how to control the alias address on l2 via its l1 contract address.
5
+
It will deposit funds to the child chain via a contract deployed to the parent chain, and because the inbox contract will alias the sender address if it is a contract, this tutorial shows how to control the alias address on the child chain via the address of the contract on the parent chain.
7
6
8
-
This tutorial demonstrates depositing funds to L2 using an L1 contract. Since the Inbox contract changes the sender address if it's a contract [(a.k.a address aliasing)](https://docs.arbitrum.io/how-arbitrum-works/arbos/l1-l2-messaging#address-aliasing), it explains how to manage the new L2 address using the L1 contract address. It's a basic example of how an L1 contract controls its L2 alias and transfers its alias funds to another address. For practical use, we recommend our [funds recovery tool](<(https://github.com/OffchainLabs/arbitrum-funds-recovery-tool)>).
7
+
This tutorial demonstrates depositing funds to the child chain using a contract deployed to the parent chain. Since the Inbox contract changes the sender address if it's a contract [(a.k.a address aliasing)](https://docs.arbitrum.io/how-arbitrum-works/arbos/l1-l2-messaging#address-aliasing), it explains how to manage the aliased address on the child chain using the contract address on the parent chain. It's a basic example of how a contract controls its alias on the child chain, and transfers its funds from the aliased address to another address. For practical use, we recommend our [funds recovery tool](https://github.com/OffchainLabs/arbitrum-funds-recovery-tool).
9
8
10
-
The script and contracts demonstrate how to interact with Arbitrum's core bridge contracts to create these retryable messages, how to calculate and forward appropriate fees from L1 to L2, and how to use Arbitrum's L1-to-L2 message [address aliasing](https://developer.offchainlabs.com/docs/l1_l2_messages#address-aliasing).
9
+
The script and contracts demonstrate how to interact with Arbitrum's core bridge contracts to create these retryable messages, how to calculate and forward appropriate fees from the parent to the child chain, and how to use Arbitrum's cross-chain message [address aliasing](https://docs.arbitrum.io/how-arbitrum-works/arbos/l1-l2-messaging#address-aliasing).
11
10
12
11
See [./exec.js](./scripts/exec.js) for inline explanations.
13
12
14
-
[Click here](https://developer.offchainlabs.com/docs/l1_l2_messages) for more info on retryable tickets.
13
+
[Click here](https://docs.arbitrum.io/how-arbitrum-works/arbos/l1-l2-messaging) for more info on retryable tickets.
15
14
16
-
### Run demo:
15
+
### Run demo
17
16
18
17
```
19
18
yarn start
20
19
```
21
20
22
-
## Config environment variables
21
+
## Set environment variables
23
22
24
23
Set the values shown in `.env-sample` as environmental variables. To copy it into a `.env` file:
25
24
26
25
```shell
27
26
cp .env-sample .env
28
27
```
29
28
30
-
(you'll still need to edit some variables, i.e., `DEVNET_PRIVKEY`)
29
+
You'll still need to edit some variables, i.e., `PRIVATE_KEY`, `CHAIN_RPC`, `PARENT_CHAIN_RPC` and `TransferTo`.
30
+
31
+
Note that you can also set the environment variables in an `.env` file in the root of the monorepo, which will be available in all tutorials.
0 commit comments