Illuminate contest - Kaiziron'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: 78/88

Findings: 1

Award: $63.08

🌟 Selected for report: 0

🚀 Solo Findings: 0

Don't explicitly initialize variables with the default value

Uninitialized variables are assigned with the default value of their type, initializing a variable with its default value costs unnecessary gas.

Instances include :

lender/Lender.sol:265: for (uint256 i = 0; i < o.length; ) {

Recommendation

It is recommended to initialize variables without assigning them the default value, for example :

lender/Lender.sol:265: for (uint256 i; i < o.length; ) {

Cache array length outside of for loop

Caching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.

Instances include :

lender/Lender.sol:265: for (uint256 i = 0; i < o.length; ) {

Recommendation

It is recommended to cache the array length on a variable before running the loop, then it doesn't need to read the length on every iteration, which cost gas, for example :

uint256 len = o.length; lender/Lender.sol:265: for (uint256 i = 0; i < len; ) {

If possible, use prefix increment instead of postfix increment

Prefix increment ++i returns the updated value after it's incremented and postfix increment i++ returns the original value then increments it. Prefix increment costs less gas compared to postfix increment.

Instances includes :

lender/Lender.sol:96: i++; lender/Lender.sol:120: i++; lender/Lender.sol:289: i++;

Recommendation

It is recommended to use prefix increment instead of postfix one when the return value is not needed, as both of them will give the same result and prefix increment costs less gas.

For example :

lender/Lender.sol:96: ++i;

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