Omniscia Pareto Audit

ParetoVesting Code Style Findings

ParetoVesting Code Style Findings

PVG-01C: Ineffectual Usage of Safe Arithmetics

TypeSeverityLocation
Language SpecificParetoVesting.sol:
I-1: L152
I-2: L201
I-3: L231
I-4: L232

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/vesting/ParetoVesting.sol
152return (vested <= entry.totalClaimed) ? 0 : vested - entry.totalClaimed;

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:

The Pareto team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.

PVG-02C: Inefficient Comparison

Description:

The referenced comparison is inefficient as the cliffTimestamp is guaranteed to be greater-than-or-equal-to the value of the startTimestamp.

Example:

src/vesting/ParetoVesting.sol
228if (currentTime <= startTimestamp || currentTime < cliffTimestamp) return initialUnlock;

Recommendation:

We advise a single comparison to be made, optimizing the code's gas cost.

Alleviation:

The comparison was optimized per our recommendation.