TempleGold

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

`TempleGold::_getMintAmount` does not count mintAmount correctly

Summary

TempleGold::_getMintAmount counts mint amount in the wrong way, which will lead to minting maximum supply of token immediately

Vulnerability Details

TempleGold::_getMintAmount has a broken formula. It counts how many tokens to mint for the particular period:

mintAmount = TempleMath.mulDivRound((block.timestamp - _lastMintTimestamp) * (MAX_SUPPLY), vestingFactorCache.numerator, vestingFactorCache.denominator, false);

They take seconds passed and should divide it by one year in seconds, to take a correct slice from the MAX_SUPPLY. Currently, if neglect by vesting factor for simplicity, when 1 second passed, mintAmount would equal to MAX_SUPPLY already.

Impact

Will count mint in the wrong way

Tools Used

Manual review

Recommendations

Fix the formula by dividing it by the one year

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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