Nibbl contest - berndartmueller's results

NFT fractionalization protocol with guaranteed liquidity and price based buyout.

General Information

Platform: Code4rena

Start Date: 21/06/2022

Pot Size: $30,000 USDC

Total HM: 12

Participants: 96

Period: 3 days

Judge: HardlyDifficult

Total Solo HM: 5

Id: 140

League: ETH

Nibbl

Findings Distribution

Researcher Performance

Rank: 64/96

Findings: 1

Award: $37.14

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report

Table of Contents

Low Risk

[L-01] chainid() may change in case of a hardfork

Description

The domainSeperator is not recalculated in the case of a hard fork. The variable domainSeperator in the contract EIP712Base is cached in the contract storage and will not change after being initialized. However, in the event of a hard fork, the domain would become invalid on one of the forked chains due to the change of chainid.

Findings

EIP712Base.sol#L16-L24

function INIT_EIP712(string memory name, string memory version) internal {
    domainSeperator = keccak256(
        abi.encode(
            EIP712_DOMAIN_TYPEHASH,
            keccak256(bytes(name)),
            keccak256(bytes(version)),
            getChainID(),
            address(this)
        )
    ); // @audit-info `domainSeperator` is cached forever
}

Consider using the elegant solution provided by OpenZeppelin:

https://github.com/fractional-company/contracts/blob/master/src/OpenZeppelin/drafts/EIP712.sol

[L-02] Unrecoverable ETH due to unnecessary receive() function

Description

The NibblVault contract does not expect direct ETH transfers. However, there is a receive() function to receive ETH. Anyone accidentally sending ETH to this contract will lose their funds.

Findings

NibblVault.sol#L585

receive() external payable {}

Remove the receive() function.

#0 - mundhrakeshav

2022-06-26T07:08:49Z

DIrect ETH transfers expected

#1 - HardlyDifficult

2022-07-03T15:27:46Z

#2 - HardlyDifficult

2022-07-03T15:30:37Z

#3 - HardlyDifficult

2022-07-04T15:17:32Z

Low risk best practices. Good report format.

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