Omniscia Ultra Yield Audit

BaseControlledAsyncRedeem Code Style Findings

BaseControlledAsyncRedeem Code Style Findings

BCA-01C: Non-Standard Usage of Library

TypeSeverityLocation
Code StyleBaseControlledAsyncRedeem.sol:
I-1: L389-L394
I-2: L543
I-3: L803
I-4: L886

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:

src/vaults/BaseControlledAsyncRedeem.sol
388// Need to transfer before minting or ERC777s could reenter
389SafeERC20.safeTransferFrom(
390 IERC20(_asset),
391 msg.sender,
392 address(this),
393 assets
394);

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.

BCA-02C: Redundant External Self-Calls

TypeSeverityLocation
Gas OptimizationBaseControlledAsyncRedeem.sol:
I-1: L791
I-2: L794
I-3: L803
I-4: L886

Description:

The referenced statements will perform external self-calls which are inefficient and redundant.

Example:

src/vaults/BaseControlledAsyncRedeem.sol
791require(IERC20(address(this)).balanceOf(owner) >= shares, InsufficientBalance());

Recommendation:

We advise the relevant functions to be invoked directly internally, optimizing their gas cost.

Alleviation (28f2785396):

While the exhibit has been partially addressed, instances 3 and 4 remain unaddressed as they continue to perform an external self-call.

Alleviation (2d9651dbd7):

The remaining two self-call instances have been optimized per our recommendation, addressing this exhibit in full.