TempleGold

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

The `TempleGold::mint` function uses `storage` keyword to read from storage without causing any changes to the state variable which will cost more gas than necessary

Summary

TempleGold::mint function uses storage instead of memory which will cost more gas than necessary

Vulnerability Details

The TempleGold::mint function uses the storage keyword to read data from the blockchain

DistributionParams storage distributionParamsCache = distributionParams;

and did not cause any changes to the state variable either within that function or in the subsequent function calls with the mint function.

Impact

Because the TempleGold::mint function uses the storage keyword to read data from the blockchain without causing any changes to the state variable within that function, it attracts unnecessary gas. It would be cheaper to use the memory keyword in this scenaro since the function is not causing any state changes to the distributionParams variable.

Tools Used

Manual review

Recommendations

The section of TempleGold::mint function that reads the distributionParams variable from the blockchain can be rearranged as follows

function mint() external override onlyArbitrum {
VestingFactor memory vestingFactorCache = vestingFactor;
- DistributionParams storage distributionParamsCache = distributionParams;
+ DistributionParams memory distributionParamsCache = distributionParams;
Updates

Lead Judging Commences

inallhonesty Lead Judge 12 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.