|
1 | 1 | # Custom gateway bridging tutorial |
2 | 2 |
|
3 | | -When neither the StandardERC20gateway nor the generic-custom-gateway are enough to fulfill the bridging requirements of a token, there is the possibility of creating and registering a custom gateway. `custom-gateway-bridging` demonstrates how to create and register a custom gateway in Arbitrum's Token Bridge protocol. |
| 3 | +When neither the standard ERC20 gateway, nor the generic-custom gateway are enough to fulfill the bridging requirements of a token, there is the possibility of creating and registering a custom gateway. `custom-gateway-bridging` demonstrates how to create and register a custom gateway in the Arbitrum's Token Bridge. |
4 | 4 |
|
5 | | -For more info on bridging assets on Arbitrum, see our [token bridging docs](https://developer.arbitrum.io/asset-bridging). |
| 5 | +For more info on bridging assets on Arbitrum, see our [token bridging docs](https://docs.arbitrum.io/build-decentralized-apps/token-bridging/token-bridge-erc20). |
6 | 6 |
|
7 | 7 | ## Token bridging using a custom gateway |
8 | 8 |
|
9 | 9 | Bridging custom tokens through a custom gateway follow a similar process than that of Arbitrum's generic-custom gateway. The difference, however, is that during the gateway registration process, a custom gateway is registered instead of the generic-custom gateway. |
10 | 10 |
|
11 | | -Here, we deploy a [demo custom token](./contracts/L1Token.sol) on L1 and a [demo custom token](./contracts/L2Token.sol) on L2. We also deploy a demo custom gateway on both [L1](./contracts/L1CustomGateway.sol) and [L2](./contracts/L2CustomGateway.sol). We then use the Arbitrum router contract to register our L1 and L2 gateways. |
| 11 | +Here, we deploy a [demo custom token](./contracts/ParentChainToken.sol) to the parent chain and a [demo custom token](./contracts/ChildChainToken.sol) to the child chain. We also deploy a demo custom gateway on both [the parent chain](./contracts/ParentChainCustomGateway.sol) and [the child chain](./contracts/ChildChainCustomGateway.sol). We then use the Arbitrum router contract to register both gateways. |
12 | 12 |
|
13 | 13 | We use the [Arbitrum SDK](https://github.com/OffchainLabs/arbitrum-sdk) library to initiate and verify the bridging. |
14 | 14 |
|
15 | 15 | See [./exec.js](./scripts/exec.js) for inline explanation. |
16 | 16 |
|
17 | | -### Config Environment Variables |
| 17 | +### Set environment variables |
18 | 18 |
|
19 | 19 | Set the values shown in `.env-sample` as environmental variables. To copy it into a `.env` file: |
20 | 20 |
|
21 | 21 | ```bash |
22 | 22 | cp .env-sample .env |
23 | 23 | ``` |
24 | 24 |
|
25 | | -(you'll still need to edit some variables, i.e., `DEVNET_PRIVKEY`) |
| 25 | +You'll still need to edit some variables, i.e., `PRIVATE_KEY`, `CHAIN_RPC`, `PARENT_CHAIN_RPC`. |
| 26 | + |
| 27 | +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. |
26 | 28 |
|
27 | 29 | ### Run: |
28 | 30 |
|
|
0 commit comments