Platform: Code4rena
Start Date: 21/06/2022
Pot Size: $50,000 USDC
Total HM: 31
Participants: 99
Period: 5 days
Judges: moose-code, JasoonS, denhampreen
Total Solo HM: 17
Id: 139
League: ETH
Rank: 68/99
Findings: 2
Award: $79.71
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1337, 0x1f8b, 0x29A, 0x52, 0xDjango, 0xNazgul, 0xNineDec, 0xc0ffEE, 0xf15ers, 0xmint, Bnke0x0, BowTiedWardens, Chom, ElKu, FudgyDRS, Funen, GalloDaSballo, GimelSec, JC, Kaiziron, Lambda, Limbooo, Metatron, MiloTruck, Noah3o6, Picodes, PumpkingWok, PwnedNoMore, Sm4rty, StErMi, TomJ, TrungOre, UnusualTurtle, Waze, _Adam, aga7hokakological, ak1, antonttc, berndartmueller, cccz, cryptphi, csanuragjain, defsec, delfin454000, dipp, elprofesor, exd0tpy, fatherOfBlocks, hake, hansfriese, hubble, joestakey, kenta, ladboy233, mics, oyc_109, pashov, pedr02b2, reassor, robee, samruna, scaraven, shung, sikorico, simon135, sseefried, tchkvsky, unforgiven, zzzitron
53.1414 USDC - $53.14
Timelock modifier is commonly used for storage variable setters that effects the contract logic. Consider adding timelocks on such setters.
https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L157 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L167 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L217 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L226 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L235
🌟 Selected for report: BowTiedWardens
Also found by: 0v3rf10w, 0x1f8b, 0x29A, 0xKitsune, 0xNazgul, 0xf15ers, 0xkatana, 0xmint, 8olidity, ACai, Bnke0x0, Chom, ElKu, Fabble, Fitraldys, FudgyDRS, Funen, GalloDaSballo, GimelSec, IllIllI, JC, Kaiziron, Lambda, Limbooo, MiloTruck, Noah3o6, Nyamcil, Picodes, PwnedNoMore, Randyyy, RedOneN, Sm4rty, StErMi, TomJ, Tomio, TrungOre, UnusualTurtle, Waze, _Adam, aga7hokakological, ajtra, antonttc, asutorufos, bardamu, c3phas, defsec, delfin454000, exd0tpy, fatherOfBlocks, hansfriese, ignacio, joestakey, kenta, ladboy233, m_Rassska, mics, minhquanym, oyc_109, pashov, reassor, robee, s3cunda, sach1r0, saian, sashik_eth, scaraven, sikorico, simon135, slywaters
26.5729 USDC - $26.57
Using != 0 is slightly cheaper than > 0. We recommend to replace > with != in the following places:
https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L535 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L572 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L604
You can change the order of the storage variables to decrease memory uses. This is because the new suggested new orders will use less storage slots.
https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/LiquidityReserveStorage.sol:
old number of slots: 7 new number of slots: 6 the new order of types is 1. uint256 2. uint256 3. uint256 4. address 5. bool 6. address 7. address https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/YieldyStorage.sol: old number of slots: 12 new number of slots: 11 the new order of types is 1. ArrayTypeName - Rebase 2. uint256 3. bytes32 4. bytes32 5. bytes32 6. uint256 7. uint256 8. uint256 9. uint256 10. uint256 11. address 12. uint8