Astaria contest - lukris02's results

On a mission is to build a highly liquid NFT lending market.

General Information

Platform: Code4rena

Start Date: 05/01/2023

Pot Size: $90,500 USDC

Total HM: 55

Participants: 103

Period: 14 days

Judge: Picodes

Total Solo HM: 18

Id: 202

League: ETH

Astaria

Findings Distribution

Researcher Performance

Rank: 74/103

Findings: 1

Award: $51.32

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report for Astaria contest

Overview

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

â„–TitleRisk RatingInstance Count
L-1Use the two-step-transfer of GuardianLow1
NC-1Order of FunctionsNon-Critical22
NC-2Order of LayoutNon-Critical9
NC-3Unused variableNon-Critical22
NC-4TyposNon-Critical5
NC-5Function is not implementedNon-Critical1
NC-6Missing leading underscoresNon-Critical15
NC-7Empty function bodiesNon-Critical2
NC-8Missing NatSpecNon-Critical10
NC-9Visibility is not markedNon-Critical4
NC-10Unused named return variablesNon-Critical21
NC-11Maximum line length exceededNon-Critical22
NC-12Inconsistency when using the number 1000Non-Critical1

Low Risk Findings(1)

L-1. Use the two-step-transfer of Guardian

Description

If the guardian accidentally transfers ownership to an incorrect address, protected functions may become permanently inaccessible.

Instances
Recommendation

Consider using a two-step-transfer of ownership: the current owner would nominate a new owner, and to become the new owner, the nominated account would have to approve the change, so that the address is proven to be valid.

Non-Critical Risk Findings(12)

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

fallback() should be placed right after constructor and receive() function:

receive() should be placed right after constructor:

external functions should not go after internal functions:

public functions should not go after internal functions:

external functions should not go after public functions:

internal functions should not go between public functions:

public function should not go between external functions:

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

state variable should not go after events:

state variable should not go between functions:

event should be placed after all structs:

modifiers should be placed between state variables/events and functions:

NC-3. Unused variable

Description

Some variables are not used in the functions code.

Instances
Recommendation

Delete unused variables or use them.

NC-4. Typos

Instances

NC-5. Function is not implemented

Description

Function balanceOf always returns incorrect result.

Instances

NC-6. Missing leading underscores

Description

It is a good practice when private constants have a leading underscore.

Instances
Recommendation

Consider adding leading underscores.

NC-7. Empty function bodies

Description

Some functions do not have implementation.

Instances
Recommendation

Consider marking these functions as not implemented or removing them.

NC-8. Missing NatSpec

Description

NatSpec is missing in 10 contracts.

Instances
Recommendation

Add NatSpec for all functions.

NC-9. Visibility is not marked

Description

It is a good practice to explicitly mark visibility.

Instances

NC-10. Unused named return variables

Description

Both named return variable(s) and return statement are used.

Instances
Recommendation

To improve clarity use only named return variables.
For example, change:

function functionName() returns (uint id) { return x;

to

function functionName() returns (uint id) { id = x;

NC-11. Maximum line length exceeded

Description

According to Style Guide, maximum suggested line length is 120 characters. Longer lines make the code harder to read.

Instances
Recommendation

Make the lines shorter.

NC-12. Inconsistency when using the number 1000

Description

In some cases, 1000 is used, and in some - 1_000.

Instances

1_000:

1000/10000:

Recommendation

Stick to one style.

#0 - c4-judge

2023-01-26T14:07:27Z

Picodes 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