Foundation Drop contest - wagmi'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: 22/108

Findings: 3

Award: $104.64

🌟 Selected for report: 0

🚀 Solo Findings: 0

Summary

IdTitle
1postRevealBaseURIHash is not used to validate baseURI
2Users can always bypass the limitPerAccount config
3Not subtract referrerFee in getFeesAndRecipients()

1. postRevealBaseURIHash is not used to validate baseURI

In documentation, postRevealBaseURIHash is supposed to be used to validate baseURI by making sure hash(baseURI) == postRevealBaseURIHash when admin reveal the baseURI

But in implementaion (function reveal()), this value is not used for that purpose and have no value for on-chain validation.

Affected Codes

2. Users can always bypass the limitPerAccount config

There is a config limitPerAccount in saleConfig. It is supposed to be used to confirm that the buyer will not exceed the limit specified after minting.

But this kind of limit in general can always be bypassed by users. It checks that current balance of users add count should be smaller or equal to limitPerAccount

if (IERC721(nftContract).balanceOf(msg.sender) + count > saleConfig.limitPerAccount) {

Users can transfer these ERC721 token to another wallet to modify value of balanceOf or they can simply use another wallet to bypass this check.

Affected Codes

3. Not subtract referrerFee in getFeesAndRecipients()

In function getFeesAndRecipients(), there is an open TODO that should be update to add referral info. Otherwise, these function will return values without referrerFee and can harm user experience.

Affected Codes

#0 - HardlyDifficult

2022-08-18T15:56:53Z

Good report! Although each of these were submitted by many wardens, they are all worth consideration and I agree with how they were prioritized by this warden.

postRevealBaseURIHash is not used to validate baseURI

Agree, we have decided to simplify this into true/false, for context see our comment here.

Can bypass limitPerAccount

Agree, for context see our comment here.

Unresolved TODO comments

Agree, will fix.

1. Use memory variable instead of storage in event to save gas

In function, if there are 2 variable with the same values, but 1 in memory and 1 in storage, we should use memory one when reading.

For example, this event line

emit CreateFixedPriceSale(nftContract, saleConfig.seller, saleConfig.price, saleConfig.limitPerAccount);

saleConfig is storage variable and these values can be replaced like saleConfig.seller = msg.sender to save gas

Affected Codes

#0 - HardlyDifficult

2022-08-19T15:03:13Z

  1. Use memory variable instead of storage in event to save gas

Agree, fixed!

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