token-deposit
demonstrates moving a token from a parent chain to a child chain (e.g. from Ethereum to Arbitrum) using the standard token gateway in Arbitrum's token bridging system.
For info on how it works under the hood, see our token bridging docs.
Depositing an ERC-20 token into an Arbitrum chain is done via our Arbitrum token bridge.
In this tutorial, we deploy a demo token and trigger a deposit; by default, the deposit will be routed through the standard ERC-20 gateway, where on initial deposit, a standard arb ERC-20 contract will automatically be deployed to the destination chain.
We use our Arbitrum SDK library to initiate and verify the deposit.
See ./exec.js for inline explanation.
Set the values shown in .env-sample
as environmental variables. To copy it into a .env
file:
cp .env-sample .env
You'll still need to edit some variables, i.e., PRIVATE_KEY
, CHAIN_RPC
and PARENT_CHAIN_RPC
.
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.
yarn run token-deposit