Omniscia Vector Finance Audit

Locker Code Style Findings

Locker Code Style Findings

LOC-01C: Inexistent Error Messages

TypeSeverityLocation
Code StyleInformationalLocker.sol:L71-L73, L105

Description:

The linked require checks have no error messages explicitly defined.

Example:

contracts/Locker.sol
105require(IERC20(lockToken).transfer(msg.sender, _amount));

Recommendation:

We advise them to be set so to aid in the validation of the require's condition as well as the legibility of the codebase.

Alleviation:

Although the linked statements were omitted, a new require check was introduced that still does not contain an error message.

LOC-02C: Inexistent Visibility Specifier

TypeSeverityLocation
Code StyleInformationalLocker.sol:L25

Description:

The linked variable has no visibility specifier explicitly set.

Example:

contracts/Locker.sol
24mapping(address => userDeposit[]) public userDeposits;
25mapping(address => uint256) depositNumbers;

Recommendation:

We advise one to be set so to avoid potential compilation discrepancies in the future as the default behaviour is for the compiler to assign one automatically which may change in future pragma versions.

Alleviation:

The public visibility specifier was introduced for the linked variable.

LOC-03C: Variable Mutability Optimization

TypeSeverityLocation
Gas OptimizationInformationalLocker.sol:L10, L12, L32, L34

Description:

The linked variables are assigned to only once during the contract's constructor.

Example:

contracts/Locker.sol
27constructor(
28 address _lockToken,
29 uint256 _lockTime,
30 uint256 _maxDeposits
31) baseERC20("Locked VTX", "LVTX") {
32 lockToken = _lockToken;
33 lockTime = _lockTime;
34 maxDeposits = _maxDeposits;
35}

Recommendation:

We advise them to be set as immutable greatly optimizing their gas cost.

Alleviation:

The variable mutability for the first variable was optimized however the second variable had a setter function introduced thereby alleviating this exhibit in full.