Git Product home page Git Product logo

withdrawer's Introduction

withdrawer

Golang utility for proving and finalizing ETH withdrawals from op-stack chains.

GitHub contributors GitHub commit activity GitHub Stars GitHub repo size GitHub

Website base.org Blog Docs Discord Twitter BuildOnBase

GitHub pull requests by-label GitHub Issues

Installation

go install github.com/base-org/withdrawer@latest

Usage

Step 1

Initiate a withdrawal on L2 by sending ETH to the L2StandardBridge contract at 0x4200000000000000000000000000000000000010, and note the tx hash. Example on Base Goerli: 0xc4055dcb2e4647c37166caba8c7392625c2b62f9117a8bc4d96270da24b38f13.

Note: Do not send ERC-20 or other tokens to this address, only native ETH is supported.

Note: Users are required to wait for a period of seven days when moving assets out of Base mainnet into the Ethereum mainnet. This period of time is called the Challenge Period and serves to help secure the assets stored on Base mainnet.

Step 2

Prove your withdrawal:

withdrawer --network base-mainnet --withdrawal <withdrawal tx hash> --rpc <L1 RPC URL> --private-key <L1 private key>

or use a ledger:

withdrawer --network base-mainnet --withdrawal <withdrawal tx hash> --rpc <L1 RPC URL> --ledger

Example output:

Proved withdrawal for 0xc4055dcb2e4647c37166caba8c7392625c2b62f9117a8bc4d96270da24b38f13: 0x6b6d1cc45b6601a30646847f638847feb629221ee71bbe6a3de7e6d0fbfe8fad
waiting for tx confirmation
0x6b6d1cc45b6601a30646847f638847feb629221ee71bbe6a3de7e6d0fbfe8fad confirmed

Note: this can be called from any L1 address, it does not have to be the same address that initiated the withdrawal on the L2.

Step 3

After the finalization period, finalize your withdrawal (same command as above):

withdrawer --network base-mainnet --withdrawal <withdrawal tx hash> --rpc <L1 RPC URL> --private-key <L1 private key>

Example output:

Completed withdrawal for 0xc4055dcb2e4647c37166caba8c7392625c2b62f9117a8bc4d96270da24b38f13: 0x1c457f1992f48f1f959ceaee5b3c7e699a26f6f05d93997d49dafe703fd66dea
waiting for tx confirmation
0x1c457f1992f48f1f959ceaee5b3c7e699a26f6f05d93997d49dafe703fd66dea confirmed

Note: this can be called from any L1 address, it does not have to be the same address that initiated the withdrawal on the L2.

Flags

Usage of withdrawer:
    -rpc string
        Ethereum L1 RPC url
    -network string
        op-stack network to withdraw.go from (one of: base-mainnet, base-goerli, op-mainnet, op-goerli) (default "base-mainnet")
    -withdrawal string
        TX hash of the L2 withdrawal transaction
    -private-key string
        Private key to use for signing transactions
    -mnemonic string
        Mnemonic to use for signing transactions
    -ledger
        Use ledger device for signing transactions
    -hd-path string
        Hierarchical deterministic derivation path for mnemonic or ledger (default "m/44'/60'/0'/0/0")
    -l2-rpc string
        Custom network L2 RPC url
    -l2oo-address string
        Custom network L2OutputOracle address
    -portal-address string
        Custom network OptimismPortal address

withdrawer's People

Contributors

anikaraghu avatar mdehoog avatar taycaldwell avatar wbnns avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.