Omniscia Nexera Audit

DataPoints Code Style Findings

DataPoints Code Style Findings

DPS-01C: Repetitive Value Literals

TypeSeverityLocation
Code StyleDataPoints.sol:L48, L61, L64, L65

Description:

The linked value literals are repeated across the codebase multiple times.

Example:

contracts/utils/DataPoints.sol
48bytes32((uint256(uint32(PREFIX)) << 224) | (uint256(id) << 192) | (uint256(ChainidTools.chainid()) << 160) | uint256(uint160(registry)))

Recommendation:

We advise each to be set to its dedicated constant variable instead, optimizing the legibility of the codebase.

In case some of the constant declarations have already been introduced, we advise them to be properly re-used across the code.

Alleviation:

The referenced value literals 224, 192, and 160 have all been relocated to contract-level constant declarations labelled PREFIX_BIT_OFFSET`, `ID_BIT_OFFSET, and CHAINID_BIT_OFFSET respectively, optimizing the code's legibility.