Platform: Code4rena
Start Date: 29/06/2022
Pot Size: $50,000 USDC
Total HM: 20
Participants: 133
Period: 5 days
Judge: hickuphh3
Total Solo HM: 1
Id: 142
League: ETH
Rank: 104/133
Findings: 1
Award: $21.59
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: GalloDaSballo
Also found by: 0v3rf10w, 0x1f8b, 0xA5DF, 0xDjango, 0xHarry, 0xKitsune, 0xNazgul, 0xNineDec, 0xc0ffEE, 0xf15ers, 0xkatana, 0xsanson, ACai, Aymen0909, Bnke0x0, BowTiedWardens, Chom, ElKu, Fitraldys, Funen, Haruxe, Hawkeye, IllIllI, JC, JohnSmith, Kaiziron, Kenshin, Lambda, Limbooo, MadWookie, Metatron, MiloTruck, Picodes, PwnedNoMore, Randyyy, RedOneN, ReyAdmirado, Ruhum, Sm4rty, StErMi, StyxRave, TerrierLover, TomJ, Tomio, UnusualTurtle, Waze, Yiko, _Adam, __141345__, ajtra, ak1, apostle0x01, asutorufos, c3phas, cRat1st0s, catchup, codetilda, cryptphi, datapunk, defsec, delfin454000, durianSausage, exd0tpy, fatherOfBlocks, gogo, grrwahrr, hake, hansfriese, horsefacts, ignacio, jayfromthe13th, joestakey, ladboy233, m_Rassska, mektigboy, minhquanym, mrpathfindr, natzuu, oyc_109, rajatbeladiya, reassor, rfa, robee, rokinot, sach1r0, saian, sashik_eth, simon135, slywaters, swit, z3s, zeesaw, zer0dot
21.5856 USDC - $21.59
[G-01] - Use custom errors rather than revert()/require() strings Custom errors are ABI encoded. Consequently, they can be decoded using ABI decoders. This makes it more gas efficient than « revert string ».
File : puttyV2.sol - puttyV2.sol:214 puttyV2.sol:241 puttyV2.sol:278 puttyV2.sol:281 puttyV2.sol:284 puttyV2.sol:287 puttyV2.sol:290 puttyV2.sol:293 puttyV2.sol:297 puttyV2.sol:298 puttyV2.sol:329 puttyV2.sol:353 puttyV2.sol:395 puttyV2.sol:398 puttyV2.sol:401 puttyV2.sol:430 puttyV2.sol:470 puttyV2.sol:475 puttyV2.sol:481 puttyV2.sol:551 puttyV2.sol:552 puttyV2.sol:598 puttyV2.sol:599 puttyV2.sol:765
File: puttyV2Nft.sol - puttyV2Nft.sol:12 puttyV2Nft.sol:13 puttyV2Nft.sol:26 puttyV2Nft.sol:27 puttyV2Nft.sol:28 puttyV2Nft.sol:41
[G-02] - Duplicated Require()/Revert() checks should be refactored to a modifier or function This would reduce the deployment costs.
File: puttyV2.sol -
[G-03] - Expressions for constant values such as a call to KECCAK256() should use immutable rather than constant A constant declared as KECCAK256() is re-calculated each time it is in use.
File: puttyV2.sol - puttyV2.sol:89 puttyV2.sol:95 puttyV2.sol:101
[G04] - Using >0 costs more gas than != 0 when used on a uint in a require() statement.
File: puttyV2.sol - puttyV2.sol:598 puttyV2.sol:599 puttyV2.sol:611
[G05] - It costs more gas to initialize variables to zero than to let the default of zero be applied.
File: puttyV2.sol - puttyV2.sol:556 puttyV2.sol:594 puttyV2.sol:611 puttyV2.sol:624 puttyV2.sol:637 puttyV2.sol:647 puttyV2.sol:658 puttyV2.sol:670 puttyV2.sol:728 puttyV2.sol:742
[G06] - Pre-increments (++i) cost less gas than post-increment (i++), especially inside for loops.
File: puttyV2.sol - puttyV2.sol:556 puttyV2.sol:594 puttyV2.sol:611 puttyV2.sol:624 puttyV2.sol:637 puttyV2.sol:647 puttyV2.sol:658 puttyV2.sol:670 puttyV2.sol:728 puttyV2.sol:742
[G07] ++i should be unchecked{++I} when it is not possible for them to overflow (ie. In a for loop).
File: puttyV2.sol - puttyV2.sol:556 puttyV2.sol:594 puttyV2.sol:624 puttyV2.sol:637 puttyV2.sol:647 puttyV2.sol:658 puttyV2.sol:670 puttyV2.sol:728 puttyV2.sol:742
[G08] Using private rather than public for constants saves gas.
File: puttyV2.sol - puttyV2.sol:89 puttyV2.sol:95 puttyV2.sol:101
[G09] External functions are less expensive than public All the functions (except those related to « transfer ») are set to public. Consider turning those that are only called outside the contract as « external » to save gas.