Omniscia Tren Finance Audit

ConfigurableAddresses Code Style Findings

ConfigurableAddresses Code Style Findings

CAS-01C: Non-Standard Definition of Gap

Description:

The __gap variable is meant to adhere to the OpenZeppelin upgradeable gap convention but utilizes an incorrect length of 33.

Example:

contracts/Dependencies/ConfigurableAddresses.sol
8address public adminContract;
9address public borrowerOperations;
10address public communityIssuance;
11address public debtToken;
12address public feeCollector;
13address public flashLoanAddress;
14address public trenStaking;
15address public priceFeed;
16address public sortedTrenBoxes;
17address public stabilityPool;
18address public timelockAddress;
19address public treasuryAddress;
20address public trenBoxManager;
21address public trenBoxManagerOperations;
22address public trenBoxStorage;
23
24bool public isAddressSetupInitialized;
25
26/**
27 * @dev This empty reserved space is put in place to allow future versions to add new
28 * variables without shifting down storage in the inheritance chain.
29 * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
30 */
31uint256[33] private __gap; // Goerli uses 47; Arbitrum uses 33

Recommendation:

Given that the contract utilizes 15 slots, we advise the __gap length to be set to 35 so as to properly sum up to 50 per the de-facto standard.

Alleviation (f6f1ad0b8f24a96ade345db1dd05a1878eb0f761):

The __gap variable has been properly configured to 35, addressing this exhibit.

CAS-02C: Repetitive Value Literal

Description:

The linked value literal is repeated across the codebase multiple times.

Example:

contracts/Dependencies/ConfigurableAddresses.sol
46if (_addresses.length != 13) {

Recommendation:

We advise it to be set to a constant variable instead, optimizing the legibility of the codebase.

In case the constant has already been declared, we advise it to be properly re-used across the code.

Alleviation (f6f1ad0b8f24a96ade345db1dd05a1878eb0f761):

The referenced value literal 13 has been properly relocated to a contract-level constant declaration labelled MAX_LENGTH, optimizing the code's legibility.