Skip to content

Codex [ Crypto ] Fix YieldVault phantom rewards#4439

Closed
justusaugust wants to merge 1 commit into
UnsafeLabs:mainfrom
justusaugust:codex/crypto-yieldvault-914
Closed

Codex [ Crypto ] Fix YieldVault phantom rewards#4439
justusaugust wants to merge 1 commit into
UnsafeLabs:mainfrom
justusaugust:codex/crypto-yieldvault-914

Conversation

@justusaugust
Copy link
Copy Markdown

@justusaugust justusaugust commented May 25, 2026

/claim #914

Fixes #914.

Summary

  • Caps reward accrual with lastTimeRewardApplicable() so rewards stop at periodFinish and deposits after expiry do not accrue phantom rewards.
  • Makes earned() use the capped reward-per-token value and stores capped update times.
  • Restricts notifyRewardAmount() to the configured reward distributor and rejects zero reward/duration inputs.
  • Uses 1e18 scaled reward-rate accounting to reduce truncation loss below the requested 0.01% threshold.
  • Adds focused Ganache/Solc tests for active accrual, post-expiry freeze, unauthorized notify, precision, and deposit/withdraw/claim flows.
  • Includes safe _contributor.json metadata with private runtime instructions redacted rather than leaked.

Verification

  • npm test from solidity/ -> 5 passing
  • git diff --check -> passed

Note: Ganache prints a local µWS native-binary fallback warning on this machine; the suite still passes using the JS fallback.

Demo Video

@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 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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