Omniscia Native Audit

CallbackValidation Code Style Findings

CallbackValidation Code Style Findings

CVN-01C: Inefficient Named Return Variable

TypeSeverityLocation
Gas OptimizationCallbackValidation.sol:L16, L18

Description:

The verifyCallback function contains a named return argument labelled verifiedPool that is assigned to at the end of the function.

Example:

contracts/libraries/CallbackValidation.sol
13function verifyCallback(
14 address factory,
15 address pool
16) internal view returns (IPool verifiedPool) {
17 require (INativeFactory(factory).verifyPool(pool));
18 verifiedPool = IPool(pool);
19}

Recommendation:

This paradigm is ill-advised as the function will reserve an in-memory space for the verifiedPool value which remains unused in the function. We advise it to be omitted and the IPool(pool) statement to be yielded directly via a return statement by the function.

Alleviation:

The verifierPool named return argument has been omitted with the function yielding the IPool(pool) value directly via a return statement as advised.

CVN-02C: Inexistent Error Message

TypeSeverityLocation
Code StyleCallbackValidation.sol:L17

Description:

The linked require check has no error message explicitly defined.

Example:

contracts/libraries/CallbackValidation.sol
17require (INativeFactory(factory).verifyPool(pool));

Recommendation:

We advise one to be set so to increase the legibility of the codebase and aid in validating the require check's condition.

Alleviation:

An error message has been adequately introduced to the referenced require check.