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: 87/99
Findings: 1
Award: $26.71
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 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.7051 USDC - $26.71
Using requier instead of && can save gas.
require( _oldContract != address(0)); require ( _newContract != address(0), "Invalid address");
!=0 is cheaper operation compared to >0, when dealing with uint.
Custom errors from solidity 0.8.4 are cheaper than revert strings.
https://github.com/code-423n4/2022-06-yieldy/blob/feaaf2a484bc09c8a1590ccbddf88f76ff89d678/src/contracts/Yieldy.sol#L190 https://github.com/code-423n4/2022-06-yieldy/blob/feaaf2a484bc09c8a1590ccbddf88f76ff89d678/src/contracts/Yieldy.sol#L96 https://github.com/code-423n4/2022-06-yieldy/blob/feaaf2a484bc09c8a1590ccbddf88f76ff89d678/src/contracts/Yieldy.sol#L83 https://github.com/code-423n4/2022-06-yieldy/blob/feaaf2a484bc09c8a1590ccbddf88f76ff89d678/src/contracts/Yieldy.sol#L210 https://github.com/code-423n4/2022-06-yieldy/blob/feaaf2a484bc09c8a1590ccbddf88f76ff89d678/src/contracts/Yieldy.sol#L249