Withdrawing funds with StarkGate

Using StarkGate to withdraw funds from Starknet requires StarkGate’s initiate_token_withdraw function to initiate a withdrawal. The function does the following:

  • Burns the transferred amount of tokens from the L2 balance of the withdrawal’s initiator.

  • Sends a message to the relevant L1 bridge with the amount to be transferred and the recipient’s Ethereum address.

Subsequently, the funds should be transferred to the recipient’s Ethereum address.

For more information on what happens during the transfer process, see L2→L1 transfer (withdrawal).

Prerequisites
  • A Starknet block explorer. For a list of Starknet block explorers, see Block explorers, indexers & Enhanced API on the Starknet site.

  • An Ethereum block explorer, such as Etherscan.

  • Funds to transfer from L2 to L1, including enough to pay the fees required for the transfer.

  • The L2 address of the StarkGate bridge for the token you want to withdraw. To view the token addresses for tokens on Mainnet or Sepolia testnet, see Bridged tokens and addresses.

Procedure
  1. Using a Starknet block explorer, go to the StarkGate contract for the token you want to withdraw. For example, to withdraw USDC:

  2. Click the initiate_token_withdraw function and enter the following:

    • In l1_token, enter the L1 address of the ERC-20 contract for the token you want to withdraw, in this case, USDC.

    • In l1_recipient, enter the L1 address of the recipient.

    • In amount, enter the amount to transfer.

  3. Click Transact for Voyager, or Write for StarkScan. The function initiates a withdrawal.

  4. Using an Ethereum block explorer, go to the StarkGate contract and click Write as Proxy. For example, using Etherscan, go to 0xae0ee0a63a2ce6baeeffe56e7714fb4efe48d419

  5. Click the StarkGate 2.0 withdraw (0x69328dec) function.

  6. Enter the following:

    recipient (address)

    The recipient.

    token (address)

    The address of the contract for the desired token.

    amount (uint256)

    The amount of the withdrawal.

  7. Click Write.

The withdraw function withdraws the funds to the recipient’s L1 address. The funds should be available after the next L1 state update.