Platform: Code4rena
Start Date: 24/02/2022
Pot Size: $75,000 USDC
Total HM: 21
Participants: 28
Period: 7 days
Judge: alcueca
Total Solo HM: 15
Id: 94
League: ETH
Rank: 19/28
Findings: 2
Award: $539.51
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: leastwood
Also found by: 0x1f8b, 0xliumin, 0xwags, CertoraInc, Dravee, IllIllI, Ruhum, TerrierLover, WatchPug, cmichel, csanuragjain, defsec, gzeon, hubble, jayjonah8, kenta, kirk-baird, rfa, robee
336.9655 USDC - $336.97
Note: This attack only works if initial amount set by seller is low
Recommendation: Instead of using block.timestamp + 2 days, use the date when signature was requested
require(nftContracts.length==tokenIds.length, "Incorrect Input");
require(account!=address(0), "Invalid address");
#0 - HardlyDifficult
2022-03-02T16:51:53Z
Thanks for the feedback, these are good suggestions.
auction.seller == originalAddress
before processing the request.#1 - alcueca
2022-03-17T09:41:05Z
Unadjusted score: 40
#2 - alcueca
2022-03-17T10:02:58Z
+5 points from #34
🌟 Selected for report: Dravee
Also found by: 0x1f8b, CertoraInc, TerrierLover, csanuragjain, gzeon, iain, kenta, rfa, robee, thankthedark
In buyFromPrivateSaleFor function at NFTMarketPrivateSale.sol#L180, _distributeFunds function is called and returned variable are stored in (uint256 f8nFee, uint256 creatorFee, uint256 ownerRev). However none of these variables are actually used. Recommendation would be to just call _distributeFunds function without storing any returned value from the function
In _getCreatorPaymentInfo function at NFTMarketCreators.sol#L49, observe that code at L90-L106 is similar to L153-L166. An ideal way would be to create a function of the recurring code and then call these functions without rewriting them multiple times
In _transferFromEscrow function at NFTMarketOffer.sol#L296, use memory instead of storage in below line:
Offer storage offer = nftContractToIdToOffer[nftContract][tokenId];
Offer storage offer = nftContractToIdToOffer[nftContract][tokenId];
#0 - HardlyDifficult
2022-03-01T11:52:21Z
Thanks for the feedback!
_getCreatorPaymentInfo
: This function is intense. We are discussing ways we might be able to simplify the whole thing. When we do this, we'll consider extracting some helpers to remove redundancies as well._transferFromEscrow
: Related to a recent change, we have removed this function from the NFTMarketOffer file so this no longer applies._cancelBuyersOffer
: We tested this and it actually seems to increase gas costs a bit. As a general best practice we are aiming to use storage
everywhere possible and limit memory
to when we need to cache the original value (e.g. if we are going to delete the struct and then emit the original values afterwards). storage
is often cheaper since it'll only read the slots that are needed for the logic executed while memory
will read all the storage slots used by that struct. This is more impactful in a class like our ReserveAuctions since that struct uses several slots.#1 - alcueca
2022-03-17T15:41:50Z
Score: 300