Omniscia AmpleSense Audit

Pioneer1Vault Static Analysis Findings

Pioneer1Vault Static Analysis Findings

PVT-01S: Unused Local Variable

TypeSeverityLocation
Gas OptimizationInformationalPioneer1Vault.sol:L51

Description:

The linked variable remains unused in the codebase.

Example:

contracts/Pioneer1Vault.sol
49if(new_supply > old_supply) {
50 //only for positive rebases
51 uint256 balance = _ampl_token.balanceOf(address(this));
52
53 uint256 change_ratio_18digits = old_supply.mul(10**18).divDown(new_supply);
54 uint256 surplus = new_balance.sub(new_balance.mul(change_ratio_18digits).divDown(10**18));
55 uint256 to_sell = _toSell(surplus);
56 _ampl_token.approve(address(trader), to_sell);
57
58 trader.sellAMPLForEth(to_sell);
59 //this checks that after the sale we're still above threshold
60 require(_ampl_token.balanceOf(address(this)) >= SELL_THRESHOLD, "Pioneer1Vault: Threshold isnt reached yet");
61 stakingContractEth.distribute{value : address(this).balance}(0, address(this));
62}

Recommendation:

We advise it to be safely omitted.

Alleviation:

The local variable has been omitted from the codebase safely.