The ReseedField
has an error in its init
function in the sense that the inner loop of a nested loop structure incorrectly increments the outer loop's iterator, leading to an infinite loop and incomplete processing of account plots.
In the init
function of the ReseedField
contract, there is a nested loop structure intended to iterate over all plots for all accounts. Albeit, the inner loop incorrectly increments the outer loop's iterator i
instead of its own iterator j
:
This will cause the inner loop to never terminate properly, and the outer loop to skip most of the accountPlots
entries. As a result, only the plots from the first account will be processed before the function likely runs out of gas due to the infinite inner loop.
Firstly, Only the first account's plots will be processed, leaving all other accounts' data uninitialized. Also, the calculatedTotalPods
will not reflect the true sum of all pod amounts across all accounts. init
function will likely run out of gas due to the infinite loop, causing the entire initialization process to fail.
Likelihood is high and Impact is high, hence the reason this was marked as HIGH
.
Manual code review
Modify the inner loop to increment the correct iterator:
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.