Omniscia DAFI Audit
PriceFeeds Code Style Findings
PriceFeeds Code Style Findings
PFS-01C: Variable Mutability Specifier
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | [PriceFeeds.sol:L12](https://github.com/DAFIProtocol/dDAFI/blob/d08c795cdf3455616f403d1468e02ec234ab01ef/contracts/network demand/PriceFeeds.sol#L12), [L20](https://github.com/DAFIProtocol/dDAFI/blob/d08c795cdf3455616f403d1468e02ec234ab01ef/contracts/network demand/PriceFeeds.sol#L20) |
Description:
The priceFeed
variable is assigned to only once during the contract's constructor
.
Example:
contracts/network
19constructor(address aggregator) {20 priceFeed = AggregatorV3Interface(aggregator);21}
Recommendation:
We advise it to be set as immutable
greatly optimizing the contract's gas cost.
Alleviation:
The variable was properly set to immutable
greatly optimizing the codebase.