Skip to content
Business logic Audit finding Beginner

Reward rate checkpoints are used but are never set

The reward rate checkpoint accessor functions read from a mapping that is never populated for tokens, so the stored array length is always zero. As a result, the count function always returns zero and the checkpoint getter always reverts, meaning the contract fails to deliver the promised return information.

a16 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

53059 sc low reward rate checkpoints are used but are never set

Submitted on Aug 14th 2025 at 18:30:04 UTC by @a16 for Attackathon | Plume Network

Description

Brief / Intro

Several functions use the rewardRateCheckpoints[] mapping, but checkpoints are never set for a specific token — only for a token/validator pair.

Vulnerability Details

Functions like getRewardRateCheckpoint() and getRewardRateCheckpointCount() use rewardRateCheckpoints[token], but rewardRateCheckpoints[token].length is always 0 as it is never set.

Example snippets from the codebase that demonstrate the issue:

Solidity
if (index >= $.rewardRateCheckpoints[token].length) {
    revert InvalidRewardRateCheckpoint(token, index);
}

Since rewardRateCheckpoints[token].length is always 0, this is effectively:

Solidity
if (index >= 0) {
    revert InvalidRewardRateCheckpoint(token, index);
}

So getRewardRateCheckpointCount() will always return 0, and getRewardRateCheckpoint() will always revert.

Impact Details

  • Users calling these functions will either receive 0 for checkpoint counts or encounter a revert when attempting to read a checkpoint.
  • This results in functions failing to deliver the promised returns information (or related behavior) but does not directly cause loss of funds or contract value.

Suggestions

rewardRateCheckpoints[] appears to be vestigial (unused) or misused. Consider one of the following:

  • Remove rewardRateCheckpoints and all references to it if it is truly unused.
  • Or, if intended, ensure checkpoints are populated for tokens (not only token/validator pairs) and update the accessors to reference the correct storage structure.

Proof of Concept

{% stepper %} {% step %}

Reproduce

  1. Call getRewardRateCheckpoint() for a token and any index.

Result: the call reverts due to the check against an always-zero length. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by a16. 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 checkpoint mapping is keyed by token alone in the accessors, while checkpoints are only ever written for a token/validator pair, leaving the token-keyed array permanently empty.

Impact

Users calling these functions either get a zero count or a revert, so the contract fails to deliver the promised return information, but no funds or contract value are lost.

What the attacker needed

None

The fix

The mapping should either be removed along with all references if it is unused, or populated for tokens and the accessors updated to reference the correct storage structure.

How it was found

  1. Call getRewardRateCheckpoint() for a token and any index.
  2. Observe the call reverts because the length check is against an always-zero array.

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 keeps a list of past 'reward rate' values so people can look them up later. The code that reads this list looks in a place that is never filled in, so the list is always empty. Anyone asking for a past value gets an error instead of an answer, though no money is lost.

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 a16

View all

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