Skip to content
Business logic Audit finding Beginner

Updating MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR impacts unclaimed rewards of past epochs

The maximum reward per wallet per epoch is stored as a single updatable variable rather than being fixed per epoch. If an admin changes this cap, users claiming rewards from past epochs may receive a different amount than originally calculated.

Oxrochimaru Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#42407 [SC-Low] Updating MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR impacts unclaimed rewards of past epochs

Submitted on Mar 23rd 2025 at 17:54:49 UTC by @Oxrochimaru for Audit Comp | Yeet

Description

Brief/Intro

Variable RewardSettings::MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR is updatable by admin. It is the max rewards a single wallet can receive per epoch.

The users can claim their rewards of past epochs any time in future. But if MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR is updated, this new value will be applied to past epoch rewards. Hence, creating uncertainty in amount of rewards user will get for an epoch.

Vulnerability Details

A user can claim their past rewards anytime they want. Their past rewards is calculated as getClaimableAmount(). Here, MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR is not stored per epoch. Instead, its a single value used for every epoch. If it is updated then user's past rewards might change too. He might get less or more tokens depending upon new MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR.

The user's rewards should remain fixed for past epochs, no matter when they decide to claim their rewards.

Impact Details

If a user claims the rewards in future, it might get less or more rewards than initially calculated.

References

Add any relevant links to documentation or code
https://github.com/immunefi-team/audit-comp-yeet/blob/main/src/Reward.sol?utm\\_source=immunefi#L187

Proof of Concept

Proof of Concept

  • Total rewards to be distributed is 100.
  • Max rewards per user is 30%.
  • Alice is eligible for 25 rewards.
  • The protocol decided to change max rewards to 20%.
  • Now, if Alice claims in future, she is eligible for only 20 rewards now instead of 25
  • Even though this epoch has ended, Alice rewards are still tied to current max rewards value in the contract.

The original report as published on Immunefi, by Oxrochimaru. 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 maximum reward per wallet per epoch is stored as a single global variable instead of being recorded per epoch, so updates retroactively affect past epochs.

Impact

Users claiming rewards from past epochs could receive less or more than originally calculated, creating uncertainty in reward amounts.

What the attacker needed

Admin updates the max cap setting; user claims rewards from a past epoch

The fix

The maximum reward per wallet per epoch should be stored per epoch so that past rewards remain fixed.

How it was found

  1. Total rewards to be distributed is 100.
  2. Max rewards per user is 30%.
  3. Alice is eligible for 25 rewards.
  4. The protocol decided to change max rewards to 20%.
  5. Now, if Alice claims in future, she is eligible for only 20 rewards now instead of 25

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 lets users claim rewards later. The maximum reward per user is a setting the admin can change. If the admin changes it, past rewards are recalculated with the new limit, so users might get less or more than they earned.

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 Oxrochimaru

View all

1 more disclosed report, best first.

More from Yeet

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.