Omniscia Euler Finance Audit
Constants Static Analysis Findings
Constants Static Analysis Findings
CST-01S: Illegible Numeric Value Representation
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | Constants.sol:L17 |
Description:
The linked representation of a numeric literal is sub-optimally represented decreasing the legibility of the codebase.
Example:
17uint256 constant MAX_ALLOWED_INTEREST_RATE = 291867236321699131285;Recommendation:
To properly illustrate the value's purpose, we advise the following guidelines to be followed.
For values meant to depict fractions with a base of 1e18, we advise fractions to be utilized directly (i.e. 1e17 becomes 0.1e18) as they are supported.
For values meant to represent a percentage base, we advise each value to utilize the underscore (_) separator to discern the percentage decimal (i.e. 10000 becomes 100_00, 300 becomes 3_00 and so on).
Finally, for large numeric values we simply advise the underscore character to be utilized again to represent them (i.e. 1000000 becomes 1_000_000).
Alleviation (fb2dd77a6ff9b7f710edb48e7eb5437e0db4fc1a):
The Euler Finance team evaluated this exhibit and opted to retain the current representation in place as the literal is not meant to be human-readable but rather machine-generated per the comment that already accompanied it.
As such, we consider this exhibit addressed in the sense that we are aligned with the Euler Finance team's assessment of the literal's canonical representation.
