TempleGold

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

Nothing is returned when `TempleGold::_canDistribute` returns False in `TempleGold::Mint`

I-1 Nothing is returned when TempleGold::_canDistribute returns False in TempleGold::Mint

Vulnerability Details

TempleGold::Mint checks whether the calculated mintAmount can be distributed.

When the result is false, nothing is returned to the user showing what really happened and a caller can assume all went right.

if (!_canDistribute(mintAmount)) {
return;
}

Impact

The caller won't be able to mititgate the issue causing the return and its more likely that it would occur again denying the user the full functionality of the mint function.

Recomendation

The mint function should return something like a boolean to signify whether it has executed as intended.

I-2 The variable for Reward data are declared in TempleGoldStaking and there getter function in ITempleGoldStaking but no used.

The variables

uint256 public override rewardPerTokenStored;
uint256 public override periodFinish;
uint256 public override rewardPerTokenStored;

Are declared in TempleGoldStaking but are not used at all since their data is already stored in the TempleGoldStaking::rewardData struct.

Recomendation

Consider removing them as they will increase your contract deployment costs for no reason.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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