Omniscia AmpleSense Audit

AmplesenseVault Code Style Findings

AmplesenseVault Code Style Findings

AVT-01C: Non-Standard ERC-20 Transfer Invocation

TypeSeverityLocation
Code StyleInformationalAmplesenseVault.sol:L348

Description:

The _rebase function executes a transfer invocation wrapped by a require statement when the contract system already imports and utilizes the SafeERC20 library.

Example:

contracts/AmplesenseVault.sol
348require(eefi_token.transfer(treasury, eefi_token.balanceOf(address(this))), "AmplesenseVault: Treasury transfer failed");

Recommendation:

We advise the safeTransfer function to be utilized instead of the current paradigm to ensure consistency within the codebase.

Alleviation:

The safeTransfer function of the SafeERC20 library is now properly utilized.

AVT-02C: Variable Mutability Specifiers

TypeSeverityLocation
Gas OptimizationInformationalAmplesenseVault.sol:L25, L26, L27, L99, L100, L101

Description:

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

Example:

contracts/AmplesenseVault.sol
96constructor(IERC20 ampl_token)
97AMPLRebaser(ampl_token)
98Ownable() {
99 eefi_token = new EEFIToken();
100 rewards_eefi = new Distribute(9, IERC20(eefi_token));
101 rewards_eth = new Distribute(9, IERC20(0));
102}

Recommendation:

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

Alleviation:

The exhibit has been partially alleviated by introducing the immutable specifier for the latter two of the three linked variables, however, we consider it adequately dealt with as the Amplesense team opted to retain the eefi_token mutable.