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: 60/62
Findings: 1
Award: $89.21
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 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.2136 DAI - $89.21
Custom error from solidity 0.8.4 are cheaper than revert strings, custom error are defined using the error
statement can use insideand outside the contract.
Custom errors are defined using the error statement, which can be used inside and outside of contracts
source https://blog.soliditylang.org/2021/04/21/custom-errors/
i suggestreplacing revert error strings with custom error
POC:
https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/gALCX.sol#L33 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/gALCX.sol#L107 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/StakingPools.sol#L106 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/StakingPools.sol#L114 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/StakingPools.sol#L124 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/StakingPools.sol#L160 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/StakingPools.sol#L183