Skip to content
Business logic Audit finding Intermediate

Dust accumulation in batched yield payouts leaves tokens stranded

The batched yield distribution function deposits the full round amount on the first batch but truncates each holder's share using integer division, leaving a remainder in the contract. Over repeated rounds this dust accumulates permanently because there is no sweep or final settlement, so holders are underpaid and tokens are stranded.

Afriauditor Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

52439 sc high dust accumulation in batched yield payouts leaves tokens stranded

Submitted on Aug 10th 2025 at 17:50:42 UTC by @Afriauditor for Attackathon | Plume Network

Description

Brief / Intro

distributeYieldWithLimit pays yield in batches but never reconciles integer-division remainders (“dust”) across the entire round. Because the function pulls the full totalAmount on the first batch and truncates per-holder payouts in each batch, the leftover dust remains in the contract with no sweep or final settlement. Over time this strands yield tokens and underpays holders.

Vulnerability Details

In the batched path:

Solidity
if (startIndex == 0) {
    yToken.safeTransferFrom(msg.sender, address(this), totalAmount);
}
...
// computed once per call, for all holders
uint256 effectiveTotalSupply = ... // sum of eligible balances

// for each holder in this batch only
uint256 share = (totalAmount * holderBalance) / effectiveTotalSupply;
yToken.safeTransfer(holder, share);
amountDistributed += share;
...
if (nextIndex == 0) {
    emit YieldDistributed(totalAmount, yieldTokenAddr);
}
  • The full totalAmount is deposited on the first batch.
  • Payouts use integer division per holder and per batch; truncation leaves a remainder.
  • There is no logic at the end of the final batch (nextIndex == 0) to transfer the round’s remainder to anyone or to sweep it.
  • Unlike the single-shot distributeYield (which pays the final remainder to the last holder), the batched version never assigns the cumulative leftover, so the deposited yield minus the sum of all per-holder share transfers (across all batches) sits in the contract.
  • Because the contract has no sweep/withdraw for stuck yield and subsequent calls to distributeYieldWithLimit deposit new totalAmount (rather than using existing balance), the dust accumulates permanently.

Impact Details

{% hint style="danger" %} Permanent freezing of funds: The unallocated remainder of each batched distribution stays in the token contract with no recovery path. {% endhint %}

Proof of Concept

{% stepper %} {% step %}

Setup

  1. Deploy and initialize ArcToken and a mock yield token; set the yield token.
  2. Mint 1e18 ARC to A and 1e18 ARC to B (both eligible → effectiveTotalSupply = 2e18).
  3. From the distributor, approve 3 units of the yield token for ArcToken to pull. {% endstep %}

{% step %}

First batch

Call:

  • distributeYieldWithLimit(totalAmount=3, startIndex=0, maxHolders=1)

Behavior:

  • Because startIndex == 0, the contract pulls 3.
  • It pays only A: floor(3 * 1e18 / 2e18) = 1.
  • Return values: nextIndex = 1, amountDistributed = 1. {% endstep %}

{% step %}

Second batch

Call:

  • distributeYieldWithLimit(totalAmount=3, startIndex=1, maxHolders=1)

Behavior:

  • It pays only B: floor(3 * 1e18 / 2e18) = 1.
  • Returns nextIndex = 0, amountDistributed = 1. {% endstep %}

{% step %}

Result

  • Balances: A = 1, B = 1 → total paid = 2.
  • But 3 were deposited initially → 1 unit remains in the ArcToken contract as dust.
  • Repeat across rounds and dust accumulates. {% endstep %} {% endstepper %}

References

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

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 batched distribution calculates each holder's share with integer division and never reconciles the cumulative remainder at the end of the final batch, unlike the single-shot function.

Impact

The unallocated remainder of each batched distribution stays in the token contract with no recovery path, so yield tokens are permanently frozen and holders are underpaid.

What the attacker needed

Batched distribution used; integer division leaves a remainder; no sweep function

The fix

The batched distribution should track and settle the cumulative remainder at the end of the final batch, or provide a sweep mechanism, so no dust is left stranded.

How it was found

  1. Deploy and initialise the token and a mock yield token, then mint equal eligible balances to two holders.
  2. Approve the yield token so the contract can pull the round amount.
  3. Call the batched distribution with the first holder index and a batch size of one, which pulls the full amount and pays the first holder a truncated share.
  4. Call the batched distribution again for the second holder, which pays another truncated share and returns the final index.
  5. Observe that the total paid is less than the amount deposited, leaving dust in the contract.

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.

When a contract splits an amount among many people using whole numbers, the division often leaves a small remainder. In this batched payout function the full amount is taken in at the start, but each person's share is rounded down and the leftover is never given to anyone or returned. Over time those small leftovers pile up inside the contract and cannot be recovered.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Afriauditor

View all

28 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.