Omniscia Euler Finance Audit
Shared Code Style Findings
Shared Code Style Findings
SDE-01C: Generic Typographic Mistakes
Type | Severity | Location |
---|---|---|
Code Style | ![]() | Shared.sol:L40, L234-L235 |
Description:
The referenced lines contain typographical mistakes (i.e. private
variable without an underscore prefix) or generic documentational errors (i.e. copy-paste) that should be corrected.
Example:
src/common/Shared.sol
40/// This is meant to be set to `False` when deploying on L2 to explicitly harvest on every withdraw/redeem.
Recommendation:
We advise them to be corrected enhancing the legibility of the codebase.
Alleviation:
The referenced documentational mistakes have been corrected, optimizing the code's legibility.
SDE-02C: Inefficient Variable Read
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | Shared.sol:L115 |
Description:
The Gulp
event emitted by the Shared::_gulp
function will inefficiently read the $.interestSmearEnd
variable from storage when it can re-calculate it at a significantly lesser gas cost.
Example:
src/common/Shared.sol
112$.interestSmearEnd = uint40(block.timestamp + Constants.INTEREST_SMEAR);113$.interestLeft = interestLeftCached;114
115emit Events.Gulp(interestLeftCached, $.interestSmearEnd);
Recommendation:
We advise the value to be re-calculated, optimizing the function's gas cost.
Alleviation:
The advised optimization has been applied ensuring the event is emitted with in-memory variables rather than a redundant storage read.