Skip to content

Latest commit

 

History

History
155 lines (142 loc) · 11.1 KB

lukris02-Q.md

File metadata and controls

155 lines (142 loc) · 11.1 KB

QA Report for zkSync v2 contest

Overview

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

Title Risk Rating Instance Count
L-1 Missing check for zero address Low 7
NC-1 Order of Functions Non-Critical 10
NC-2 Order of Layout Non-Critical 2
NC-3 Public functions can be external Non-Critical 2
NC-4 Open TODOs Non-Critical 5
NC-5 Typos in function name / argument name / struct name Non-Critical 3
NC-6 Typos Non-Critical 10
NC-7 No error message in require Non-Critical 9
NC-8 Missing NatSpec Non-Critical 13

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(8)

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

exteranl functions between internal:

public function between/after internal:

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

structs should be placed before event:

modifier should be placed before constructor:

NC-3. Public functions can be external

Description

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

Instances
Recommendation

Make public functions external, where possible.

NC-4. Open TODOs

Instances
Recommendation

Resolve issues.

NC-5. Typos in function name / argument name / struct name

Instances

NC-6. Typos

Instances

NC-7. No error message in require

Instances
Recommendation

Add error messages.

NC-8. Missing NatSpec

Description

NatSpec is missing for 13 functions in 5 contracts.

Instances
Recommendation

Add NatSpec for all functions.