eth-deposit
shows how to move Ether from Ethereum (Layer 1) into the Arbitrum (Layer 2) chain.
A user deposits Ether onto Arbitrum using Arbitrum's general L1-to-L2 message passing system, and simply passing the desired Ether as callvalue and no additional data. For more info, see Retryable Tickets documentation.
Our Arbitrum SDK provides a simply convenience method for depositing Ether, abstracting away the need for the client to connect to any contracts manually.
See ./exec.js for inline explanation.
To run:
yarn run depositETH
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., DEVNET_PRIVKEY
)
Once the script is successfully executed, you can go to the Arbitrum block explorer, enter your address, and see the amount of ETH that has been assigned to your address on the Arbitrum chain!