Omniscia Evergon Labs Audit
CreateFractionsSetterFacetStorage Code Style Findings
CreateFractionsSetterFacetStorage Code Style Findings
CFG-01C: Ineffectual Usage of Safe Arithmetics
| Type | Severity | Location |
|---|---|---|
| Language Specific | ![]() | CreateFractionsSetterFacetStorage.sol:L101 |
Description:
The linked mathematical operation is guaranteed to be performed safely by logical inference, such as surrounding conditionals evaluated in require checks or if-else constructs.
Example:
89for (i; i < requiredSelectorsLength; i++) {90 bytes memory input = abi.encodeWithSelector(requiredSelectorsToExecute[i], dataToExecute[i]);91 (bool success, bytes memory result) = address(this).call(input);92
93 if (!success) {94 assembly {95 revert(add(result, 32), mload(result))96 }97 }98}99
100for (i; i < totalLength; i++) {101 bytes4 selectorToExecute = optionalSelectorsToExecute[i - requiredSelectorsLength];Recommendation:
Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statement to be wrapped in an unchecked code block thereby optimizing its execution cost.
Alleviation (71cda4ccfdcfa25fb96a4565f1f8143b350dd246):
An unchecked code block has been introduced wrapping the highlighted arithmetic operation, optimizing the code's gas cost.
CFG-02C: Non-Standard Storage Slot Definition
| Type | Severity | Location |
|---|---|---|
| Standard Conformity | ![]() | CreateFractionsSetterFacetStorage.sol:L20 |
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:
20bytes32 internal constant STORAGE_SLOT = keccak256("Evergonlabs.Tmi-Tokenizer.storage.CreateFractionsSetterFacetStorage");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.
