CertiK reviewed LFGSwap on 21 Oct 2022: 18 findings, 0 critical; none marked fixed.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 3 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 15 | 0 | 0 |
In the contract `LfgSwapFactory` the role `feeToSetter` has authority over the functions shown in the diagram below. Any compromise to the `feeToSetter` account may allow the hacker to take advantage of this authority and set `feeTo`. 
In the contract `LfgToken` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and add or delete `Minter` role.  In the contract `LfgToken`, the role `_minters` has authority over the `mint()` function. Any compromise to the `_minters` account may allow a hacker to take advantage of this authority and mint new tokens.
Tokens are sent to `msg.sender` when deploying the contract. This could be a centralization risk as the `msg.sender` can distribute tokens without obtaining the consensus of the community.
Commented out code is redundant.
The call to `burn()` function will fail if the value of `_totalSupply` is 0.
The functions which are never called internally within the contract should have external visibility for gas optimization.
Based on the coefficient `mul(2)` and based on the formula at 2.4 of https://uniswap.org/whitepaper.pdf, the correct fee is equivalent to 1/3th.
In function `_burn()`, `_approve()` and `_transfer()`, addresses should be checked before assigning to make sure they are not zero addresses.
Addresses should be checked before assignment or external call to make sure they are not zero addresses.
In the function `LfgToken.getMinter()`, the input `_index` is checked to ensure the index is valid. However, it is possible that `getMinterLength() == 0` which might lead to integer underflow in the calculation: ```solidity=43 require(_index <= getMinterLength() - 1, "JfToken: index out of bounds"); ```
In the `swap` function, the `require(amount0Out > 0 || amount1Out > 0, 'LfgSwap: INSUFFICIENT_OUTPUT_AMOUNT');` will always be satisfied due to the condition `if( amount0Out > 0 || amount1Out > 0 )`.
The `IMigrator` and `ISwapMining` interfaces are not used by other code.
There is a typo in the file name `SafaMath.sol`.
There is a typos in `require` messages: - `UniswapV2Library` expected `LfgSwapLibrary`; - `UniswapV2` expected `LfgSwap`. - `JfToken` expected `LfgToken`
The following import file is not used in the audit files: ````Solidity=3 import "@openzeppelin/contracts/access/Ownable.sol"; ````
The library `FixedPoint` is never used within the project and thus can be removed.
The linked functions are equivalent to the compiler-generated getter functions for the respective variables.
The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (16)
1,044 projects reviewed · 1,375 reports · latest May 2025
See CertiK’s auditsSomething wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.
Tell us