Illuminate contest - delfin454000'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: 53/88

Findings: 2

Award: $127.02

🌟 Selected for report: 0

🚀 Solo Findings: 0

Typos


marketplace/MarketPlace.sol: L11

/// @notice This contract is in charge of managing the avaialable principals for each loan market.

Change avaialable to avaialable


marketplace/MarketPlace.sol: L34

    /// @notice The principal tokens those addresses represent correspond to their Principals enum value, thus the array should be ordered in that way

Change those addresses represent to whose addresses


marketplace/MarketPlace.sol: L50

    /// @notice intializes the MarketPlace contract

Change intializes to initializes


lender/Lender.sol: L6

import './MarketPlace.sol'; // library of market place specific constructs

Change market place to marketplace


lender/Lender.sol: L83

        // max is the maximum integer value for a 256 unsighed integer

Change unsighed to unsigned


The same typo (gauruntee) occurs in both lines referenced below:

lender/Lender.sol: L500
lender/Lender.sol: L504

Example:

        if (token.underlying() != u) { // gauruntee the input token is the right token

Change gauruntee to guarantee in both cases


lender/Lender.sol: L650

        // send the remaing amount to the given yield pool

Change remaing to remaining


lender/Lender.sol: L679

    /// @return uint256 The total for for the given amount

Remove the repeated word for


The same typo (prinicipal) occurs in both lines referenced below:

redeemer/Redeemer.sol: L125
redeemer/Redeemer.sol: L189

Example:

            // Burn the prinicipal token from Illuminate

Change prinicipal to principal in both cases


redeemer/Redeemer.sol: L237

    /// @param d Sense contract that splits the loan's prinicpal and yield

Change prinicpal to principal


redeemer/Redeemer.sol: L273

    /// @param a amount of the underlying asset to be burned and sent to the to

Replaceto the to with to the t address


Comments referring to unfinished work or open items

Such comments should be addressed and modified or removed


lender/Lender.sol: L561

        // Potentially add redundant implied maturity calculation

Variables should not be initialized to their default values

Initializing uint variables to their default value of 0 is unnecessary and costs gas


lender/Lender.sol: L265

            for (uint256 i = 0; i < o.length; ) {

Recommendation: Change uint256 i = 0; to uint256 i;


Array length should not be looked up in every iteration of a for loop

Since calculating the array length costs gas, it's best to read the length of the array from memory before executing the loop


lender/Lender.sol: L265-291

            for (uint256 i = 0; i < o.length; ) {

Recommendation:

        uint256 totalO = o.length; 
        for (uint256 i; i < totalO; ++i) {

Use of i++ to increase count in a for loop

Since use of i++ (or equivalent counter) cost more gas, it is better to use ++i


Recommendation: Use ++i instead of i++ in the three for loops referenced below:

lender/Lender.sol: L87-97
lender/Lender.sol: L114-122
lender/Lender.sol: L265-291


Storage of uints or ints smaller than 32 bytes

Storage of uints or ints smaller than 32 bytes incurs overhead. Instead, use size of at least 32, then downcast where needed


Recommendation: Increase size of the loop counter i from uint8 to at least uint32 in the following for loop:

lender/Lender.sol: L87-97

Recommendation: Increase size of p (which is initiated as uint8 in multiple lines throughout), to at least uint32. Below are representative examples where p is used as a parameter in mint, lend and redeem functions, respectively:

lender/Lender.sol: L168
lender/Lender.sol: L193
redeemer/Redeemer.sol: L108


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