Holograph contest - i_got_hacked'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: 89/144

Findings: 2

Award: $26.35

QA:
grade-c
Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

OPEN TODOS

require() STATEMENTS SHOULD HAVE DESCRIPTIVE REASON STRINGS

Use of Block.timestamp

Block timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the Entropy Illusion for further details), locking funds for periods of time, and various state-changing conditional statements that are time-dependent. Miners have the ability to adjust timestamps slightly, which can prove to be dangerous if block timestamps are used incorrectly in smart contracts.

Navigate to the following contracts.

Missing indexed fields in event

Use of ecrecover() is deprecated.

Missing initializermodifier on constructor

File: HolographBridge.sol, HolographOperator.sol, HolographFactory.sol, module/LayerZeroModule.sol, enforcer/Holographer.sol, enforcer/PA1D.sol, enforcer/HolographERC721.sol, enforcer/HolographERC20.sol, abstract/ERC721H.sol, abstract/ERC20H.sol.

All the above files misses modifier on constructor.

Use calldata instead of memory for external functions where the function argument is read-only

When a function with a memory array is called externally, the abi.decode() step has to use a for-loop to copy each index of the calldata to the memory index. Each iteration of this for-loop costs at least 60 gas (i.e. 60 * <mem_array>.length). Using calldata directly, obliviates the need for such a loop in the contract code and runtime execution.

If the array is passed to an internal function which passes the array to another internal function where the array is modified and therefore memory is used in the external call, it’s still more gass-efficient to use calldata when the external function uses modifiers, since the modifiers may prevent the internal functions from being called. Structs have the same overhead as an array of length one

MULTIPLE ADDRESS MAPPINGS CAN BE COMBINED INTO A SINGLE MAPPING OF AN ADDRESS TO A STRUCT, WHERE APPROPRIATE

unused named returns

internal functions only called once can be inlined to save gas

Splitting require() statements that use && saves gas

Inline a modifier that's only called once

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