Inverse Finance contest - lukris02's results

Rethink the way you borrow.

General Information

Platform: Code4rena

Start Date: 25/10/2022

Pot Size: $50,000 USDC

Total HM: 18

Participants: 127

Period: 5 days

Judge: 0xean

Total Solo HM: 9

Id: 175

League: ETH

Inverse Finance

Findings Distribution

Researcher Performance

Rank: 78/127

Findings: 1

Award: $36.73

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report for Inverse Finance contest

Overview

During the audit, 1 low and 13 non-critical issues were found.

â„–TitleRisk RatingInstance Count
L-1Missing check for zero addressLow19
NC-1Order of FunctionsNon-Critical8
NC-2Order of LayoutNon-Critical4
NC-3Maximum line length exceededNon-Critical6
NC-4Inconsistent comment locationNon-Critical1
NC-5Open TODONon-Critical1
NC-6No error message in requireNon-Critical3
NC-7Comment lines are too longNon-Critical3
NC-8Missing NatSpecNon-Critical4
NC-9Spaces between the control structuresNon-Critical31
NC-10TyposNon-Critical8
NC-11Scientific notation may be usedNon-Critical22
NC-12Constants may be usedNon-Critical1
NC-13Public functions can be externalNon-Critical62

Low Risk Findings (1)

L-1. Missing check for zero address

Description

If address(0x0) is set it may cause the contract to revert or work wrong.

Instances
Recommendation

Add checks.

Non-Critical Risk Findings (13)

NC-1. Order of Functions

Description

According to Style Guide, ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier.
Functions should be grouped according to their visibility and ordered:

  1. constructor
  2. receive function (if exists)
  3. fallback function (if exists)
  4. external
  5. public
  6. internal
  7. private
Instances

Public functions before external:

Internal functions before public:

Recommendation

Reorder functions where possible.

NC-2. Order of Layout

Description

According to Order of Layout, inside each contract, library or interface, use the following order:

  1. Type declarations
  2. State variables
  3. Events
  4. Modifiers
  5. Functions
Instances

Events after functions:

Recommendation

Place events before functions.

NC-3. Maximum line length exceeded

Description

Some lines of code are too long.

Instances
Recommendation

According to Style Guide, maximum suggested line length is 120 characters.
Make the lines shorter.

NC-4. Inconsistent comment location

Description

Some comments are above the line of code and some next to it.

Instances

Here the comments are above the line of code, although in all other contracts it is on the side of the code.

Recommendation

Use consistent comment location.

NC-5. Open TODO

Instances
Recommendation

Resolve issues.

NC-6. No error message in require

Instances
Recommendation

Add error messages.

NC-7. Comment lines are too long
Description

Comments are not fully visible on the screen.

Instances
Recommendation

For readability, split comments across multiple lines.

NC-8. Missing NatSpec

Description

NatSpec is missing for 4 functions in 2 contracts.

Instances
Recommendation

Add NatSpec for all functions.

NC-9. Spaces between the control structures

Description

According to Style Guide, there should be a single space between the control structures if, while, and for and the parenthetic block representing the conditional.

Instances
Recommendation

Change:

if(...)

to:

if (...)

NC-10. Typos
Instances

NC-11. Scientific notation may be used

Description

For readability and to avoid misprints, it is better to use scientific notation.

Instances

10000:

Recommendation

Replace 10000 with 10e4.

NC-12. Constants may be used

Description

Constants may be used instead of literal values.

Instances

For 10000:

  • See Instances in NC-11.
Recommendation

Define constant variables for repeated values.

NC-13. Public functions can be external
Description

If functions are not called by the contract where they are defined, they can be declared external.

Instances

21 functions in Market.sol:

18 functions in DBR.sol:

Recommendation

Make public functions external, where possible.

#0 - c4-judge

2022-11-07T21:54:00Z

0xean marked the issue as grade-b

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