Misleading view function documentation
A function in a rewards contract is documented as an internal view function, but it actually changes stored state by calling a rewards calculation routine that updates several storage variables. The report only flags the misleading documentation and does not claim any exploitable consequence.
- Disclosed after under an hour
51493 sc insight misleading view function documentation
Submitted on Aug 3rd 2025 at 11:20:30 UTC by @heavyw8t for Attackathon | Plume Network
- Report ID: #51493
- Report Type: Smart Contract
- Report severity: Insight
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/RewardsFacet.sol
- Impacts: (none specified)
{% hint style="info" %} Brief/Intro
The _earned function in RewardsFacet.sol is documented as an "Internal View Function" but actually modifies state by calling calculateRewardsWithCheckpoints(), which updates storage variables.
{% endhint %}
Vulnerability Details
See POC
Impact Details
Insight: The documentation is incorrect and misleading.
Proof of Concept
<details> <summary>Proof of Concept — details</summary>The function comment states "Internal View Function (earned)," but the implementation calls PlumeRewardLogic.calculateRewardsWithCheckpoints(), which in turn calls updateRewardPerTokenForValidator(). This function modifies several storage variables:
$.validatorLastUpdateTimes[validatorId][token] = block.timestamp$.validatorRewardPerTokenCumulative[validatorId][token] += rewardPerTokenIncrease$.validatorAccruedCommission[validatorId][token] += commissionDeltaForValidator
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 code comment describing the function as an internal view was not updated after the implementation began calling a routine that writes to storage.
Impact
The only stated impact is that the documentation is incorrect and misleading; no exploit or loss is claimed.
What the attacker needed
None
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 'view' function is meant to only read data and never change anything. Here the code comment says the function is a view, but the function actually writes new values into the contract's storage. The report is only about the comment being wrong, not about anyone being able to steal or break something.