Skip to content
Smart contracts Audit finding Intermediate

Bonding Shares Incorrectly Reduced/unstaked on Transfer in launchToken.

The LaunchToken contract reduces a user's bonding shares by the full transfer amount whenever they send tokens, even if the tokens being sent were received from someone else rather than originally purchased. This means a user who still holds their original tokens can lose all bonding shares and fee-sharing rights after transferring tokens they received.

Web3Vikings Follow with AvantGard, VAD37 and 1 other

Originally disclosed on Code4rena

Submitted by Web3Vikings, also found by AvantGard, VAD37, and VinciGearHead

Component: contracts/launchpad/LaunchToken.sol - _decreaseFeeShares() function

When users transfer LaunchTokens, the _decreaseFeeShares() function incorrectly reduces bonding shares even when the sender still holds their original (first generation) tokens purchased from the launchpad. This breaks the fee-sharing mechanism for legitimate token holders.

Vulnerable Code Location

// LaunchToken.sol lines 134-151
function _decreaseFeeShares(address account, uint256 amount) internal {
    uint256 share = bondingShare[account];
    if (share == 0 || account == address(0)) return;

    amount = amount > share ? share : amount;  //Reduces shares by transfer amount, not considering remaining tokens

    emit FeeShareDecreased(account, amount, _incEventNonce());

    unchecked {
        totalFeeShare -= amount;
        bondingShare[account] -= amount;  //Incorrectly reduces bonding shares
    }

    if (totalFeeShare == 0 && !unlocked) _endRewards();
    ILaunchpad(launchpad).decreaseStake(account, uint96(amount));
}

Attack Vector / Bug Flow

  1. UserA: Buys 400M tokens → gets 400M bonding shares
  2. UserB: Buys 400M tokens → gets 400M bonding shares -> {{ Token bonds(graduates) and thus is unlocked }}
  3. UserA: Transfers 400M tokens to UserB → UserA correctly loses all bonding shares
  4. UserB: Now has 800M tokens but still only 400M bonding shares
  5. UserB: Transfers the 400M tokens gotten from UserA to UserC → BUG: UserB loses ALL bonding shares
  6. Result: UserB still holds 400M original tokens but has 0 bonding shares and loses fee-sharing rights (unstake).

Recommended mitigation steps

The bonding share reduction logic should track which tokens are original vs. transferred:

// Option 1: Track original vs transferred tokens separately
mapping(address => uint256) public originalTokens;
mapping(address => uint256) public transferredTokens;

// Option 2: Only reduce bonding shares proportionally to original tokens transferred
function _decreaseFeeShares(address account, uint256 amount) internal {
    uint256 share = bondingShare[account];
    if (share == 0 || account == address(0)) return;

    // Only reduce shares if transferring original tokens, not received tokens
    uint256 originalBalance = originalTokens[account];
    uint256 shareReduction = amount > originalBalance ? share : (share * amount) / originalBalance;

    // ... rest of function with shareReduction instead of amount
}

View detailed Proof of Concept


The original report as published on Code4rena, by Web3Vikings. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the _decreaseFeeShares function reduces bonding shares by the transfer amount without distinguishing between original tokens and tokens received from others.

What the attacker needed

User holds original tokens and receives tokens from another…; User transfers the received tokens to a third party

The fix

The bonding share reduction logic should track which tokens are original versus transferred and only reduce shares proportionally to original tokens transferred.

How it was found

  1. UserA buys 400M tokens and gets 400M bonding shares.
  2. UserB buys 400M tokens and gets 400M bonding shares; token bonds and becomes unlocked.
  3. UserA transfers 400M tokens to UserB; UserA loses all bonding shares.
  4. UserB now has 800M tokens but still only 400M bonding shares.
  5. UserB transfers the 400M tokens received from UserA to UserC; UserB loses all bonding shares.
  6. UserB still holds 400M original tokens but has 0 bonding shares and loses fee-sharing rights.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Bonding shares represent a user's stake in fee rewards from the launchpad. The contract mistakenly reduces these shares based on any token transfer, not just transfers of tokens the user originally bought. So someone can end up with tokens but no shares, losing their rewards.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More from GTE Perps and Launchpad

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.