Gas Tank

The Gas Tank is MakaPay's unified gas management system that allows merchants to fund payment settlements across all supported blockchains from a single USDT balance on MakaChain.


How It Works

The Problem

Traditional multi-chain payment acceptance requires:

  • ETH on Ethereum for gas

  • MATIC on Polygon for gas

  • BNB on BSC for gas

  • Managing multiple wallets and balances

This leads to:

  • Idle capital sitting unused on each chain

  • Complexity managing multiple native tokens

  • Risk of settlements failing due to insufficient gas

The Solution

MakaPay's Gas Tank:

  • Single deposit of USDT on MakaChain

  • Automatic deduction when payments are settled

  • Works across Ethereum, Polygon, BSC, and MakaChain


Understanding Fee Modes

MakaPay offers three distinct ways to handle fees. Understanding these is essential for choosing the right setup for your business.

Mode 1: Gas Tank Mode (Default)

Settings: gasless: false, payerCoversFee: false

This is the premium merchant experience. You deposit USDT into your Gas Tank, and all fees are deducted from there.

Best for:

  • E-commerce with fixed prices

  • Premium customer experience

  • High-volume merchants who want predictable receipts


Mode 2: Gasless Mode

Settings: gasless: true, payerCoversFee: false

Despite the name, "gasless" actually means "Gas Tank-less"—fees are deducted directly from the payment amount on-chain, so you don't need a Gas Tank balance.

Best for:

  • Merchants who don't want to manage deposits

  • Testing the platform

  • Low-margin situations where you pass costs through

Important: Stablecoin Requirement

Gasless mode only works with stablecoins (USDT, USDC, DAI, BUSD, TUSD, USDP). This is because the gas fee calculation assumes the token is worth $1 USD.

Supported stablecoins:

  • USDT (Tether)

  • USDC (USD Coin)

  • DAI (Dai Stablecoin)

  • BUSD (Binance USD)

  • TUSD (TrueUSD)

  • USDP (Pax Dollar)

What happens with non-stablecoins?

If you attempt to create a gasless payment with a non-stablecoin token (e.g., WETH, WBTC), MakaPay automatically corrects this to use Gas Tank mode (gasless: false) instead. This prevents incorrect fee calculations.

Why this matters:

Gasless mode calculates fees assuming 1 token = $1 USD. For non-stablecoins, this would be wildly incorrect:

To use non-stablecoin tokens:

  1. Deposit USDT to your Gas Tank

  2. Create payments with gasless: false (default)

  3. Gas Tank will cover the fees in USD equivalent


Mode 3: Payer Covers Fee

Settings: payerCoversFee: true (automatically enables gasless)

The fee is added on top of your requested amount. The customer pays more, but you receive exactly what you asked for.

Best for:

  • Invoicing and B2B payments

  • Transparent fee handling

  • When customers expect to pay transaction fees


Fee Mode Comparison

Mode
Customer Sends
You Receive
Gas Tank Used
Who Pays Fees

Gas Tank (default)

$100

$100

Yes (~$1.13)

You (from deposit)

Gasless

$100

~$98.87

No

You (from payment)

Payer Covers Fee

~$101.13

$100

No

Customer


When Gas Tank Is Used

The Gas Tank is used when both conditions are true:

  1. gasless: false (default)

  2. payerCoversFee: false (default)

Fee Deduction Breakdown

When a payment is settled, the following are deducted from your Gas Tank:

Fee Component
Description

Platform Fee

Percentage based on your plan tier (0% - 1%)

Processing Fee

Fixed $0.10 per transaction

Gas Fee

Blockchain gas cost in USD equivalent

Example: $100 Payment on Polygon (Free Plan)

When Gas Tank Is NOT Used

Gas Tank is bypassed when:

  • gasless: true - Fees taken from payment amount on-chain

  • payerCoversFee: true - Fees added on top, taken on-chain


Handling Payment Errors

One of the most powerful features of the Gas Tank is enabling merchants to recover funds from problematic payments. This includes underpayments, overpayments, wrong tokens, and wrong networks.

How Payment Addresses Work

MakaPay uses undeployed smart contracts (CREATE2) to receive payments. Each payment address is computed based on:

  • Merchant address

  • Expected payment amount

  • Fee amount (fixed at payment creation time)

  • Token and chain parameters

Since the fee amount is fixed at address computation time, certain payment errors cannot be processed through the normal settlement flow.


Underpayments

Scenario: You request $100 USDT, but the payer only sends $1.

Recovery with Gas Tank:

The merchant can withdraw these stuck funds by having a Gas Tank balance. The Gas Tank covers the gas cost for the withdrawal transaction.

