TempleGold

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

same constant literal value is used multiple times

Summary

Vulnerability Details If the same constant literal value is used multiple times, create a constant state variable and reference it throughout the contract.

Impact 7 Found Instances

  • Found in contracts/templegold/TempleGoldStaking.sol Line: 473

    if (vestingRate == 1e18) {
  • Found in contracts/templegold/TempleGoldStaking.sol Line: 476

    _perTokenReward = _rewardPerToken() * vestingRate / 1e18;
  • Found in contracts/templegold/TempleGoldStaking.sol Line: 480

    (_stakeInfo.amount * (_perTokenReward - userRewardPerTokenPaid[_account][_index])) / 1e18 +
  • Found in contracts/templegold/TempleGoldStaking.sol Line: 489

    vestingRate = 1e18;
  • Found in contracts/templegold/TempleGoldStaking.sol Line: 491

    vestingRate = (block.timestamp - _stakeInfo.stakeTime) * 1e18 / vestingPeriod;
  • Found in contracts/templegold/TempleGoldStaking.sol Line: 511

    rewardData.rewardRate * 1e18)
  • Found in contracts/templegold/TempleGoldStaking.sol Line: 598

    userRewardPerTokenPaid[_account][_index] = vestingRate * uint256(rewardData.rewardPerTokenStored) / 1e18;

Tools Used formal verification

Recommendations insted of hard coding the same value muliable times just make constent value and reuse it following the dry consept dont reped your self

uint256 private constant MyConstentValue = 1e18;
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.