CertiK reviewed BFK WARZONE (BFK WARZONE-Addendum Ⅱ) on 13 Sep 2022: 17 findings, 0 critical; 1 marked fixed, 4 acknowledged, 12 open.
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 | 0 | 3 | 0 |
| Medium | 0 | 1 | 1 |
| Low | 12 | 0 | 0 |
The following functions are used to set a new value for the specific address. - setOperationsAddress - setDevAddress - setTeamAddress - setStakingAddress - setLiquidityAddress However, these addresses defined in the constructor of `BFK` contract are excluded from `_excludeFromMaxTransaction` and `excludeFromFees`.\ To be consistent, the same logic should be added in these setXXX functions.
In the constructor of `BFK` contract, these four addresses named `operationsAddress`, `devAddress`,`ecosystemAddress` and `liquidityAddress` are defined as the same address which are excluded multiple times.\ The mentioned lines are duplicate as the defined address are already excluded. Besides, function `setAutomatedMarketMakerPair` emits `SetAutomatedMarketMakerPair` event in line #526 which is also called in the internal function `_setAutomatedMarketMakerPair`.
The `BFK` is a decentralized finance(DeFi) token deployed on Ethereum with financial models as below: **Financial Models** * Total supply `BFK` token is one billion once deployed which is all set to the owner. * Before the trading is active, transaction is allowed if either the sender or the recipient is excluded from fees. * Before all transfers can take place on the platform, trading must be activated by the owner. * Once trading is allowed, it can never be disallowed. * Some limitations like buy/sell maximum amount are enforced within a transaction if limit setting was opened. * There is Total Fee accumulated by Operation, Liquidity, Dev, Team and Staking fees on all transfers if neither the sender nor the recipient is excluded from fees. * The Total Fee charged during transfers is transferred to the contract address during transaction. Some of these tokens are swapped for ETH only and if only: * The automatic token swapping functionality is enabled by the team; * The minimum tokens(determined by the owner) in the contract address is reached; * Current transfer is not in swapping; * The caller is not initiating a purchase transaction via `Uniswap`; * Neither the sender nor the recipient is excluded from fees. * Half of liquidity tokens accumulated based on proportion of Liquidity in Total Fee is used to add liquidity. * The remaining tokens excluding the proportion of half liquidity in the contract address is used to swap ETH. * The received ETH is split between: * Operation: calculated according to the proportion of Operation tokens in the remaining tokens, the ETH is transferred to Operation address; * Dev: calculated according to the proportion of Dev tokens in the remaining tokens, the ETH is transferred to Dev address; * Liquidity: the remaining ETH excluding Operation and Dev will be used to add liquidity. * The accumulated the `BFK` tokens based on proportion of Team in Total Fee are transferred to the Team address. * The accumulated the `BFK` tokens based on proportion of Staking in Total Fee are transferred to the Staking address. * The owner can change all the fee rates.
There should always be events emitted in the sensitive functions that are controlled by centralization roles.
The **require** can be used to check for conditions and throw an exception if the condition is not met. It is better to provide a string message containing details about the error that will be passed back to the caller.
By default, the `owner` address is excluded from fee. ```solidity=412 _excludeFromMaxTransaction(newOwner, true); ``` ```solidity=420 excludeFromFees(newOwner, true); ``` When the `owner` is renounced or transferred, the deprecated should be included to and the new owner should be excluded from the fee.
A sandwich attack might happen when an attacker observes a transaction swapping tokens or adding liquidity without setting restrictions on slippage or minimum output amount. The attacker can manipulate the exchange rate by frontrunning (before the transaction being attacked) a transaction to purchase one of the assets and make profits by backrunning (after the transaction being attacked) a transaction to sell the asset. The following functions are called without setting restrictions on slippage or minimum output amount, so transactions triggering these functions are vulnerable to sandwich attacks, especially when the input amount is large: ```solidity=668 function swapTokensForEth(uint256 tokenAmount) ``` ```solidity=695 function addLiquidity(uint256 tokenAmount, uint256 ethAmount) ```
The contract is serving as the underlying entity to interact with third party Uniswap protocol. The scope of the audit treats 3rd party entities as black boxes and assumes the functional correctness. However, in the real world, 3rd parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of 3rd parties can possibly create severe impacts, such as increasing fees of 3rd parties, migrating to new LP pools, etc.
The linked statement transfers the native token leftovers in `BFK` contract. Because the `address.call()` function may return false if the aforementioned transaction is failed, the local variable `success` should be checked and revert the transaction if failed.
During the construction of `BFK` contract, `newOwner` equals to `_owner`, it's unnecessary to call function `transferOwnership()` in line #429.
The following events are declared but not used. ```solidity=351 event UpdatedMaxWalletAmount(uint256 newAmount); ``` ```solidity=369 event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity); ```
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 (1)
1,045 projects reviewed · 1,376 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