Omniscia Evergon Labs Audit
Erc20RewardTransferFacetStorage Code Style Findings
Erc20RewardTransferFacetStorage Code Style Findings
ERR-01C: Inefficient ABI Encoding Mechanism
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | Erc20RewardTransferFacetStorage.sol:L138 |
Description:
The referenced ABI encoding mechanism utilizes a string literal rather than the actual function signature of IERC20::approve to generate the relevant payload.
Example:
137// Call Reward Asset Handler for maximum approval138bytes memory data = abi.encodeWithSignature("approve(address,uint256)", address(this), type(uint256).max);Recommendation:
We advise the abi.encodeWithSelector function to be utilized instead by importing the relevant IERC20 interface and utilizing the IERC20.approve.selector syntax, optimizing the code's gas cost and syntax.
Alleviation (b64b659786cf3c84bea52feb3a69f546ba3601f0):
The abi.encodeWithSelector variant was incorporated into the codebase, addressing this exhibit as advised.
ERR-02C: Non-Standard Storage Slot Definition
| Type | Severity | Location |
|---|---|---|
| Standard Conformity | ![]() | Erc20RewardTransferFacetStorage.sol:L51 |
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:
49/// @dev Unique identifier for the storage slot where the Layout struct is stored.50bytes32 internal constant STORAGE_SLOT =51 keccak256("evergonlabs.Staking.transferReward.storage.Erc20RewardTransferFacetStorage");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.
ERR-03C: Repetitive Value Literal
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | Erc20RewardTransferFacetStorage.sol:L104 |
Description:
The linked value literal is repeated across the codebase multiple times.
Example:
104if (campaignInfo.state != 1) {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 (b64b659786cf3c84bea52feb3a69f546ba3601f0):
The referenced literal has been properly introduced as part of the GeneralStakingStorage declarations and specifically as an ON_CREATION state, addressing this exhibit.
