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.
- 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
- Report ID: #52915
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcToken.sol
- Impacts: Permanent freezing of funds
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:
- When all token holders are restricted from receiving yield (resulting in
effectiveTotalSupply == 0), the functions still execute thesafeTransferFromcall but thenemit YieldDistributed(0, ...)and return without distributing any tokens. - The transferred yield tokens become permanently trapped in the contract since there are no sweep or recovery functions implemented.
Root cause summary:
safeTransferFromexecutes first, pulling tokens from the caller.effectiveTotalSupplyis calculated afterward by checking yield restrictions.- If no holders are eligible (
effectiveTotalSupply == 0), the function returns early without distribution. - No recovery mechanism exists to retrieve the trapped tokens.
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 == 0by 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_ROLEaccount, approve yield tokens to the ArcToken contract. - Call
distributeYield(amount)with a significant amount of yield tokens. {% endstep %}
{% step %}
Observe fund loss
- The
safeTransferFromexecutes first, transferring yield tokens from caller to contract. - Function calculates
effectiveTotalSupply == 0and emitsYieldDistributed(0, yieldTokenAddr). - Yield tokens are now permanently trapped in the
ArcTokencontract. {% 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
- ArcToken.sol at lines referenced above:
- https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcToken.sol#L408
- https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcToken.sol#L417-L423
- https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcToken.sol#L425-L428
- https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcToken.sol#L526-L528
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
- Deploy an ArcToken contract with yield blacklist restrictions enabled and set up a yield token for distribution.
- Mint ArcTokens to several addresses and add all of them to the yield blacklist.
- Confirm that every holder is ineligible so the effective total supply is zero.
- As an account with the yield distributor role, approve yield tokens and call the distribution function with a significant amount.
- Observe that the transfer happens first, the function emits a zero distribution event, and the tokens remain in the contract.
- 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.