BKOKFi audit reports

BNB Chainbkokfi.comX

BKOKFi has 2 public audit reports from CertiK; the latest is CertiK, 13 Nov 2024; no critical findings reported. It also holds 2 deployed contracts on 1 chain.

Critical findings
No open critical findings
Across 2 reports.
Open the latest report
Your label, live
Get the label for your site

Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.

Open findings across every firm13

Statuses are the security firms’ own

13 findings are still open or acknowledged in the firms’ reports: 1 high, 3 medium, 9 low (all open).

High
1
Medium
3
Low
9
  • High Open

    Potential Sandwich Attacks

    BKOKLPLock · CertiK · 13 Nov 2024 · Report ↗

  • Medium Open

    Potential Front-run on Permit Call to cause DOS

    BKOKLPLock · CertiK · 13 Nov 2024 · Report ↗

  • Medium Open

    Incorrect Fee Calculation Prevents ETH Withdrawal

    BKOK · CertiK · 29 Sep 2024 · Report ↗

  • Medium Open

    Potential Concerns Due to Auto Pair Burning Mecha

    BKOK · CertiK · 29 Sep 2024 · Report ↗

  • Low Open

    Emit Mistakenly

    BKOKLPLock · CertiK · 13 Nov 2024 · Report ↗

  • Low Open

    Inaccessible Functions

    BKOKLPLock · CertiK · 13 Nov 2024 · Report ↗

  • Low Open

    Missing Error Messages

    BKOKLPLock · CertiK · 13 Nov 2024 · Report ↗

  • Low Open

    Potential Reentrancy Attack

    BKOKLPLock · CertiK · 13 Nov 2024 · Report ↗

  • Low Open

    Confirmation of Withdrawable ETH Calculation

    BKOK · CertiK · 29 Sep 2024 · Report ↗

  • Low Open

    Missing Input Validation

    BKOK · CertiK · 29 Sep 2024 · Report ↗

All 13 open and acknowledged findings

Audits2

Newest first

ReportSecurity firmDateScopeCritical findingsFindingsSource
BKOKLPLockSecurity firm: CertiKDate: Scope: 1 address on BNB ChainNone openFindings: 2 high · 1 medium · 4 low
1 fixed · 6 open
Original removed
BKOKSecurity firm: CertiKDate: Scope: 1 address on BNB ChainNone openFindings: 2 high · 2 medium · 6 low
3 fixed · 7 open
Original removed

Findings17

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

SeverityOpenAcknowledgedFixed
Critical000
High103
Medium300
Low901
HighPotential Sandwich AttacksBKOKLPLock · CertiK · 13 Nov 2024Open

The current design of the `BKOKLPLock` contract lacks a staking period, enabling users to stake and withdraw `LP` tokens at any time. This allows an attacker to monitor the mempool, add liquidity, and stake a substantial amount of `LP` tokens just before an account distributes dividends via the `distributeTokenDividends()` function. By paying a higher gas fee, they can prioritize their transaction, immediately withdraw, and remove liquidity following the dividend distribution. Due to the absence of a staking period, the attacker can execute this operation within a single block, claiming the majority of the dividend. Flashloans can be used to maximize profit. ```solidity function _stake(uint value) private { uint256 balance = dividend.balanceOf(_msgSender()); lpToken.transferFrom(_msgSender(), address(this), value); balance += value; dividend.setBalance(_msgSender(), balance); } function stake(uint value) external { require(value > 0); _stake(value); } ... function withdraw(uint value) external { uint256 balance = dividend.balanceOf(_msgSender()); if (value == 0) { value = balance; } require(balance >= value && value > 0, "value > 0"); balance -= value; dividend.setBalance(_msgSender(), balance); lpToken.transfer(_msgSender(), value); } function distributeTokenDividends() external payable { require(msg.value > 0); try dividend.distributeTokenDividends{value: msg.value}() {} catch { payable(_msgSender()).transfer(msg.value); } try dividend.process(gasForProcessing) {} catch {} } ```

Open the report
MediumPotential Front-run on Permit Call to cause DOSBKOKLPLock · CertiK · 13 Nov 2024Open

Contracts interfacing with ERC20 tokens may implement a feature in the `stakePermit()` function where users provide signatures to approve `lpToken` transfers, subsequently invoking the `permit()` function to finalize the approval. However, the contract fails to address the possibility of transaction front-running, where an unauthorized party could preemptively execute the `permit()` function before the intended transaction is processed. If malicious actors observe this process, they can preemptively execute the `permit()` function with the user's signature and nonce. This unauthorized front-running as a griefing attack not only consumes the nonce, rendering the legitimate user's intended transaction invalid but also can lead to a targeted Denial of Service (DOS) for the affected function, as the user's approval process is effectively disrupted. ```solidity function stakePermit( uint value, uint deadline, uint8 v, bytes32 r, bytes32 s ) external { require(value > 0); //Approve lpToken.permit(_msgSender(), address(this), value, deadline, v, r, s); _stake(value); } ```

Open the report
MediumIncorrect Fee Calculation Prevents ETH WithdrawalBKOK · CertiK · 29 Sep 2024Open

The `BKOK` token contract contains a logic flaw in the `_transfer` function's fee calculation logic, which inadvertently restricts ETH withdrawals to only those accounts that are excluded from fees. This issue arises from an incorrect computation of the fee, leading to the fee exceeding the transfer amount and causing the transaction to revert due to underflow. The fee is calculated using the formula `(amount * feeBase) / feeTotal`. ```solidity=170 if (!isExcludeFee(from)) { @> uint256 fee = (amount * feeBase) / feeTotal; super._transfer(from, address(this), fee); amount -= fee; } ``` In the contract, the `feeBase` is equal to 10000, and the `feeTotal` is 1500, so the calculated `fee` equates to `(amount * 10000) / 1500 ≈ 6.6667 * amount`. Subtracting a fee larger than the `amount` leads to an underflow, causing the transaction to revert in the whole transaction.

Open the report
MediumPotential Concerns Due to Auto Pair Burning MechaBKOK · CertiK · 29 Sep 2024Open

In the `BKOK` token contract, two types of trading pairs exist: `WBNB-BKOK` and `USDT-BKOK`. Selling operations within either pair can trigger an automatic burning of `BKOK` tokens from the `WBNB-BKOK` pair. The tokens burned are transferred to the contract itself, potentially initiating subsequent swap operations. Notably, these burn and swap activities are confined to the `WBNB-BKOK` pool. Thus, when `BKOK` tokens are sold in the `USDT-BKOK` pool, it impacts the price in the `WBNB-BKOK` pool as well. This strategy appears designed to stabilize the prices across various BKOK pools. ```solidity=115 if (_autoPair[to]) { autoBurnUniswapPair(); if (!swapIng) { swapIng = true; swapTokenForFee(); swapIng = false; } } ``` ```solidity=315 function autoBurnUniswapPair() internal { if (block.timestamp - lastLpBurnTime > lpBurnFrequency) { burnPair(pairETH); lastLpBurnTime = block.timestamp; } } function burnPair(address _pair) internal returns (bool) { uint256 liquidityPairBalance = balanceOf(_pair); uint256 amountToBurn = (liquidityPairBalance * percentForLPBurn) / percentDiv; if (amountToBurn > 0) { super._transfer(_pair, address(this), amountToBurn); IPancakePair(_pair).sync(); emit AutoNukeLP( liquidityPairBalance, amountToBurn, block.timestamp ); return true; } return false; } } ``` However, it's important to note that selling in the `WBNB-BKOK` pool does not affect the `USDT-BKOK` pool's price. We have some concerns for the auto pair burning mechanism: 1. **Arbitrage Trade**: Should the `BKOK` price in the `WBNB-BKOK` pool be substantially lower compared to its price in the `USD-BKOK` pool, an opportunity for arbitrage trading arises. 2. **Potential Loss for Liquidity Providers**: During the process of auto burning and swapping, the reserves of `WBNB-BKOK` could decrease, resulting in a loss for liquidity providers. We would like to confirm whether the design was intentional.

Open the report
LowEmit MistakenlyBKOKLPLock · CertiK · 13 Nov 2024Open

If the low level `call()` at Line 285 is failed and returns false, the if-clause at Line 289~294 will handle the failure situation. Although the value of `withdrawnDividends[user]` is updated again at Line 290, the event with wrong value at Line 283 has been emitted already. ```solidity=277 function _withdrawDividendOfUser(address user) internal returns (uint256) { uint256 _withdrawableDividend = withdrawableDividendOf(user); if (_withdrawableDividend > 0) { withdrawnDividends[user] = withdrawnDividends[user].add( _withdrawableDividend ); emit DividendWithdrawn(user, _withdrawableDividend); (bool success, ) = payable(user).call{value: _withdrawableDividend}( new bytes(0) ); if (!success) { withdrawnDividends[user] = withdrawnDividends[user].sub( _withdrawableDividend ); return 0; } return _withdrawableDividend; } return 0; } ```

Open the report
LowInaccessible FunctionsBKOKLPLock · CertiK · 13 Nov 2024Open

The `BKOKLPLock` contract, the owner of the `BABTOKENDividendTracker` contract, does not provide entry points to invoke the `excludeFromDividends()` and `updateClaimWait()` functions. As a result, these functions within the `BABTOKENDividendTracker` contract become inaccessible and therefore unusable. ```solidity function excludeFromDividends(address account) external onlyOwner { if (!excludedFromDividends[account]) { excludedFromDividends[account] = true; _setBalance(account, 0); tokenHoldersMap.remove(account); emit ExcludeFromDividends(account); } } function updateClaimWait(uint256 newClaimWait) external onlyOwner { require( newClaimWait >= 3600 && newClaimWait <= 86400, "Dividend_Tracker: claimWait must be updated to between 1 and 24 hours" ); require( newClaimWait != claimWait, "Dividend_Tracker: Cannot update claimWait to same value" ); emit ClaimWaitUpdated(newClaimWait, claimWait); claimWait = newClaimWait; } ```

Open the report
LowMissing Error MessagesBKOKLPLock · CertiK · 13 Nov 2024Open

`require()` statements should include a descriptive message that explains the unmet condition, aiding in the easy identification of the problem.

Open the report
LowPotential Reentrancy AttackBKOKLPLock · CertiK · 13 Nov 2024Open

The `call()` method can lead to reentrancy issues. Since `call()` is a low-level function, it does not automatically handle control flow returns, which may allow an attacker to re-enter your contract during its execution. When using `call()`, it's important to be cautious of reentrancy attacks by employing strategies like the checks-effects-interactions pattern or using mutex locks (such as ReentrancyGuard) to protect your contract.

Open the report
LowConfirmation of Withdrawable ETH CalculationBKOK · CertiK · 29 Sep 2024Open

The `withdrawETH` function in the `BKOK` contract uses a specific formula to calculate the amount of withdrawable ETH based on the proportion of the tokens being transferred relative to the total adjusted token supply. This adjusted supply is computed as the total supply minus the tokens held by the dead address and the tokens in both the WBNB-BKOK and USD-BKOK liquidity pairs, adjusted further by adding the amount being transferred. ```solidity=175 uint256 outETH = getWithdrawOut(amount); super._transfer(from, address(0xdead), amount); ``` The logic here is first to calculate the amount of ETH corresponding to the input tokens (`amount`) and then transfer the `amount` of BKOK tokens to a dead address, effectively removing them from circulation. The `getWithdrawOut` function uses the formula: ```solidity (uint256 amountIn * address(this).balance) / (totalSupply() - balanceOf(address(0xdead)) - balanceOf(pairETH) - balanceOf(pairUSDT) + amountIn) ``` Here, `amountIn` is the amount of BKOK tokens that the user wants to withdraw as ETH. The calculation slightly disadvantages the user by providing less ETH than might be expected from a straightforward proportional withdrawal based on the tokens' current position in the supply metrics. This occurs because the formula anticipates the transfer of tokens to the dead address before it actually happens, impacting the amount of ETH received. This looks reasonable from the `getWithdrawOut` function as it may consider divide by zero error. We ant to confirm whether the current implementation is intended.

Open the report
LowMissing Input ValidationBKOK · CertiK · 29 Sep 2024Open

In the `multiTransfer()` function, multiple amounts are transferred to multiple addresses within a single function call. Therefore, the elements of the `addrs` and `amounts` arrays must correspond one-to-one, and their lengths must match.

Open the report
Show 3 more
LowPotential Concerns with Project DesignBKOK · CertiK · 29 Sep 2024Open

We would like to confirm whether these designs align with the intended functionality: - In the `BKOK` contract, it is noted that the contract accumulates transfer fees and periodic auto burning from `BNB-BKOK` pair and converts them into native coins (BNB), which are then deposited into the contract. According to the on-chain configuration, 20% of this ETH is allocated to a marketing address, 30% is designated for burning, and the remaining 50% stays within the contract. It is noted that only accounts that are exempt from fees have the capability to withdraw these BNB. - Based on the on-chain status of the `BKOK` contract, once the owner renounces their permissions, the `addLiquidity` function can no longer be executed. This implies that unless users actively add liquidity, the liquidity of the pair contract will not increase. If most users only trade one type of token within the pair, this could lead to significant price fluctuations for that token, adversely affecting normal transactions.

Open the report
LowPotential Sandwich AttacksBKOK · CertiK · 29 Sep 2024Open

A sandwich attack can occur when an attacker notices a transaction involving token swaps or liquidity additions that lacks slippage restrictions or minimum output amount settings. The attacker can exploit this by frontrunning the transaction to purchase one of the assets, thereby manipulating the exchange rate, and then backrunning the transaction to sell the asset for a profit. The referenced functions are invoked without setting slippage restrictions or minimum output amounts, making transactions that trigger these functions particularly vulnerable to sandwich attacks, especially when large input amounts are involved.

Open the report
LowUnchecked Low-level CallBKOK · CertiK · 29 Sep 2024Open

The low-level `call` function returns the status of the call as first variable in the returned tuple. The status of the `call` is not asserted to be `true`, which would treat the low-level call as a success even when it reverted. ```solidity=44 function _safeTransferETH(address to, uint value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); if (success) {} } ```

Open the report

Contracts2

AddressChainSource code
0x9cc484ded7a7851a03f05a03e8d19eb5f5a73f20Chain: BNB ChainSource code: Verified source
0x8001beca8399202dc4db0f470101a8ae11287ad1Chain: BNB ChainSource code: Verified source

BKOKFi: questions

Is BKOKFi audited?

Trustblock holds 2 public audit reports for BKOKFi, dated 29 Sep 2024 to 13 Nov 2024. The latest is by CertiK (“BKOKLPLock”).

Who audited BKOKFi?

CertiK wrote the 2 reports Trustblock holds for BKOKFi.

Are there open findings in BKOKFi’s audits?

13 findings are still open or acknowledged in the firms’ reports: 1 high, 3 medium, 9 low (all open). No critical finding is reported. Statuses are the security firms’ own.

Show this on your site

Is this your project? Show this record on your own website. The label states what the record holds, links to this page and updates by itself. It is free and needs no sign-in.

Content

Facts

Automatic: the three strongest facts of this project’s own record (its last audit and two more), highlighted. They update with the record. Picking a fact turns Automatic off.

Fixed as
Language

Style

Layout
Theme
Accent
Corners

Format

Size
Date
Embed as
HTML
<head>
<script src="https://widget.trustblock.run/project-widget.min.js" defer></script>
</head>
<body>
<div
data-tb-project-widget
data-tb-project-slug="bkok"
></div>
</body>

Paste the code where the label should appear. It uses no API credit and updates by itself.

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