TempleGold

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

rewardPerTokenStored can be inflated and rewards can be stolen

Summary

Vulnerability Details

Impact

The first user who calls TempleGoldStaking.sol stake() with 1 wei can inflate the rewardPerTokenStored. And the same user can call withdraw and drain the rewards.
Since rewardPerToken() depends on the denominator as totalSupply(), the whole multiplying will be divided by 1 wei which will inflate the rewardPerTokenStored.

https://github.com/Cyfrin/2024-07-templegold/blob/main/protocol/contracts/templegold/TempleGoldStaking.sol#L502

Tools Used

Recommendations

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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