Foundation Drop contest - 0x52'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: 8/108

Findings: 3

Award: $1,239.89

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

42.8343 USDC - $42.83

Labels

bug
duplicate
2 (Med Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-08-foundation/blob/792e00df429b0df9ee5d909a0a5a6e72bd07cf79/contracts/mixins/nftDropMarket/NFTDropMarketFixedPriceSale.sol#L170-L219

Vulnerability details

Impact

User can bypass mint limit

Proof of Concept

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

L183 only checks the current balance of msg.sender, not the actual number of nfts that they have minted. This allows the user to mint, send the nfts to another address then mint more.

Tools Used

Add a mapping that stores the number of nfts a user has minted from a specific contract and update it when a user mints:

mapping(address => mapping(address => uint256)) mintCount;

#0 - HardlyDifficult

2022-08-17T20:58:30Z

Findings Information

🌟 Selected for report: Lambda

Also found by: 0x52, KIntern_NA

Labels

bug
duplicate
2 (Med Risk)

Awards

1155.7971 USDC - $1,155.80

External Links

Lines of code

https://github.com/code-423n4/2022-08-foundation/blob/792e00df429b0df9ee5d909a0a5a6e72bd07cf79/contracts/mixins/shared/MarketFees.sol#L482-L492

Vulnerability details

Impact

Other royalty recipients don't receive their share

Proof of Concept

First royalty recipient can cheat other out of their share by setting their royalty >100%. Because of the short circuit in L485 the first creator will be sent all royalties if any of the recipients are >100%.

Tools Used

Instead of breaking the entire loop, creatorShares should be set to 0 for recipients with royalty > 10000

#0 - HardlyDifficult

2022-08-17T07:34:34Z

Lines of code

https://github.com/code-423n4/2022-08-foundation/blob/792e00df429b0df9ee5d909a0a5a6e72bd07cf79/contracts/mixins/shared/MarketFees.sol#L231-L271 https://github.com/code-423n4/2022-08-foundation/blob/792e00df429b0df9ee5d909a0a5a6e72bd07cf79/contracts/mixins/shared/MarketFees.sol#L279-L332

Vulnerability details

Impact

Fees do not match fees specified by contract owner

Proof of Concept

try IRoyaltyInfo(nftContract).royaltyInfo{ gas: READ_ONLY_GAS_LIMIT }(tokenId, BASIS_POINTS) returns ( address receiver, uint256 /* royaltyAmount */

MarketFees.sol is designed to support any generic contract that adheres to certain interfaces. One of those interfaces is EIP-2981, however, MarketFees.sol is not fully compliant because it fails to take the proper amount of royalties. EIP-2981 specifically supports the ability for variable fees. When referencing this, MarketFees.sol disregards the amount and sends a standard fee.

Tools Used

When using EIP-2981 compliant methods, the amount of the royalty should be passed out rather than the split.

#0 - HardlyDifficult

2022-08-17T07:15:31Z

#1 - HickupHH3

2022-08-26T04:51:09Z

Warden's primary QA

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