code-423n4 / 2021-05-nftx-findings

1 stars 0 forks source link

accessing storage in a loop #36

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

paulius.eth

Vulnerability details

Impact

accessing storage in a loop, for example, _feeReceivers length can be extracted into a variable and used where necessary to reduce the number of storage reads.

Recommended Mitigation Steps

change this: for (uint256 i = 0; i < _feeReceivers.length; i++) { to this: uint256 feeReceiversLength = _feeReceivers.length; for (uint256 i = 0; i < feeReceiversLength; i++) {

0xKiwi commented 3 years ago

Its already being read from memory

cemozerr commented 3 years ago

Marking this as an invalid issue.