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: 57/72
Findings: 1
Award: $91.39
š 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
All upgradeable contracts of the repo should implement a void constructor to call the initialized
flag to true in the implementation.
Citing other audit reports: "As perĀ OpenZeppelinās (OZ) recommendation, āThe guidelines are now to make it impossible forĀ anyoneĀ to runĀ initializeĀ on an implementation contract, by adding an empty constructor with theĀ initializerĀ modifier. So the implementation contract gets initialized automatically upon deployment.ā Furthermore,Ā this thwarts any attempts to frontrun theĀ initialization tx of the implementation contract. Incorporating this change would require inheriting theĀ InitializableĀ contract instead of having an explicitĀ initializedĀ variable."
Implementation contracts should inherit OZāsĀ InitializableĀ contract and have the following constructor method:
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract A is Initializable ... { ... /// @custom:oz-upgrades-unsafe-allow constructor constructor() initializer { // so that users won't accidentally send JPYC to the implementation contract blocklisted[address(this)] = true; } }
Variable transferFromDisabled
is not used in the code and should be removed from the contract.
For integration purposes and UX experience, team should consider implementing https://eips.ethereum.org/EIPS/eip-2612 for its ERC-20 token, especially CitadelToken