Open code423n4 opened 2 years ago
Confirmed
The array wont be very large
My personal judgments:
Now, here is the methodology I used for calculating a score for each gas report. I first assigned each submission to be either small-optimization (1 point), medium-optimization (5 points) or large-optimization (10 points), depending on how useful the optimization is. The score of a gas report is the sum of these points, divided by the maximum number of points achieved by a gas report. This maximum number was 10 points, achieved by #67.
The number of points achieved by this report is 1 points. Thus the final score of this gas report is (1/10)*100 = 10.
[G1] Cache
shareholders
array.[G1 - Details]:
Caching arrays is a powerful way of lowering the gas fees. Since in a
for
loop accessing memory array’s indexes would consume more gas than accessing the same array’s cached indexes as the length of the array becomes larger and larger, it is crucial to do the caching wherever possible.[G1 - References]:
[G1 - Mitigation]:
Cache the array in a similar way: