Skip to content
Business logic Audit finding Intermediate

Last holder always gets more yield

The token's yield distribution sends all rounding remainders to whichever holder is last in the holders array, and new holders are appended to the end. An attacker could transfer a small amount to a fresh address just before each distribution to become the last holder and repeatedly collect the leftover yield.

funkornaut Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

50839 sc low last holder always gets more yield

Submitted on Jul 29th 2025 at 00:55:55 UTC by @funkornaut for Attackathon | Plume Network

Description

Brief/Intro

ArcToken’s yield distribution mechanism allows users to manipulate their position in the holders array to consistently become the “last holder” before each distribution. This guarantees them all leftover yield from rounding errors, enabling systematic and repeatable yield theft at minimal cost.

Vulnerability Details

The issue stems from how holders are tracked and how yield is distributed:

  • New token holders are always appended to the end of the holders array:
Solidity
if (to != address(0) && balanceOf(to) > 0) {
    $.holders.add(to);
}
  • During yield distribution, all rounding remainders are sent to the last holder:
Solidity
uint256 lastShare = amount - distributedSum;
if (lastShare > 0) {
    yToken.safeTransfer(lastHolder, lastShare);
}

Because of this design, an attacker can repeatedly transfer any token amount to a fresh address just before distribution, ensuring that the address becomes the last holder and captures all rounding dust. This can be repeated every distribution cycle for guaranteed extra yield.

Impact Details

This bug allows:

  • Guaranteed extra yield to the attacker each cycle by being the last holder
  • Theft of protocol yield that should be retained or fairly redistributed
  • Scalable abuse, especially in systems with many small holders or restricted accounts

In testing, the last holder received up to 9% more than others due to this flaw. The exploit is cheap (just a token transfer) and repeatable, making the impact high and the risk of abuse critical.

References

Link to Proof of Concept

https://gist.github.com/Funkornaut/5ef069235a0712d84df52c520a811c23

Proof of Concept

{% stepper %} {% step %}

Step

User who is already a holder sees distributeYield is about to be called. {% endstep %}

{% step %}

Step

Just before distributeYield is called they transfer arc tokens to a wallet which they own but don't currently hold arc tokens, this ensures they are the last holder in the holders array. {% endstep %}

{% step %}

Step

Because of slight truncation with the reward math the last user of the array gets slightly more yield given to them. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by funkornaut. 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 distribution logic assigns the entire rounding remainder to the last holder in an append-ordered array, which any user can control by transferring tokens to a fresh address.

Impact

The attacker could gain extra yield each cycle, with the report claiming the last holder received up to 9% more in testing, though the amount depends on rounding and the number of holders.

What the attacker needed

Already holds tokens; can transfer tokens before distribution; controls a second address

The fix

The remainder should be retained by the protocol or distributed by a method that does not depend on holder ordering, rather than being paid to the last holder.

How it was found

  1. Notice that a yield distribution is about to be called.
  2. Just before it runs, transfer tokens to a wallet you own that does not currently hold tokens, making it the last holder.
  3. The rounding remainder from the reward maths is paid to that last holder.

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 token pays out rewards, the maths rarely divides perfectly, so a tiny leftover amount remains. This contract gives that leftover to whoever happens to be last in its list of holders. Because anyone can add a new address to the end of that list with a small transfer, a user can keep grabbing the leftover every time.

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 funkornaut

View all

4 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.