Illuminate contest - Fitraldys's results

Your Sole Source For Fixed-Yields.

General Information

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

Illuminate

Findings Distribution

Researcher Performance

Rank: 81/88

Findings: 1

Award: $62.46

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

  1. Use Custom Error instead of Revert / Require String to Save Gas

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

  1. Consider making some constants as non-public to save gas

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

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax Β© 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter