BFK WARZONE-Addendum Ⅱ

CertiKFiles named in the report

CertiK reviewed BFK WARZONE (BFK WARZONE-Addendum Ⅱ) on 13 Sep 2022: 17 findings, 0 critical; 1 marked fixed, 4 acknowledged, 12 open.

No open critical findings
Open the reportOpen BFK WARZONE’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings17

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High030
Medium011
Low1200
LowAddress Not Excluded From Fees And Max TransactioOpen

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.

LowDuplicate CodeOpen

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`.

LowFinancial ModelsOpen

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.

LowMissing Emit EventsOpen

There should always be events emitted in the sensitive functions that are controlled by centralization roles.

LowMissing Error MessagesOpen

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.

LowMissing Exclude `owner` From LimitationOpen

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.

LowPotential Sandwich AttacksOpen

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) ```

LowThird Party DependenciesOpen

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.

LowUncheck Value Of `address.call()`Open

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.

LowUnnecessary Calling `transferOwnership` in ConstrOpen

During the construction of `BFK` contract, `newOwner` equals to `_owner`, it's unnecessary to call function `transferOwnership()` in line #429.

Show 2 more
LowUnused EventsOpen

The following events are declared but not used. ```solidity=351 event UpdatedMaxWalletAmount(uint256 newAmount); ``` ```solidity=369 event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity); ```

LowVariables That Could Be Declared as ImmutableOpen

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.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (1)

  • contracts/BFK_ETH.sol

Part of BFK WARZONE’s security record

BFK WARZONE
Audits2 audits by 1 firmLast audit Sep 2022, by CertiK.
Critical findingsNo open critical findingsAcross 2 reports.
Open BFK WARZONE’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 reports · latest May 2025

See CertiK’s audits

Something 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