Omniscia Tren Finance Audit

TrenBoxManagerOperations Code Style Findings

TrenBoxManagerOperations Code Style Findings

TBO-01C: Redundant Code Branches

Description:

The referenced if-else blocks will evaluate a bool variable and set a different bool literal argument to each call contained within.

Example:

contracts/TrenBoxManagerOperations.sol
688if (_fullRedistribution) {
689 singleLiquidation = _liquidateNormalMode(
690 _asset, vars.user, vars.remainingDebtTokenInStabPool, true
691 );
692} else {
693 singleLiquidation = _liquidateNormalMode(
694 _asset, vars.user, vars.remainingDebtTokenInStabPool, false
695 );
696}

Recommendation:

We advise each call to be performed directly and its last argument to be set as the _fullRedistribution variable directly, optimizing the code's gas cost.

Alleviation (f6f1ad0b8f24a96ade345db1dd05a1878eb0f761):

The code was refactored as advised, optimizing its gas cost by performing a single statement with a dynamic bool argument.

TBO-02C: Redundant Parenthesis Statements

Description:

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

Example:

contracts/TrenBoxManagerOperations.sol
850(_ICR > IAdminContract(adminContract)._100pct())

Recommendation:

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

Alleviation (f6f1ad0b8f):

All but the final parenthesis statements have been omitted, rendering this exhibit partially addressed.

Alleviation (73b9546eb9):

The redundant parenthesis from the last statement has been omitted as well, addressing this exhibit in full.