Omniscia Plutus DAO Audit

HedgeVault Code Style Findings

HedgeVault Code Style Findings

HVT-01C: Ineffectual Usage of Safe Arithmetics

Description:

The linked mathematical operations are guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.

Example:

src/HedgeVault.sol
172_totalDeposits = (_totalDeposits > assets)
173? _totalDeposits - assets
174: 0;

Recommendation:

Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statements to be wrapped in unchecked code blocks thereby optimizing their execution cost.

Alleviation (eb8a76b31db4a988b7437048e5866795f978ff91):

Both arithmetic operations have been safely wrapped in unchecked code blocks, optimizing their gas costs.

HVT-02C: Redundant Parenthesis Statements

TypeSeverityLocation
Code StyleHedgeVault.sol:L172, L192

Description:

The referenced statements are redundantly wrapped in parenthesis' (()).

Example:

src/HedgeVault.sol
172_totalDeposits = (_totalDeposits > assets)

Recommendation:

We advise them to be safely omitted, increasing the legibility of the codebase.

Alleviation (eb8a76b31db4a988b7437048e5866795f978ff91):

The redundant parenthesis in the referenced statements have been safely omitted.