Holograph contest - lukris02's results

Omnichain protocol for deploying, minting, & bridging NFTs between blockchains.

General Information

Platform: Code4rena

Start Date: 18/10/2022

Pot Size: $75,000 USDC

Total HM: 27

Participants: 144

Period: 7 days

Judge: gzeon

Total Solo HM: 13

Id: 170

League: ETH

Holograph

Findings Distribution

Researcher Performance

Rank: 23/144

Findings: 2

Award: $549.04

QA:
grade-a
Gas:
grade-c

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

QA Report for Holograph contest

Overview

During the audit, 6 non-critical issues were found.

β„–TitleRisk RatingInstance Count
NC-1Order of FunctionsNon-Critical24
NC-2Missing NatSpecNon-Critical77
NC-3Open TODOsNon-Critical1
NC-4Commented codeNon-Critical7
NC-5Scientific notation may be usedNon-Critical11
NC-6Constants may be usedNon-Critical1

Non-Critical Risk Findings (6)

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

receive() and fallback() functions should be placed after constructor:

public functions should not be placed between external:

public functions should not be placed between private:

all public functions should not be placed after private:

Recommendation

Reorder functions where possible.

NC-2. Missing NatSpec

Description

NatSpec is missing for 77 functions in 6 contracts.

Instances
Recommendation

Add NatSpec for all functions.

NC-3. Open TODOs

Instances

HolographOperator.sol has 1 open TODO:

Recommendation

Resolve issues.

NC-4. Commented code

Instances
Recommendation

Delete commented code.

NC-5. Scientific notation may be used

Description

For readability, it is better to use scientific notation.

Instances

For 10000:

Recommendation

Replace 10000 with 10e4.

NC-6. Constants may be used

Description

Constants may be used instead of literal values.

Instances
Recommendation

Consider using a constant variable.

Gas Optimizations Report for Holograph contest

Overview

During the audit, 3 gas issues were found.
Total savings more than 1100.

Gas Optimizations Findings (3)

G-1. Extra operation with an array

Description

There is no need to delete (make zero) element that will be popped.

Instances
Recommendation

Remove this line of code.

G-2. Use unchecked blocks for incrementing i

Description

In Solidity 0.8+, there’s a default overflow and underflow check on unsigned integers. In the loops, "i" will not overflow because the loop will run out of gas before that.

Instances
Recommendation

Change:

for (uint256 i; i < n; ++i) { // ... }

to:

for (uint256 i; i < n;) { // ... unchecked { ++i; } }
Saved

This saves ~30-40 gas per iteration.
So, ~35*14 = 490

G-3. Use calldata instead of memory for read-only arguments

Description

Since Solidity v0.6.9, memory and calldata are allowed in all functions regardless of their visibility type (See "Calldata Variables" section here).
When function arguments should not be modified, it is cheaper to use calldata.

Instances
Recommendation

Use calldata where possible.

Saved

This saves at least 60 gas per iteration.
So, ~60*10 = 600

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