Platform: Code4rena
Start Date: 14/06/2022
Pot Size: $50,000 USDC
Total HM: 19
Participants: 99
Period: 5 days
Judge: HardlyDifficult
Total Solo HM: 4
Id: 136
League: ETH
Rank: 66/99
Findings: 2
Award: $80.20
π Selected for report: 0
π Solo Findings: 0
π Selected for report: joestakey
Also found by: 0x1f8b, 0x29A, 0x52, 0xDjango, 0xNazgul, 0xNineDec, 0xf15ers, 0xkowloon, 0xmint, 8olidity, BowTiedWardens, Chom, Cityscape, Czar102, ElKu, FSchmoede, Funen, GimelSec, GreyArt, IllIllI, KIntern, Kaiziron, Kenshin, Lambda, MadWookie, MiloTruck, PPrieditis, Picodes, Ruhum, Sm4rty, StErMi, TerrierLover, TomJ, Treasure-Seeker, VAD37, WatchPug, Wayne, _Adam, a12jmx, abhinavmir, antonttc, apostle0x01, asutorufos, berndartmueller, cccz, cloudjunky, codexploder, cryptphi, csanuragjain, defsec, delfin454000, fatherOfBlocks, georgypetrov, hake, hansfriese, horsefacts, hyh, k, kenta, nxrblsrpr, oyc_109, peritoflores, rajatbeladiya, reassor, rfa, robee, sach1r0, saian, samruna, shenwilly, simon135, sorrynotsorry, sseefried, throttle, unforgiven, wagmi, zzzitron
48.9769 USDC - $48.98
When checking the executionValid
fails in the middle of the iteration it could interrupt the whole matchOrders
[InfinityExchange.sol L#272-288]https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityExchange.sol#:~:text=for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20numSells,weth
Manuel Review
#0 - nneverlander
2022-06-22T16:28:04Z
Intentional
#1 - HardlyDifficult
2022-07-12T01:03:54Z
matchOrders could revert, but then the matching engine could remove the bad order and try again. Lowering risk and converting into a QA report for the warden.
π Selected for report: IllIllI
Also found by: 0v3rf10w, 0x1f8b, 0x29A, 0xAsm0d3us, 0xDjango, 0xKitsune, 0xNazgul, 0xf15ers, 0xkatana, 0xkowloon, BowTiedWardens, Chom, ElKu, FSchmoede, Funen, GimelSec, Kaiziron, Kenshin, Lambda, MadWookie, MiloTruck, PPrieditis, Picodes, PwnedNoMore, StErMi, Tadashi, TerrierLover, TomJ, Tomio, Wayne, Waze, _Adam, antonttc, apostle0x01, asutorufos, c3phas, codexploder, defsec, delfin454000, fatherOfBlocks, hake, hansfriese, hyh, joestakey, k, kenta, oyc_109, peritoflores, reassor, rfa, robee, sach1r0, simon135, slywaters, zer0dot
31.2159 USDC - $31.22
G-1 Don't Initialize Variables with Default Value Explicitly initializing a variable with it's default value costs unnecesary gas.
Default variables like bool is defaulted as false when initialize. InfinityOrderBookComplication.sol L#42 [InfinityOrderBookComplication.sol L#108]https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityOrderBookComplication.sol#:~:text=_sumCurrentPrices(manyMakerOrders)%3B-,bool%20_isPriceValid%20%3D%20false%3B,-if%20(makerOrder.isSellOrder
Default unsigned integers is defaulted as 0. InfinityOrderBookComplication.sol L#197&199 InfinityOrderBookComplication.sol L#214&216 [InfinityOrderBookComplication.sol L#244,246,247]https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityOrderBookComplication.sol#:~:text=uint256%20numCollsMatched%20%3D,j%20%3C%20order1NftsLength%3B%20)
[InfinityOrderBookComplication.sol L#289-291]https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityOrderBookComplication.sol#:~:text=uint256%20numTokenIdsPerCollMatched%20%3D,l%20%3C%20item1TokensLength%3B%20)
[InfinityOrderBookComplication.sol L#318-320]https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityOrderBookComplication.sol#:~:text=uint256%20sum%20%3D,i%20%3C%20ordersLength%3B%20)%20%7B
G-2 Use != 0
instead of > 0
for Unsigned Integer Comparison
When dealing with unsigned integer types, comparisons with != 0
are cheaper then with > 0
.