eth-withdraw
shows how to move Ether from Arbitrum (Layer 2) into the Ethereum (Layer 1) chain.
Note that this repo covers initiating and Ether withdrawal; for a demo on (later) releasing the funds from the Outbox, see outbox-execute
To withdraw Ether from Arbitrum, a client creates an outgoing / L2 to L1 message using the ArbSys
interface that later lets them release Ether from its escrow in the L1 Bridge.sol contract. For more info, see Outgoing messages documentation.
Note: Executing scripts will require your L2 account be funded with .000001 Eth.
Our Arbitrum SDK provides a simply convenience method for withdrawing Ether, abstracting away the need for the client to connect to any contracts manually.
See ./exec.js for inline explanation.
To run:
yarn run withdrawETH
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 has been deducted from your Layer 2 balance. Note that your Layer 1 balance will only be updated after rollup's confirmation period is over.