Platform: Code4rena
Start Date: 03/05/2022
Pot Size: $50,000 USDC
Total HM: 4
Participants: 46
Period: 5 days
Judge: gzeon
Total Solo HM: 2
Id: 117
League: ETH
Rank: 27/46
Findings: 2
Award: $141.14
π Selected for report: 0
π Solo Findings: 0
π Selected for report: BowTiedWardens
Also found by: 0x1337, 0x1f8b, 0x4non, 0xDjango, David_, Funen, GimelSec, IllIllI, Picodes, TerrierLover, WatchPug, bobi, cryptphi, csanuragjain, delfin454000, dirk_y, ellahi, fatherOfBlocks, hyh, ilan, jayjonah8, kebabsec, leastwood, oyc_109, robee, samruna, simon135, sorrynotsorry, throttle
93.5794 USDC - $93.58
Low
override
identifier can make compiler erorThis means if you inherit the ERC1155Enumerable.sol contract into Cnft.sol, you can write your own function and mark it as override since itβs overriding the base totalsupply() & tokensByAccounts() function. If you forget to add the override the compiler will said
TypeError: Overriding function is missing "override" specifier.
and this could be into error to compile the contract
##Tool Used Remix, Manual Review
##Recommended Mitigation
add override
π Selected for report: BowTiedWardens
Also found by: 0v3rf10w, 0x1f8b, 0x4non, 0xDjango, 0xNazgul, 0xkatana, Cityscape, Fitraldys, Funen, GimelSec, IllIllI, MaratCerby, Picodes, TerrierLover, Tomio, delfin454000, ellahi, fatherOfBlocks, hansfriese, ilan, joestakey, oyc_109, rfa, robee, samruna, simon135, slywaters, throttle
47.5594 USDC - $47.56
= 0
If a variable was not set/initialized, it is assumed to have default value to 0
this implementation was used for saving more gas by removing = 0
##TOOLS USED Remix, Manual Review
##Mitigation Step
Remove = 0
##Occurances 1. CNft.sol#L49 2. CNft.sol#L97 3. CNft.sol#L119 4. CNft.sol#L175 5. UniswapV2PriceOracle.sol#L41 6. CEther.sol#L178
Every reason string takes at least 32 bytes. Use short reason strings that fits in 32 bytes or it will become more expensive.
##Tool Used Manual Review
##Occurances 1. CNft.sol#L24 2. CNft.sol#L25 3. CNft.sol#L52 4. CNft.sol#L100 5. CNft.sol#L124 6. CNft.sol#L148 7. CNft.sol#L208 8. CNft.sol#L209 9. /CNft.sol#L279
uint256 i = 0
into uint256 i
for saving more gasusing this implementation can saving more gas for each loops.
##Tool Used Manual Review & Remix
##Recommended Mitigation Change it
since this SafeTransferFrom() function was unused it can be deleted instead for saving more gas cause of recommendation of used safeBatchTransferFrom instead
##Tool Used Manual Review, Remix