code-423n4 / 2022-06-infinity-findings

4 stars 0 forks source link

QA Report #234

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

1.

Contract

InfinityExchange.sol

having uint256 i = 0; in for loops are unnecesarry in

line148 
line200
line219
line272
line308
line349
line393
line1048
line1086
line1109
line1190
line1206

Recommedation:

Set uint256 i = 0; in for loops to uint256 i;

Result:

for (uint256 i; i < numMakerOrders; )
for (uint256 i; i < ordersLength; )
for (uint256 i; i < ordersLength; )
for (uint256 i; i < numSells; )
for (uint256 i; i < numMakerOrders; )
for (uint256 i; i < ordersLength; )
for (uint256 i; i < numNonces; )
for (uint256 i; i < numNfts; )
for (uint256 i; i < numTokens; )
for (uint256 i; i < numNfts; )
for (uint256 i; i < numNfts; )
for (uint256 i; i < numTokens; )

2.

Contract

InfinityOrderBookComplication.sol

having uint256 i = 0; in for loops are unneccesarry in

line76
line82 (j not i)
line199
line216
line246
line247 (j not i)
line290 (k not i)
line291 (l not i)
line320

Recommendation:

Set uint256 i = 0; in for loops to uint i; with the exceptions of j, k, and l where innitiated

Result:

for (uint256 i; i < ordersLength; )
for (uint256 j; j < nftsLength; )
for (uint256 i; i < nftsLength; )
for (uint256 i; i < nftsLength; )
for (uint256 i; i < order2NftsLength; )
for (uint256 j; j < order1NftsLength; )
for (uint256 k; k < item2TokensLength; )
for (uint256 l; l < item1TokensLength; )
for (uint256 i; i < ordersLength; )