Omniscia Euler Finance Audit
PegStabilityModule Static Analysis Findings
PegStabilityModule Static Analysis Findings
PSM-01S: Illegible Numeric Value Representation
Type | Severity | Location |
---|---|---|
Code Style | PegStabilityModule.sol:L13 |
Description:
The linked representation of a numeric literal is sub-optimally represented decreasing the legibility of the codebase.
Example:
13uint256 public constant BPS_SCALE = 10000;
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 referenced value literal has been updated in its representation to 100_00
in accordance with the recommendation's underscore style, addressing this exhibit.
PSM-02S: Inexistent Sanitization of Input Addresses
Type | Severity | Location |
---|---|---|
Input Sanitization | PegStabilityModule.sol:L21-L28 |
Description:
The linked function(s) accept address
arguments yet do not properly sanitize them.
Impact:
The presence of zero-value addresses, especially in constructor
implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.
Example:
21constructor(address _evc, address _synth, address _underlying, uint256 toUnderlyingFeeBPS, uint256 toSynthFeeBPS)22 EVCUtil(IEVC(_evc))23{24 synth = ESynth(_synth);25 underlying = IERC20(_underlying);26 TO_UNDERLYING_FEE = toUnderlyingFeeBPS;27 TO_SYNTH_FEE = toSynthFeeBPS;28}
Recommendation:
We advise some basic sanitization to be put in place by ensuring that each address
specified is non-zero.
Alleviation (fb2dd77a6ff9b7f710edb48e7eb5437e0db4fc1a):
All input arguments of the PegStabilityModule::constructor
function are adequately sanitized as non-zero in the latest in-scope revision of the codebase, addressing this exhibit.