Skip to content
Smart contracts Audit finding Intermediate

Yield are transferred before eligibility check potentially leading to freezing of funds

The yield distribution functions in ArcToken transfer yield tokens from the caller into the contract before checking whether any token holders are eligible to receive them. If all holders are restricted, the tokens are pulled in but no distribution occurs, and they become permanently trapped because no recovery function exists.

spongebob Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

52915 sc low yield are transferred before eligibility check potentially leading to freezing of funds

Submitted on Aug 14th 2025 at 09:13:02 UTC by @spongebob for Attackathon | Plume Network

Description

The distributeYield and distributeYieldWithLimit functions in the ArcToken contract contain a flaw where yield tokens are transferred from the caller to the contract before checking if any token holders are eligible to receive yield.

Behavior:

Root cause summary:

The same pattern exists in distributeYieldWithLimit where tokens are transferred on the first batch (startIndex == 0) before eligibility checks.

Impact

Yield tokens transferred to the contract cannot be recovered through any on-chain mechanism, leading to permanent loss of yield tokens when all token holders become ineligible for yield distribution.

Proof of Concept

{% stepper %} {% step %}

Deploy ArcToken with yield restrictions

  • Deploy an ArcToken contract with yield blacklist restrictions enabled.
  • Set up a yield token (e.g., USDC) for distribution. {% endstep %}

{% step %}

Create token holders and restrict them

  • Mint ArcTokens to multiple addresses (e.g., Alice, Bob, Charlie).
  • Add all token holders to the yield blacklist using YieldBlacklistRestrictions.addToBlacklist(). {% endstep %}

{% step %}

Verify all holders are restricted

  • Confirm effectiveTotalSupply == 0 by checking that _isYieldAllowed() returns false for all holders.
  • All holders should be ineligible for yield distribution. {% endstep %}

{% step %}

Attempt yield distribution

  • As a YIELD_DISTRIBUTOR_ROLE account, approve yield tokens to the ArcToken contract.
  • Call distributeYield(amount) with a significant amount of yield tokens. {% endstep %}

{% step %}

Observe fund loss

  • The safeTransferFrom executes first, transferring yield tokens from caller to contract.
  • Function calculates effectiveTotalSupply == 0 and emits YieldDistributed(0, yieldTokenAddr).
  • Yield tokens are now permanently trapped in the ArcToken contract. {% endstep %}

{% step %}

Confirm permanent loss

  • Check that yield tokens are stuck in the contract balance.
  • Verify no sweep/recovery functions exist in the contract to retrieve the tokens.
  • Funds remain inaccessible to all parties, including contract administrators.

Note: The same scenario applies to distributeYieldWithLimit() when called with startIndex == 0. {% endstep %} {% endstepper %}

References

The original report as published on Immunefi, by spongebob. 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

The function performs the token transfer before computing the eligible supply, and returns early without distributing or refunding when that supply is zero.

Impact

Yield tokens sent by a distributor when all holders are ineligible become permanently stuck in the contract, with no on-chain way to recover them.

What the attacker needed

Caller holds the yield distributor role; all token holders are yield-restricted; caller approves yield tokens to the contract

The fix

The eligibility check should be performed before pulling tokens, or the transfer should be skipped or reverted when no holders are eligible.

How it was found

  1. Deploy an ArcToken contract with yield blacklist restrictions enabled and set up a yield token for distribution.
  2. Mint ArcTokens to several addresses and add all of them to the yield blacklist.
  3. Confirm that every holder is ineligible so the effective total supply is zero.
  4. As an account with the yield distributor role, approve yield tokens and call the distribution function with a significant amount.
  5. Observe that the transfer happens first, the function emits a zero distribution event, and the tokens remain in the contract.
  6. Confirm that no sweep or recovery function exists, so the tokens are inaccessible to everyone.

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.

A smart contract can hold tokens and send them out to people. Here, the contract takes tokens from the person calling it first, and only afterwards checks whether anyone is allowed to receive them. If nobody is allowed, the tokens stay stuck in the contract with no way to get them out.

What is Smart contracts?

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

More by spongebob

View all

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

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.