Skip to content
Business logic Audit finding Beginner

Previewyielddistribution reverts instead of returning zero when no tokens are in circulation

The previewYieldDistribution function in ArcToken.sol reverts with NoTokensInCirculation when the token supply is zero, instead of returning zero amounts for all holders. This blocks normal edge cases and can cause integrations that rely on previewing yield to fail.

Afriauditor Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

52129 sc low previewyielddistribution reverts instead of returning zero when no tokens are in circulation

Submitted on Aug 8th 2025 at 07:49:22 UTC by @Afriauditor for Attackathon | Plume Network

Description

Brief/Intro

The previewYieldDistribution function in ArcToken.sol reverts when the token supply is zero, instead of returning zero amounts for all holders. This unnecessarily blocks normal edge cases and can cause integrations to fail when previewing yield.

Vulnerability Details

Inside previewYieldDistribution, the code explicitly checks:

Solidity
if (supply == 0) {
    revert NoTokensInCirculation();
}

The correct behavior should be to return arrays of holders and amounts where each amount is 0 if the total supply is 0. This ensures that preview calls work in all states and avoids breaking logic that rely on the function.

Impact Details

Contract fails to deliver promised returns in scenarios where preview functionality is relied upon to return a value.

Proof of Concept

{% stepper %} {% step %}

Setup

Have ArcToken in a state where totalSupply() == 0 (e.g., no mints yet or everything burned). {% endstep %}

{% step %}

Action

Call previewYieldDistribution(amount) with any non-zero amount. {% endstep %}

{% step %}

Observed Behavior

The function reads supply = totalSupply() and hits:

Solidity
if (supply == 0) {
    revert NoTokensInCirculation();
}

The call reverts instead of returning arrays filled with zeros. {% endstep %} {% endstepper %}

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 function explicitly reverts when totalSupply() is zero rather than returning zero amounts.

Impact

Contract fails to deliver promised returns in scenarios where preview functionality is relied upon to return a value.

What the attacker needed

TotalSupply() equals zero

The fix

The function should return arrays of holders and zero amounts when totalSupply() is zero instead of reverting.

How it was found

  1. Put ArcToken in a state where totalSupply() is zero.
  2. Call previewYieldDistribution with any non-zero amount.
  3. Observe the call reverts with NoTokensInCirculation instead of returning zero arrays.

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 has a function that lets you preview how much yield each holder would get. If no tokens exist yet, the function crashes with an error instead of simply saying everyone gets zero. This can break other programs that call it expecting a normal answer.

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.