Omniscia Ultra Yield Audit
UltraVault Code Style Findings
UltraVault Code Style Findings
UVT-01C: Illegible Numeric Value Representations
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | UltraVault.sol: • I-1: L48 • I-2: L49 • I-3: L50 |
Description:
The linked representations of numeric literals are sub-optimally represented decreasing the legibility of the codebase.
Example:
48uint64 public constant MAX_PERFORMANCE_FEE = 3e17; // 30%Recommendation:
To properly illustrate each 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 (28f27853965de07fb79f4f2b5fed696d35120032):
The referenced literal representations have been corrected by utilizing multiples of a ONE_PERCENT literal, addressing this exhibit.
UVT-02C: Non-Standard Usage of Library
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | UltraVault.sol: • I-1: L178 • I-2: L184 • I-3: L553 |
Description:
The referenced statements will utilize the SafeERC20 library via direct invocations rather than applying the library to the IERC20 data type and utilizing it through it.
Example:
553SafeERC20.safeTransferFrom(IERC20(_asset), fundsHolder(), feeRecipient(), fee);Recommendation:
We advise the using SafeERC20 for IERC20 statement to be introduced to the codebase and the relevant functions to be invoked via the IERC20 data type, standardizing the code's syntax.
Alleviation (28f27853965de07fb79f4f2b5fed696d35120032):
All referenced library invocation instances have been properly replaced by invocations of the relevant functions directly through the data types involved, addressing this exhibit.
UVT-03C: Repetitive Value Literal
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | UltraVault.sol:L207, L239, L279, L412, L541 |
Description:
The linked value literal is repeated across the codebase multiple times.
Example:
207uint256 withdrawalFee = assets.mulDivDown(getFees().withdrawalFee, 1e18);Recommendation:
We advise it to be set to a constant variable instead, optimizing the legibility of the codebase.
In case the constant has already been declared, we advise it to be properly re-used across the code.
Alleviation (28f27853965de07fb79f4f2b5fed696d35120032):
The referenced value literal 1e18 has been properly relocated to a contract-level constant declaration labelled ONE_UNIT, optimizing the code's legibility.
