Skip to content

fix: [ Crypto ] Fix phantom reward accrual after period expiry in YieldVault#1159

Closed
Mira-Mjodheim wants to merge 1 commit into
UnsafeLabs:mainfrom
Mira-Mjodheim:mira-fix-4454360925-89309
Closed

fix: [ Crypto ] Fix phantom reward accrual after period expiry in YieldVault#1159
Mira-Mjodheim wants to merge 1 commit into
UnsafeLabs:mainfrom
Mira-Mjodheim:mira-fix-4454360925-89309

Conversation

@Mira-Mjodheim
Copy link
Copy Markdown

Fixes #914

Reading all three files against the issue requirements.

Contract analysis:

1. lastTimeRewardApplicable() (line 39–41) — Correctly returns min(block.timestamp, periodFinish), capping accumulation at period end. ✅

2. rewardPerToken() (lines 43–48) — Uses lastTimeRewardApplicable() instead of raw block.timestamp. After periodFinish, delta is zero, so stored value freezes. No underflow risk: lastUpdateTime is always set to lastTimeRewardApplicable() by the modifier, so lastTimeRewardApplicable() >= lastUpdateTime always holds. ✅

3. earned() (lines 50–52) — D

Changed Files

  • solidity/contracts/YieldVault.sol
  • solidity/contracts/_contributor.json
  • solidity/test/

Test Results

('No test suite detected.', False)

…ldVault

Reading all three files against the issue requirements.

**Contract analysis:**

**1. `lastTimeRewardApplicable()` (line 39–41)** — Correctly returns `min(block.timestamp, periodFinish)`, capping accu
@github-actions
Copy link
Copy Markdown
Contributor

Unfortunately the changes in this PR didn't fully resolve the issue. Please rework your solution and submit a new pull request.

Make sure to review the acceptance criteria in the linked issue and verify all conditions are met before resubmitting. See CONTRIBUTING.md for guidelines.

@github-actions github-actions Bot closed this May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Crypto ] Fix phantom reward accrual after period expiry in YieldVault

1 participant