calcDeltaPodDemand()
in LibEvaluate.sol
will revert if s.w.thisSowTime
is close to the maximum value. This is because in this statementL:
If s.w.lastSowTime
is very close to uint32 max value, then we try to add SOW_TIME_STEADY
and the function will revert.
In LibEvaluate.sol
we have calcDeltaPodDemand()
function:
This function calculates the change in demand for soil using a combination of previous and current season data.
We should pay attention to the following part of the function:
The logic within this segment of the calcDeltaPodDemand
assesses changes in the demand for soil based on how quickly it sold out.
thisSowTime
: Time it took for all soil to sell out this season.
lastSowTime
: Time it took for all soil to sell out last season.
The problem is in following part:
If s.w.lastSowTime
is very close to uint32 max value, then we try to add SOW_TIME_STEADY
and the function will revert.
In the case where s.w.lastSowTime
is close to the maximum value, the calcDeltaPodDemand()
function will not work.
This means that the gm()
function in SeasonFacet.sol
will also revert because this is the flow: gm()
-> calcCaseIdandUpdate()
-> evaluateBeanstalk()
-> getBeanstalkState()
-> calcDeltaPodDemand()
.
Visual Studio Code
Add a special case where lastSowTime
can be close to uint32.max
.
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.