Illuminate contest - 0xf15ers'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: 62/88

Findings: 2

Award: $126.40

🌟 Selected for report: 0

🚀 Solo Findings: 0

1. Use type(uint256).max instead of calculating 2**256-1

2. Unhandled return value

3. Functions returning same value always can be ignored.

4. Make public functions external

5. floating version pragma in ERC5095.sol

  • Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.
  • pragma solidity ^0.8.4;

1. Use prefix increment instead of postfix increment to save gas

  • Although unchecked directive is used to save gas, using prefix increment can save more gas.
 function approve(
....................
            unchecked {
                ++i;
            }
    }

2. The length of the loop is calculated in every iteration, caching it can save gas

The loop termination condition evaluates the length of the loop on every iteration. Caching it will save gas.

3. Using > 0 costs more gas than != 0 when used on a uint in a require() statement

  • In lender.sol's calculateFee(),
function calculateFee(uint256 a) internal view returns (uint256) {
       return feenominator > 0 ? a / feenominator : 0;
   }
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