TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: medium
Invalid

`distributeGold` is missing `updateReward` modifier

GitHub

https://github.com/Cyfrin/2024-07-templegold/blob/6c3980a0486c01114d0ef1281df188b6c01991e6/protocol/contracts/templegold/TempleGoldStaking.sol#L401

Summary

The distributeGold function mints and distributes Temple Gold rewards to stakers. However, it currently lacks the updateReward(address(0), 0) modifier to ensure reward-related state variables are updated correctly.

Impact

Without the updateReward(address(0), 0) modifier, the distributeGold function may not properly account for the latest state changes in rewards. This can lead to inaccuracies in reward distribution and incorrect calculation of claimable rewards for stakers.

Recommendation

Add the updateReward(address(0), 0) modifier to the distributeGold function to ensure all reward-related state variables are updated before distributing new rewards. This will maintain the accuracy and integrity of the reward calculation and distribution process.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.