Key points:

  • No platform fee or processing fee charged (payment didn't complete)

  • Only the actual gas cost for the withdrawal is deducted

  • Works across all supported chains


Wrong Network

Scenario: You request $100 USDT on Ethereum, but the payer sends it on Polygon.

Because payment addresses are computed deterministically, the same address exists on all EVM chains. If a payer sends to the right address but on the wrong network, the funds land in an undeployed contract on that chain.

Recovery with Gas Tank:

The merchant can recover funds from the wrong network using their Gas Tank balance:

  1. Navigate to the payment in your dashboard

  2. Request recovery from the incorrect chain (Polygon)

  3. Gas Tank covers the withdrawal gas on Polygon

  4. Funds sent to your wallet


Wrong Token

Scenario: You request $100 USDT, but the payer sends USDC instead.

The payment address can receive any ERC20 token, not just the expected one. If a payer sends the wrong token, it will be held at the payment address.

Recovery with Gas Tank:

The merchant can recover the wrong token using their Gas Tank:

  1. Navigate to the payment in your dashboard

  2. Request recovery of the incorrect token (USDC)

  3. Gas Tank covers the withdrawal gas

  4. Wrong token sent to your wallet


Overpayments

Scenario: You request $100 USDT, but the payer sends $150.

Unlike the error cases above, overpayments are processed normally. The important detail is that fees are only calculated based on the original expected amount, not the overpaid amount.

This protects merchants from unexpected fee increases when customers overpay.


Summary: Why Gas Tank Matters for Recovery

Scenario
Without Gas Tank
With Gas Tank

Underpayment

Funds stuck forever

Recover instantly

Wrong Network

Funds stuck on wrong chain

Recover from any chain

Wrong Token

Wrong token stuck

Recover any token

Overpayment

Works normally

Works normally

The Gas Tank is your safety net for handling real-world payment errors that inevitably occur.


Depositing to Gas Tank

Step 1: Get Your Deposit Address

  1. Navigate to Dashboard > Gas Tank

  2. Click Deposit or Get Deposit Address

  3. A unique deposit address is generated for you

Step 2: Send USDT

Send USDT to your deposit address on MakaChain:

  • Network: MakaChain (Chain ID: 777178)

  • Token: USDT (0x30C28E393E0732335235685B345c95E6465Ad8A5)

  • RPC: https://rpc.makachain.io

Step 3: Automatic Credit

Once confirmed:

  • Your Gas Tank balance updates automatically

  • No manual claiming required

  • Funds available immediately for settlements

How Deposits Work (Technical)

  1. A deterministic address is computed using CREATE2

  2. You send USDT to this pre-computed address

  3. MakaPay deploys a PaymentWallet at that exact address

  4. The wallet forwards USDT to the GasTank contract

  5. GasTank credits your user balance


Gas Tank Contract

The GasTank is a smart contract deployed on MakaChain that manages merchant balances.

Contract Address

Network
Address

MakaChain Mainnet

0xE94EB77a80BddD3a1c1813ed17894af0a3837d2C

MakaChain Testnet

0xE94EB77a80BddD3a1c1813ed17894af0a3837d2C

Key Functions

getBalance(userId)

Returns the current USDT balance for a user.

deductGas(userId, amount)

Deducts USDT from a user's balance (called during settlement).

batchDeductGas(userIds, amounts)

Efficiently deducts from multiple users in a single transaction.

Events


Balance Management

Checking Your Balance

Dashboard: Gas Tank page shows current balance

API:

Response:

Monthly Payments
Recommended Balance

1-50

$10 - $20

50-200

$20 - $50

200-500

$50 - $100

500+

$100+

Low Balance Handling

When your Gas Tank runs low:

  1. Warning: Dashboard shows low balance alert at $5

  2. Awaiting Gas: Payments show "Awaiting Gas" status

  3. Auto-Resume: Settlement resumes after you deposit

  4. No Lost Payments: Payments are never lost, just delayed


Withdrawing from Gas Tank

Withdrawing Unused Balance

You can withdraw your Gas Tank balance directly from the dashboard at any time.

Steps:

  1. Navigate to Dashboard > Gas Tank

  2. Click the Withdraw button next to your balance

  3. Enter the amount you want to withdraw

  4. Enter the recipient wallet address (any EVM address on MakaChain)

  5. Confirm the withdrawal

The withdrawal is processed immediately and sent to your specified address on MakaChain.

Note: In most cases, you don't need to withdraw—the balance is automatically used for settlements and recovery operations. Withdrawing is useful if you want to move funds elsewhere or close your account.


Security

Deposit Address Security

  • Each user has unique deposit addresses

  • Addresses are deterministic (CREATE2)

  • Nonce validation prevents replay attacks

Balance Security

  • Balances stored in audited smart contract

  • Only MakaPay operator can deduct for settlements

  • Emergency withdrawal function for edge cases

Best Practices

  • Only deposit what you need for 1-2 weeks

  • Monitor balance regularly

  • Set up low balance alerts

Last updated