The stepSun
function within the Sun
contract is responsible for adjusting the Soil supply based on the output of an oracle (Oracle.stepOracle) and a weather calculation (Weather.calcCaseId).
See the following code:
The issue in the stepSun
function revolves around the condition for minting Soil (setSoilAbovePeg) based on the deltaB
parameter:
The comment and logic suggest that Soil should be minted when deltaB > 0 (indicating a surplus scenario). However, the comment incorrectly states that deltaB >= 0 should be used. This discrepancy can lead to confusion and incorrect minting decisions.
Depending on the actual implementation and the expected behavior during different conditions (deltaB > 0 vs deltaB <= 0), the logic might not accurately reflect the intended minting behavior of Soil. This can lead to unexpected changes in Soil supply, affecting the overall stability and functionality of the contract.
Incorrect minting decisions based on deltaB
can lead to inaccuracies in Soil supply, potentially disrupting the intended economic model of the Sun contract. If deltaB
conditions are not correctly handled, it could open up the contract to unintended scenarios where Soil is minted incorrectly, possibly impacting the financial integrity or stability of the application.
Manual Review
Ensure that the comments and the actual condition (deltaB > 0) align with the intended logic for minting Soil. Correct any discrepancies in the comments to accurately reflect the implemented logic.
Invalid as per docs https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.