DeFiHardhatOracleProxyUpdates
100,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect cast parameter on event Weather::TemperatureChange, Weather::BeanToMaxLpGpPerBdvRatioChange, Weather::SeasonOfPlenty

Summary

The events define in the file Weather.sol, TemperatureChange, BeanToMaxLpGpPerBdvRatioChange and SeasonOfPlenty have the first parameter defines as season which is defined using the cast uint256. However, when this event are emitted, the variable s.season.current is used, which according to AppStorage.sol is a uint32 variable.

The emission of events is used on the following lines.

  • emit TemperatureChange(s.season.current, caseId, bT);

  • emit BeanToMaxLpGpPerBdvRatioChange(s.season.current, caseId, bL);

  • emit SeasonOfPlenty(s.season.current, sopWell, address(sopToken), amountOut, newHarvestable);

Impact

This type cast error won't cause functionally issue, it will be more gas efficient to cast season parameter as uint32

Recommendations

Change cast of season parameter from uint256 to uint32 on event TemperatureChange, BeanToMaxLpGpPerBdvRatioChange and SeasonOfPlenty

- event TemperatureChange(uint256 indexed season, uint256 caseId, int8 absChange);
+ event TemperatureChange(uint32 indexed season, uint256 caseId, int8 absChange);
-event BeanToMaxLpGpPerBdvRatioChange(uint256 indexed season, uint256 caseId, int80 absChange);
+event BeanToMaxLpGpPerBdvRatioChange(uint32 indexed season, uint256 caseId, int80 absChange);
-event SeasonOfPlenty(uint256 indexed season, address well, address token, uint256 amount, uint256 toField);
+event SeasonOfPlenty(uint32 indexed season, address well, address token, uint256 amount, uint256 toField);
Updates

Lead Judging Commences

giovannidisiena Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Informational/Invalid

Support

FAQs

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