Omniscia Evergon Labs Audit

BurnFungibleForDiscountFacetStorage Code Style Findings

BurnFungibleForDiscountFacetStorage Code Style Findings

BFD-01C: Non-Standard Storage Slot Definition

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:

packages/contracts/contracts/internalFacets/purchasePhaseFacets/purchaseDiscountFacets/burnForDiscount/BurnFungibleForDiscountFacetStorage.sol
28bytes32 internal constant STORAGE_SLOT = keccak256("Evergonlabs.Tmi-Tokenizer.storage.BurnFungibleForDiscountFacetStorage");

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 (71cda4ccfdcfa25fb96a4565f1f8143b350dd246):

The referenced slot definition has been updated to its standardized EIP-7201 representation, addressing this exhibit.

BFD-02C: Repetitive Value Literal

Description:

The linked value literal is repeated across the codebase multiple times.

Example:

packages/contracts/contracts/internalFacets/purchasePhaseFacets/purchaseDiscountFacets/burnForDiscount/BurnFungibleForDiscountFacetStorage.sol
30uint256 internal constant BASE_100_PERCENT = 10 ** 6;

Recommendation:

We advise it to be set to a constant variable instead, optimizing the legibility of the codebase.

In case the constant has already been declared, we advise it to be properly re-used across the code.

Alleviation (71cda4ccfd):

The Evergon Labs team evaluated this recommendation to be invalid due to the constant appearing once across the codebase, however, the same value is present in the MultipleFundingCurrenciesFacetStorage as well as SingleFundingCurrencyFacetStorage implementations rendering it to remain valid albeit open and thus acknowledged.

Alleviation (d7b20c134f):

The constant literal has been relocated to a contract-level declaration within the GeneralStorage common dependency, addressing this exhibit.