Platform: Code4rena
Start Date: 21/06/2022
Pot Size: $55,000 USDC
Total HM: 29
Participants: 88
Period: 5 days
Judge: gzeon
Total Solo HM: 7
Id: 134
League: ETH
Rank: 81/88
Findings: 1
Award: $62.46
π Selected for report: 0
π Solo Findings: 0
π Selected for report: BowTiedWardens
Also found by: 0v3rf10w, 0x1f8b, 0x29A, 0xKitsune, 0xNazgul, 0xf15ers, 0xkatana, 0xkowloon, Bnke0x0, ElKu, Fitraldys, Funen, GalloDaSballo, IllIllI, JC, Kaiziron, Lambda, MadWookie, Noah3o6, Nyamcil, RoiEvenHaim, TomJ, Tomio, UnusualTurtle, Waze, _Adam, ajtra, asutorufos, bardamu, c3phas, catchup, datapunk, defsec, delfin454000, fatherOfBlocks, grGred, hake, hansfriese, hyh, ignacio, joestakey, kebabsec, ladboy233, oyc_109, pashov, poirots, rfa, robee, sach1r0, samruna, sashik_eth, simon135, slywaters, z3s, zer0dot
62.4602 USDC - $62.46
Custom error from solidity 0.8.4 are cheaper than revert strings, custom error are defined using the error
statement can use inside and outside the contract.
source https://blog.soliditylang.org/2021/04/21/custom-errors/
i suggest replacing revert / require error strings with custom error.
POC
https://github.com/code-423n4/2022-06-illuminate/blob/main/marketplace/MarketPlace.sol#L76 https://github.com/code-423n4/2022-06-illuminate/blob/main/marketplace/MarketPlace.sol#L100 https://github.com/code-423n4/2022-06-illuminate/blob/main/marketplace/MarketPlace.sol#L125 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L110 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L201 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L209 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L211 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L269 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L271 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L332 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L334 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L392 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L394 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L447 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L449 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L501 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L503 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L505 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L558 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L611 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L613 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L710 https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L712 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L72 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L83 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L123 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L145 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L173 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L214 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L249 https://github.com/code-423n4/2022-06-illuminate/blob/main/redeemer/Redeemer.sol#L287
Reducing from public
to private
or internal
can save gas when a constant isnβt used outside of its contract. I suggest changing the visibility from public
to internal
or private
.
POC :
https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L23