Omniscia Euler Finance Audit
Events Code Style Findings
Events Code Style Findings
EVE-01C: Potentially Redundant Indexed Variable
Type | Severity | Location |
---|---|---|
Gas Optimization | Events.sol:L58 |
Description:
The GovSetChainlinkPriceFeed
event has both variables declared as indexed
which increase the emission gas cost, however, the latter of the two does not appear to have a purpose as indexed
.
Example:
contracts/Events.sol
58event GovSetChainlinkPriceFeed(address indexed underlying, address indexed chainlinkAggregator);
Recommendation:
We advise the indexed
keyword to be omitted from the chainlinkAggregator
argument as it is meant to be unique on each event emission since a single aggregator is associated with a single underlying asset but an underlying asset may utilize different oracles (i.e. as part of an upgrade).
Alleviation:
The redundantly indexed variable has properly had its indexed
keyword removed thus optimizing the codebase as advised.