Withdraw ETH from Gas Tank

Withdraw ETH from Loopring Wallet’s Gas Tank

1. Check ETH Balance in the Gas Tank

The Loopring Wallet app displays your Gas Tank balance, but only up to 7 decimal places. To view the full ETH balance, use the on-chain contract reader:

🔗 View full balance on TaikoScan

  • Scroll to the balanceOf function.

  • Enter your wallet address.

  • Click Query to see the full ETH balance displayed in wei.


2. Reserve a Small Amount for Fees

ETH in your Gas Tank is used to pay gas fees on the Taiko network. Withdrawing the full balance may cause the transaction to fail if there's not enough ETH left to cover the fee.

Gas fees on Taiko are minimal, but we recommend reserving a small amount of ETH in the Gas Tank to avoid issues.

How to Estimate and Subtract for Gas

If you want to calculate your withdrawAmount precisely, follow these steps:

  1. Estimate the gas cost

    • Try submitting a full withdrawal.

    • If it fails, note the estimated gas cost (e.g., 0.0000023 ETH).

  2. Add a buffer Multiply the estimated cost by 1.5 to ensure your transaction succeeds:

0.0000023 ETH × 1.5 = 0.00000345 ETH

  1. Convert to wei Convert the buffered amount from ETH to wei:

0.00000345 ETH × 1e18 = 3,450,000,000,000 wei

  1. Subtract from your balance Subtract the buffered gas fee (in wei) from your total ETH balance (also in wei).

Example:

Full Balance

376667029381073 wei

Gas Fee Buffer

-3450000000000 wei

Withdraw Amount

373217029381073 wei

  1. Use this value Use the result as your withdrawAmount when calling the smart contract’s withdraw function.


3. Withdraw ETH Using the Smart Contract

🔗 Open writeContract on TaikoScan

Steps:

  1. Connect Wallet: Use WalletConnect to link the Loopring Wallet you want to withdraw from.

  1. Click on Write Contract

  2. Use the withdrawTo method:

  • withdrawAddress: Enter the wallet address where you want to send the ETH.

  • withdrawAmount: Enter the amount to withdraw (your total balance minus the reserved fee).

  1. Click Write to submit the transaction.


4. Approve the Transaction in the Wallet App

The Loopring Wallet app will show a confirmation popup:

  • Tap Approve.

  • Enter your wallet password if prompted.


5. Confirm the Transaction

After approving:

  • Go to the Transactions section in your wallet app.

  • Confirm that the ETH has been successfully withdrawn from the Gas Tank.

Last updated

Was this helpful?