Omniscia KlimaDAO Audit

KlimaIDONFT Code Style Findings

KlimaIDONFT Code Style Findings

KID-01C: Inefficient Hash Specification

TypeSeverityLocation
Gas OptimizationInformationalKlimaIDONFT.sol:L32, L33

Description:

The linked variables are assigned to a keccak256 instruction and are declared as constant.

Example:

contracts/tokens/upgradeable/KlimaIDONFT.sol
32bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
33bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

Recommendation:

We advise them to be set as immutable instead to cache the result of the keccak256 instruction as otherwise it is performed each time redundantly.

Alleviation:

The KlimaDAO team considered this exhibit but opted to retain the codebase in its current state.

KID-02C: Redundant Visibility Specifiers

TypeSeverityLocation
Gas OptimizationInformationalKlimaIDONFT.sol:L32, L33

Description:

The linked variables are meant to represent internally accessible constant variables yet are exposed as public.

Example:

contracts/tokens/upgradeable/KlimaIDONFT.sol
32bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
33bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

Recommendation:

We advise them to be set as either internal or private depending on their intended usage.

Alleviation:

The KlimaDAO team considered this exhibit but opted to retain the codebase in its current state.

KID-03C: Redundant constructor Implementation

TypeSeverityLocation
Gas OptimizationInformationalKlimaIDONFT.sol:L44-L46

Description:

The linked constructor is redundant.

Example:

contracts/tokens/upgradeable/KlimaIDONFT.sol
44constructor() {
45
46}

Recommendation:

We advise it to be omitted from the codebase.

Alleviation:

The KlimaDAO team considered this exhibit but opted to retain the codebase in its current state.