Holograph contest - catwhiskeys'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: 129/144

Findings: 2

Award: $0.00

QA:
grade-c
Gas:
grade-c

🌟 Selected for report: 0

🚀 Solo Findings: 0

1) Use scientific notation 1e18, 1e10

3 Instances: HolographOperator.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L256

LayerZeroModule.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/module/LayerZeroModule.sol#L274 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/module/LayerZeroModule.sol#L293

Recommended mitigation steps: Consider using 1e18 instead of 10 ** 18 or 1e10 instead of 10 ** 10

2) Open TODOs

There are open TODOs in the code. Code architecture, incentives, and error handling/reporting questions/issues should be resolved before deployment. Instance: HolographOperator.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L701

3) Typos in require messages

Typos: missmatched, down't 2 Instances: PA1D.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L472 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L477

4) NATSPEC

Important functions should have a @notice comment to describe what they perform. 5 Instances: PA1D.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L589 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L603 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L617 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L647 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L653

Recommended mitigation steps: Consider adding @notice and @dev comments, and consider deleting unnecessary development/production comments before deployment

1) Use calldata instead of memory in read only functions

If a reference type function parameter is read-only, it is cheaper in gas to use calldata instead of memory. 3 Instances: HolographBridge.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographBridge.sol#L324

HolographERC20.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC20.sol#L310 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC20.sol#L318

Recommended mitigation steps: Consider changing memory with calldata in read-only functions

2) Prefix increments

Prefix increments are cheaper than postfix increments - 6 gas. 11 Instances: HolographERC20.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC20.sol#L564

HolographERC721.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC721.sol#L357 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC721.sol#L716

HolographOperator.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L781 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L871

PA1D.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L307 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L321 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L340 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L356 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L454 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L474

Recommended mitigation steps: Consider changing i++ to ++i.

3) Bytes32 constants are cheaper than string constants

If the string can fit into 32 bytes, then bytes32 is cheaper than string. 5 Instances: HolographBridge.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographBridge.sol#L324

HolographERC20.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC20.sol#L310 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC20.sol#L318

HolographERC721.sol https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC721.sol#L282 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC721.sol#L313

Recommended mitigation steps: Consider changing strings to bytes32

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