Nibbl contest - ych18's results

NFT fractionalization protocol with guaranteed liquidity and price based buyout.

General Information

Platform: Code4rena

Start Date: 21/06/2022

Pot Size: $30,000 USDC

Total HM: 12

Participants: 96

Period: 3 days

Judge: HardlyDifficult

Total Solo HM: 5

Id: 140

League: ETH

Nibbl

Findings Distribution

Researcher Performance

Rank: 9/96

Findings: 3

Award: $1,098.21

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: PwnedNoMore

Also found by: ych18

Labels

bug
duplicate
2 (Med Risk)
sponsor acknowledged

Awards

1052.705 USDC - $1,052.70

External Links

Lines of code

https://github.com/code-423n4/2022-06-nibbl/blob/main/contracts/NibblVault.sol#L183

Vulnerability details

(msg.value * SCALE * 1e18) / (_initialTokenSupply * _initialTokenPrice) is likely to be more than max(uint32), and therefore _secondaryReserveRatio can be overflowed due to the unsafe downcast to uint32. For example, for:

  • _initialTokenSupply = 1e20.
  • _initialTokenPrice = 1e14. The overflow can happen with every msg.value >= 1 ether. Hence, uint32 cannot be sufficient to hold _secondaryReserveRatio

Recommendation: use a uint64 for _secondaryReserveRatio

#0 - HardlyDifficult

2022-07-04T14:26:34Z

Basket.sol

  • Wrong comment in line 58, it should be ERC1155 instead of ERC721 #NibblVault.sol
  • Consider adding an event for the initialize(), updateCurator().

MISC

  • Most of the comments in all the contracts assume that the ERC1155 token can be only NFT. This is not true because a tokenID of ERC1155 can be a fungible token.

  • unchecked pattern can be used in L319 and L378 of NibblVault.
  • notBoughtOut modifier is double checked in buy() and sell() function when status == Status.buyout ( one the function and the other one in the function _rejectBuyout()
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