Illuminate contest - 0xNazgul'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: 58/88

Findings: 2

Award: $126.40

🌟 Selected for report: 0

🚀 Solo Findings: 0

Max/Infinite Approvals are Dangerous

Severity: Low Context: Lender.sol#L78-L124

Description: Giving max/infinite approvals to contracts are dangerous because if those contracts are exploited then they can remove all the funds from the approving addresses.

Recommendation: Check allowance and approve as much as required.

Lack of Event Emission For Critical Functions

Severity: Low Context: MarketPlace.sol#L98-L129, Lender.sol#L129-L159, Redeemer.sol#L62-L95

Description: Several functions update critical parameters that are missing event emission. These should be performed to ensure tracking of changes of such critical parameters.

Recommendation: Add events to functions that change critical parameters.

Spelling Errors

Severity: Informational Context: MarketPlace.sol#L11 (avaialable => available), MarketPlace.sol#L12 (metaprincipal => meta-principal), MarketPlace.sol#L50 (intializes => initializes), Lender.sol#L83 (unsighed => unsigned), Lender.sol#L544 (Dont => Do not), Lender.sol#L631 (remaing => remaining), Redeemer.sol#L125 (prinicipal => principal), Redeemer.sol#L189 (prinicipal => principal), Redeemer.sol#L237 (prinicipal => principal)

Description: Spelling errors in comments can cause confusion to both users and developers.

Recommendation: Check all misspellings to ensure they are corrected.

Same State Variable Read More Than Once

Context: Lender.sol#L145-L151, Lender.sol#L661-L663, Redeemer.sol#L107-L151, Redeemer.sol#L158-L198, Redeemer.sol#L206-L231, Redeemer.sol#L240-L266

Description: Functions that read state variables more than once can catch it into a local variable for repeated reads saving gas by converting expensive SLOADs into much cheaper MLOADs.

Recommendation: It's best to catch the state variables into memory when read more than once.

Setting The Constructor To Payable

Context: All Contracts

Description: You can cut out 10 opcodes in the creation-time EVM bytecode if you declare a constructor payable. Making the constructor payable eliminates the need for an initial check of msg.value == 0 and saves 21 gas on deployment with no security risks.

Recommendation: Set the constructor to payable.

Function Ordering via Method ID

Context: All Contracts

Description: Contracts most called functions could simply save gas by function ordering via Method ID. Calling a function at runtime will be cheaper if the function is positioned earlier in the order (has a relatively lower Method ID) because 22 gas are added to the cost of a function for every position that came before it. The caller can save on gas if you prioritize most called functions. One could use This tool to help find alternative function names with lower Method IDs while keeping the original name intact.

Recommendation: Find a lower method ID name for the most called functions for example mostCalled() vs. mostCalled_41q() is cheaper by 44 gas.

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