Platform: Code4rena
Start Date: 14/04/2022
Pot Size: $75,000 USDC
Total HM: 8
Participants: 72
Period: 7 days
Judge: Jack the Pug
Total Solo HM: 2
Id: 110
League: ETH
Rank: 48/72
Findings: 2
Award: $143.56
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0x1f8b, 0xDjango, 0xkatana, AmitN, CertoraInc, Dravee, Funen, Hawkeye, Jujic, MaratCerby, Picodes, Ruhum, SolidityScan, TerrierLover, TomFrenchBlockchain, TrungOre, VAD37, Yiko, berndartmueller, cmichel, csanuragjain, danb, defsec, delfin454000, dipp, ellahi, fatherOfBlocks, georgypetrov, gs8nrv, gzeon, horsefacts, hubble, hyh, ilan, jah, joestakey, kebabsec, kenta, kyliek, m9800, minhquanym, oyc_109, p_crypt0, peritoflores, rayn, reassor, remora, rfa, robee, scaraven, securerodd, shenwilly, sorrynotsorry, tchkvsky, teryanarmen, z3s
91.3943 USDC - $91.39
ABIEncoderV2
is activated by default from version 0.8.0
:These can be deleted:
Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.
Lock the pragma version: use 0.8.12
instead of ^0.8.0
.
Open TODOs can point to architecture or programming issues that still need to be resolved.
./src/Funding.sol 15: * TODO: Better revert strings 61: // TODO: we should conform to some interface here 183: // TODO: Check gas costs. How does this relate to market buying if you do want to deposit to xCTDL? ./src/GlobalAccessControl.sol 106: /// TODO: Add string -> hash EnumerableSet to a new RoleRegistry contract for easy on-chain viewing. ./src/KnightingRound.sol 14: * TODO: Better revert strings
Consider resolving the TODO before deploying.
🌟 Selected for report: Dravee
Also found by: 0v3rf10w, 0x1f8b, 0xAsm0d3us, 0xBug, 0xDjango, 0xNazgul, 0xkatana, CertoraInc, Cityscape, Funen, Hawkeye, IllIllI, MaratCerby, SolidityScan, TerrierLover, TomFrenchBlockchain, Tomio, TrungOre, bae11, berndartmueller, csanuragjain, defsec, delfin454000, ellahi, fatherOfBlocks, gs8nrv, gzeon, horsefacts, ilan, jah, joestakey, joshie, kebabsec, kenta, nahnah, oyc_109, rayn, rfa, robee, saian, securerodd, simon135, slywaters, sorrynotsorry, tchkvsky, teryanarmen, z3s
52.1707 USDC - $52.17
calldata
instead of memory
:For external function's dynamic params, calldata is the cheapest location to use.
Change params memory
to calldata
Custom errors from Solidity 0.8.4 are cheaper than require
messages.
https://blog.soliditylang.org/2021/04/21/custom-errors/
++i
use less gas than i++
: