Inside calculateNewEmissionRate() there is no explicit check in either of if
branches for utilizationRate == utilizationTarget
. This leads to incorrect emissionRate
under certain conditions:
Imagine:
utilizationTarget = 70%
and emissionRate = 1000
. Also, adjustmentFactor = 5%
.
utilizationRate
goes above 70%
.
increasedRate = 1000 + 5% of 1000 = 1050
. This is the value returned from the function and stored in the global variable emissionRate
inside updateEmissionRate()
.
After some time, utilizationRate
equals 70%
.
The function returns the same old emissionRate = 1050
. <---- 1️⃣
After some time, utilizationRate
goes below 70%
.
decreasedRate = 1050 - 5% of 1050 = ~ 998
. This is returned and stored as emissionRate
.
After some time, utilizationRate
equals 70%
.
The function returns the same old emissionRate = 998
. <---- 2️⃣
Even after hitting the utilizationTarget
, there is no change made in either cases. The equality condition has to be included in either if
branch or the else
branch.
Incorrect emissionRate
leads to incorrect rewards being distributed.
Include the equality condition in either if
branch or the else
branch, for e.g.:
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.