Omniscia BlazeSwap Audit
BlazeSwapRouter Code Style Findings
BlazeSwapRouter Code Style Findings
BSR-01C: Incorrect Assumptions of Gas Usage
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | BlazeSwapRouter.sol:L113, L157, L218, L305, L320, L337, L353, L415, L434 |
Description:
The linked statements labelled as "gas savings" are incorrect as they are caching an immutable value (which is swapped as a literal by the compiler) to a local variable, thus ultimately incurring an increase in gas.
Example:
113address _wNat = wNat; // gas savingsRecommendation:
We advise the statements to be omitted and the wNat variable to be used directly in all instances to properly optimize the codebase.
Alleviation:
All incorrect gas optimizations have been properly reverted from the codebase as advised.
BSR-02C: Ineffectual Usage of Safe Arithmetics
| Type | Severity | Location |
|---|---|---|
| Language Specific | ![]() | BlazeSwapRouter.sol:L127, L360 |
Description:
The linked mathematical operations are guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.
Example:
127if (msg.value > amountNAT) TransferHelper.safeTransferNAT(msg.sender, msg.value - amountNAT);Recommendation:
Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statements to be wrapped in unchecked code blocks thereby optimizing their execution cost.
Alleviation:
The BlazeSwap team considered this exhibit but opted not to apply a remediation for it as they have stated they will not remediate any issues of minor severity and below.
BSR-03C: Inexplicable Code Deviation
| Type | Severity | Location |
|---|---|---|
| Standard Conformity | ![]() | BlazeSwapRouter.sol:L122 |
Description:
The linked statement invokes the pairFor function of BlazeSwapLibrary whilst in all other instances the public function pairFor is invoked instead which performs the same statement.
Example:
122address pair = BlazeSwapLibrary.pairFor(factory, token, _wNat);Recommendation:
We advise the pairFor function to be invoked in this instance as well to streamline the codebase's style.
Alleviation:
The proper pairFor function similarly to the rest of the contract's code is now invoked in the referenced statement alleviating this exhibit.
