Platform: Code4rena
Start Date: 13/11/2023
Pot Size: $24,500 USDC
Total HM: 3
Participants: 120
Period: 4 days
Judge: 0xTheC0der
Id: 306
League: ETH
Rank: 83/120
Findings: 1
Award: $4.08
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: chaduke
Also found by: 0xpiken, Bauchibred, Matin, MohammedRizwan, MrPotatoMagic, OMEN, Pheonix, SandNallani, T1MOH, Topmark, ZanyBonzy, adriro, aslanbek, ayden, bareli, bart1e, bin2chen, btk, cheatc0d3, codynhat, critical-or-high, d3e4, erebus, firmanregar, hunter_w3b, jasonxiale, kaveyjoe, ksk2345, lsaudit, max10afternoon, merlinboii, nailkhalimov, osmanozdemir1, peanuts, pep7siup, pontifex, sbaudh6, shenwilly, sl1, tourist, wisdomn_, young, zhaojie
4.0797 USDC - $4.08
Market
contractThe Market.sol
contract has a struct which tracks all the information related to the shares. One of which is the bonding curve. However, there's a redundant state variable shareBondingCurves
which is not used anywhere in the contract.
/// @notice Stores the bonding curve per share mapping(uint256 => address) public shareBondingCurves;
It is recommended to delete any unused or redundant state variables.
In the market contract the following fees are declared as constants with no way for the owner to modify them in future. Hence, the contract would need to be redeployed, if a change in the fee structure is required.
uint256 public constant NFT_FEE_BPS = 1_000; // 10% uint256 public constant HOLDER_CUT_BPS = 3_300; // 33% uint256 public constant CREATOR_CUT_BPS = 3_300; // 33%
Consider creating access controlled setter functions that can only be called by the owner, to be able to modify the fee variables.
Market::getNFTMintingPrice()
functionThis Natspec title for this function incorrectly suggests that it returns the price and fees. However, the function only calculates the fees and returns it.
In addition, the return param fee
is not listed and explained in the Natspec.
Consider correcting the Natspec, as this provides clarity on the intention and business logic of the function.
Market:claimHolderFee()
functionThere are no restrictions on who can call this function for which shares. For example, the function should revert when non token holders attempt to claim fees for non-existent tokens.
Consider adding some checks in place to ensure reverts for non token holders or non existent shares.
Market:getBuyPrice()
functionConsider making the following changes for better code quality:
price
and fee
aren't explained in NatSpec.
-The function should revert if the _amount
tokens is greater than available total suply of share tokens.Market:getSellPrice()
functionConsider making the following changes for better code quality:
_amount
tokens is greater than available total suply of share tokens.price
and fee
aren't explained in NatSpec.#0 - c4-judge
2023-11-29T23:13:29Z
MarioPoneder marked the issue as grade-b