Foundation Drop contest - zeesaw's results

Foundation is a web3 destination.

General Information

Platform: Code4rena

Start Date: 11/08/2022

Pot Size: $40,000 USDC

Total HM: 8

Participants: 108

Period: 4 days

Judge: hickuphh3

Total Solo HM: 2

Id: 152

League: ETH

Foundation

Findings Distribution

Researcher Performance

Rank: 38/108

Findings: 3

Award: $74.97

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)

Awards

13.1705 USDC - $13.17

External Links

Lines of code

https://github.com/code-423n4/2022-08-foundation/blob/main/contracts/NFTDropCollection.sol#L182

Vulnerability details

Impact

If receivers don't implement onERC721Received, they will not transfer asset to others.

Proof of Concept

https://github.com/code-423n4/2022-08-foundation/blob/main/contracts/NFTDropCollection.sol#L182

Tools Used

manually reviewed

can use _safeMint from OZ

#0 - HardlyDifficult

2022-08-18T12:18:25Z

Non-critical

  1. TODO tag is still in the code
TODO add referral info
  1. missing MaxTokenIdUpdated event in _initializeSequentialMintCollection
  2. redundant code Some unneccessary import that can be removed since MarketFees is already inherited from FoundationTreasuryNode, MarketSharedCore, SendValueWithFallbackWithdraw. So there's no need to directly import from these contracts again.
  1. unused variable
) external returns (address collection) {

#0 - HardlyDifficult

2022-08-18T21:02:29Z

Unresolved TODO comments

Agree, will fix.

Missing event

This information is available from the factory event already.

Redundant code

I like the top-level contracts to fully expand all inheritance. This makes it clear what the dependencies are and the linearization order they are included in.

Use named returns consistently

Agree, we have opted to use the named returns instead of return ... This is more consistent with other code in our repo and saves a bit of on the contract size. We also like named returns as a way of improving natspec, and typechain (particularly when a tuple is returned).

Gas optimization

  1. long error message costs more gas
require(bytes(tokenCID).length != 0, "NFTCollection: tokenCID is required");
  1. versionNFTCollection++ costs more gas than ++versionNFTCollection

#0 - HardlyDifficult

2022-08-17T14:49:03Z

long error message costs more gas

Agree but won't fix. We use up to 64 bytes, aiming to respect the incremental cost but 32 bytes is a bit too short to provide descriptive error messages for our users.

versionNFTCollection++ costs more gas than ++versionNFTCollection

Agree, will fix.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter