Closed sherlock-admin4 closed 1 month ago
Happy Green Chimpanzee
Low/Info
it is better to cache the length of list rather then loading it from the variable
in a lot of area where for loop is used , it is going to use like this array.length , it costs a alot more gas than expected
cause a lot more gas
for (uint i; i < _createListings.length; ++i) {
for (uint i; i < _modifyListings.length; ++i) {
Manual Review
uint len = _createListings.length;
- for (uint i; i < _createListings.length; ++i) + for (uint i; i < len; ++i)
Happy Green Chimpanzee
Low/Info
cache the length of loop to save gas
Summary
it is better to cache the length of list rather then loading it from the variable
Vulnerability Detail
in a lot of area where for loop is used , it is going to use like this array.length , it costs a alot more gas than expected
Impact
cause a lot more gas
Code Snippet
Tool used
Manual Review
Recommendation
uint len = _createListings.length;