Omniscia Nuklai Audit
DatasetFactory Code Style Findings
DatasetFactory Code Style Findings
DFY-01C: Inefficient Contract Imports
Type | Severity | Location |
---|---|---|
Gas Optimization | DatasetFactory.sol:L6-L8 |
Description:
The DatasetFactory
contract will contain an inflated bytecode size as it imports the full VerifierManager
, DistributionManager
, and ERC20SubscriptionManager
implementations even though they are solely utilized as interface
declarations.
Example:
contracts/DatasetFactory.sol
6import {VerifierManager} from "./verifier/VerifierManager.sol";7import {DistributionManager} from "./distribution/DistributionManager.sol";8import {ERC20SubscriptionManager} from "./subscription/ERC20SubscriptionManager.sol";
Recommendation:
We advise a proper interface
to be coded for each contract (i.e. IVerifierManager
) and to be imported to the DatasetFactory
, minimizing its deployed bytecode size.
Alleviation (fb50b5c39665f7df086b2de1fdbf93ba2d836bf9):
All referenced contract implementation import
statements have been replaced by their newly introduced I
prefixed interface declarations, optimizing the bytecode size of the contract significantly.