Omniscia Evergon Labs Audit
ComplexRewardDistributionFacetStorage Code Style Findings
ComplexRewardDistributionFacetStorage Code Style Findings
CRF-01C: Non-Standard Storage Slot Definition
| Type | Severity | Location |
|---|---|---|
| Standard Conformity | ![]() | ComplexRewardDistributionFacetStorage.sol:L38 |
Description:
The referenced declaration will define a storage slot for use by a facet of the system's main EIP-2535 Diamond, however, the way it is declared does not adhere to the latest standards.
Example:
36/// @dev Unique identifier for the storage slot where the Layout struct is stored.37bytes32 internal constant STORAGE_SLOT =38 keccak256("evergonlabs.Staking.rewardDistribution.storage.ComplexRewardDistributionFacetStorage");Recommendation:
We advise the EIP-7201 name-spaced layout approach to be adhered to similarly to OpenZeppelin and other relevant standard libraries, ensuring consistency among the ecosystem's widely utilized libraries and conforming to the latest standards.
Alleviation (b64b659786cf3c84bea52feb3a69f546ba3601f0):
The referenced slot definition has been updated to its standardized EIP-7201 representation, addressing this exhibit.
CRF-02C: Repetitive Value Literals
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | ComplexRewardDistributionFacetStorage.sol:L98, L249, L250 |
Description:
The linked value literals are repeated across the codebase multiple times.
Example:
98if (GeneralStorage.layout().campaignsInfo[campaignId].state != 1) {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 (b64b659786cf3c84bea52feb3a69f546ba3601f0):
The 1e18 value literal has been set as a DIVIDER library-level constant whereas the value literal 1 has been replaced by its enum representation of ON_CREATION, addressing this exhibit in full.
CRF-03C: Test Dependency Import
| Type | Severity | Location |
|---|---|---|
| Standard Conformity | ![]() | ComplexRewardDistributionFacetStorage.sol:L6 |
Description:
The linked import statement specifies a test dependency that should not be present in production code.
Example:
6import "hardhat/console.sol";Recommendation:
We advise the import statement and all related usages of it to be safely omitted from the codebase.
Alleviation (b64b659786cf3c84bea52feb3a69f546ba3601f0):
The test dependency import has been removed from the codebase as advised.
