Omniscia BlazeSwap Audit

BlazeSwapFtsoReward Static Analysis Findings

BlazeSwapFtsoReward Static Analysis Findings

BFR-01S: Illegible Numeric Value Representation

Description:

The linked representation of a numeric literal is sub-optimally represented decreasing the legibility of the codebase.

Example:

contracts/core/BlazeSwapFtsoReward.sol
47return (amount * 981) / 1000; // 1.9% fee (cannot overflow)

Recommendation:

To properly illustrate the value's purpose, we advise the following guidelines to be followed. For values meant to depict fractions with a base of 1e18, we advise fractions to be utilized directly (i.e. 1e17 becomes 0.1e18) as they are supported. For values meant to represent a percentage base, we advise each value to utilize the underscore (_) separator to discern the percentage decimal (i.e. 10000 becomes 100_00, 300 becomes 3_00 and so on). Finally, for large numeric values we simply advise the underscore character to be utilized again to represent them (i.e. 1000000 becomes 1_000_000).

Alleviation:

While the function has been slightly refactored, the value literals representing percentages are now properly separated by the underscore (_) character where their decimal percentage denomination begins thus alleviating this exhibit.

BFR-02S: Redundant Argument Definition

Description:

The initialize call does not override any interface and contains an unnamed input variable.

Example:

contracts/core/BlazeSwapFtsoReward.sol
44function initialize(address) external onlyDelegatedCall {}

Recommendation:

We advise the input variable to be omitted entirely as it serves no use to the contract. Alternatively, if compliance with the IIBlazeSwapPluginImpl is expected, we advise it to be inherited and overridden appropriately.

Alleviation:

The BlazeSwap team stated that the function is meant to implement the interface defined by IIBlazeSwapPluginImpl that is in turn extended by IIBlazeSwapReward that the contract in question is meant to conform to. We advised the override keyword to be put in place, however, the BlazeSwap team stated that they do not wish to add it as it is a simple empty function definition. In any case, the correct interfaces are inherited and the initialize function needs to exist thus rendering this exhibit nullified.