Omniscia Euler Finance Audit
Fee Code Style Findings
Fee Code Style Findings
FEE-01C: Inexplicable Caching of Performance Fee
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | Fee.sol:L31, L36 |
Description:
The referenced performanceFeeCached
variable within the FeeModule::setPerformanceFee
function is redundant.
Example:
src/module/Fee.sol
31uint96 performanceFeeCached = $.performanceFee;32
33require(_newFee <= Constants.MAX_PERFORMANCE_FEE, Errors.MaxPerformanceFeeExceeded());34require($.feeRecipient != address(0), Errors.FeeRecipientNotSet());35
36emit Events.SetPerformanceFee(performanceFeeCached, _newFee);
Recommendation:
We advise it to be omitted, and the variable to be emitted directly similarly to the FeeModule::setFeeRecipient
function.
Alleviation:
The performanceFeeCached
variable has been omitted from the codebase as advised, optimizing the code's gas cost.