Platform: Code4rena
Start Date: 05/05/2022
Pot Size: $125,000 DAI
Total HM: 17
Participants: 62
Period: 14 days
Judge: leastwood
Total Solo HM: 15
Id: 120
League: ETH
Rank: 40/62
Findings: 2
Award: $267.81
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x4non, 0xDjango, 0xNazgul, 0xkatana, 0xsomeone, AuditsAreUS, BouSalman, BowTiedWardens, Cityscape, Funen, GimelSec, Hawkeye, JC, MaratCerby, MiloTruck, Picodes, Ruhum, TerrierLover, WatchPug, Waze, bobirichman, catchup, cccz, cryptphi, csanuragjain, delfin454000, ellahi, fatherOfBlocks, hake, horsefacts, hyh, jayjonah8, joestakey, kebabsec, kenta, mics, oyc_109, robee, samruna, shenwilly, sikorico, simon135, throttle, tintin
178.3839 DAI - $178.38
#1
use mapping multiple address inside struct.
#2
typo from underlying to underying.
#3
add string error message in revert.
#0 - 0xleastwood
2022-06-11T16:31:26Z
1 and 3 are not exactly helpful. There are reasons for both, but the 2nd point is a helpful typo.
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0x1f8b, 0x4non, 0xDjango, 0xNazgul, 0xf15ers, 0xkatana, 0xsomeone, AlleyCat, BowTiedWardens, Cityscape, Fitraldys, Funen, GimelSec, Hawkeye, JC, MaratCerby, MiloTruck, Randyyy, TerrierLover, Tomio, UnusualTurtle, WatchPug, Waze, _Adam, augustg, bobirichman, catchup, csanuragjain, ellahi, fatherOfBlocks, hake, hansfriese, horsefacts, ignacio, joestakey, kenta, mics, oyc_109, robee, samruna, sashik_eth, sikorico, simon135, throttle
89.4325 DAI - $89.43
Handling Error Reduce the size of error messages (Long require/revert Strings) Shortening require/revert error message strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the error condition is met.
!= 0 costs less gas compared to > 0 for unsigned integers in require statements with the optimizer enabled (6 gas). I suggest changing > 0 with != 0 like:
_checkArgument(amount != 0); Line 889: AlchemistV2.sol
use uint256 i instead of uint256 = 0, default value of uint is 0. its more efficient. ++i costs less gas compared to i++ or i += 1 for unsigned integer, as pre-increment is cheaper (about 5 gas per iteration). This statement is true even with the optimizer enabled. i++ increments i and returns the initial value of i. I suggest using ++i instead of i++ to increment the value of an uint variable.
from this code uint256 minimumAmountOut = amountUnderlying - amountUnderlying * 100 / 10000; you can change with this uint256 minimumAmountOut = amountUnderlying - amountUnderlying /100;
default value of uint is 0, so i suggest you to use uint256 want; instead of uint256 want =0; and it applies to other opcode uint256 want = 0;