Incorrect dust handling in yield distribution leads to permanent fund lock
The yield distribution functions in ArcToken fail to redistribute rounding dust when the last holder in the array is restricted from receiving yield. This causes yield tokens to become permanently locked in the contract with no recovery mechanism.
- Disclosed after under an hour
52285 sc high incorrect dust handling in yield distribution leads to permanent fund lock
Submitted on Aug 9th 2025 at 13:39:56 UTC by @vivekd for Attackathon | Plume Network
- Report ID: #52285
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcToken.sol
- Impacts: Permanent freezing of funds
Description
Brief/Intro
The distributeYield and previewYieldDistribution functions in ArcToken fail to properly redistribute rounding dust when the last holder in the holders array is restricted from receiving yield.
This causes yield tokens to become permanently locked in the ArcToken contract with no mechanism for recovery, leading to an accumulation of stuck funds over time.
Vulnerability Details
The vulnerability exists in the dust redistribution logic within both yield distribution functions.
The contract uses a common pattern to handle rounding errors where the last eligible holder receives totalAmount - sumOfPreviousDistributions to capture any dust from integer division:
// In distributeYield() - lines 448-457
if (holderCount > 0) {
address lastHolder = $.holders.at(lastProcessedIndex);
if (_isYieldAllowed(lastHolder)) {
uint256 lastShare = amount - distributedSum;
if (lastShare > 0) {
yToken.safeTransfer(lastHolder, lastShare);
distributedSum += lastShare;
}
}
// BUG: If lastHolder is restricted, lastShare is never distributed
}
When the last holder in the array is blacklisted or sanctioned (fails _isYieldAllowed check), the dust amount (amount - distributedSum) is never transferred to anyone.
The yield tokens remain in the ArcToken contract permanently as there is no recovery mechanism.
The same issue exists in previewYieldDistribution():
// Lines 297-301
if (!_isYieldAllowed(lastHolder)) {
amounts[lastProcessedIndex] = 0; // Dust is not accounted for
} else {
amounts[lastProcessedIndex] = amount - totalPreviewAmount;
}
Impact Details
- Permanent Fund Lock: With realistic RWA parameters, significant value accumulates.
- Accounting Discrepancy: The
YieldDistributedevent emitsdistributedSumwhich is less than the actual amount transferred into the contract, creating accounting inconsistencies that affect analytics and auditing. - Preview Function Inaccuracy:
previewYieldDistributionreturns incorrect totals (example: shows 490,200 satoshis distributed when 500,000 were allocated). - Scalability Impact: With multiple RWA tokens on the platform, locked funds multiply.
- No Recovery Mechanism: The
ArcTokencontract has no function to sweep stuck yield tokens, making the lock permanent and growing indefinitely.
References
- https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcToken.sol#L233-L305
- https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcToken.sol#L384-L460
Proof of Concept
{% stepper %} {% step %}
Setup
Deploy ArcToken with a realistic RWA tokenization scenario:
- TVL: $120,000
- 10,000 holders each holding 12 tokens (120,000 total supply)
- 196 holders are yield-restricted (sanctioned/blacklisted)
- One restricted holder is last in the
holdersarray - APY: 6% with monthly distributions
- Yield paid in WBTC at $120,000/BTC {% endstep %}
{% step %}
Monthly Yield Calculation
- Monthly yield: ($120,000 * 6%) / 12 = $600
- In WBTC: $600 / $120,000 = 0.005 WBTC = 500,000 satoshis {% endstep %}
{% step %}
Calculate Effective Total Supply
- Total supply: 120,000 tokens
- Restricted holders' balance: 196 holders * 12 tokens = 2,352 tokens
- Effective total supply (eligible for yield): 120,000 - 2,352 = 117,648 tokens {% endstep %}
{% step %}
Call previewYieldDistribution(500000)
- 9,804 eligible holders (10,000 - 196)
- Each eligible holder calculation:
holderShare = (500,000 * 12) / 117,648 = 50.999592003264... satoshis
- Integer division truncates to 50 satoshis
- Total distributed to first 9,804 eligible holders: 9,804 * 50 = 490,200 satoshis
- Dust that should go to last eligible holder: 500,000 - 490,200 = 9,800 satoshis
- But if last holder is restricted: 9,800 satoshis not distributed {% endstep %}
{% step %}
Execute distributeYield(500000)
- Contract receives 500,000 satoshis via
transferFrom - Process holders loop:
-
First 9,804 eligible holders each receive 50 satoshis
-
distributedSum = 9,804 * 50 = 490,200satoshis -
Last holder (restricted):
Solidity if (_isYieldAllowed(lastHolder)) { // Returns false // Skipped - 9,800 satoshis remain undistributed }
-
- Event emitted:
YieldDistributed(490200, WBTC)— incorrect amount - 9,800 satoshis permanently locked in contract {% endstep %}
{% step %}
Check Contract Balance Over Time
- After first month:
WBTC.balanceOf(arcToken) = 9,800 satoshis - After one year:
WBTC.balanceOf(arcToken) = 117,600 satoshis(accumulated monthly)
No function exists to recover these funds; they accumulate indefinitely. {% endstep %} {% endstepper %}
Conclusion
The distribution logic assumes the last holder is eligible to receive the dust. When that holder is restricted, the dust is neither redistributed nor recoverable, causing permanent lock of yield tokens and incorrect accounting/reporting. The issue affects both actual distribution and preview calculations and scales with the number of tokens and distributions over time.
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
The dust redistribution logic assumes the last holder is eligible; when that holder is restricted, the dust is neither redistributed nor recoverable.
Impact
Yield tokens become permanently locked in the contract, accumulating over time, and the event emits an incorrect distributed amount, causing accounting discrepancies.
What the attacker needed
Last holder in array is restricted; yield distribution occurs
The fix
The dust should be redistributed to another eligible holder or handled so it is not left in the contract.
How it was found
- Deploy ArcToken with a realistic RWA tokenization scenario including restricted holders.
- Calculate monthly yield in WBTC satoshis.
- Calculate effective total supply excluding restricted holders.
- Call previewYieldDistribution and observe dust not distributed when last holder is restricted.
- Execute distributeYield and observe dust remains in contract.
- Check contract balance over time to see accumulation of locked funds.
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 pays out yield to many holders, integer division can leave a tiny remainder (dust). The code gives that dust to the last holder, but if that holder is blocked from receiving funds, the dust is never sent and stays stuck in the contract forever.
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.