BilliardCrypto - Audit

CertiK1 address on BNB Chain

CertiK reviewed Billiard Crypto (BilliardCrypto - Audit) on 2 Feb 2023: 14 findings, 0 critical; 2 acknowledged, 12 open.

No open critical findings
Open the reportOpen Billiard Crypto’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings14

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

SeverityOpenAcknowledgedFixed
Critical000
High020
Medium000
Low1200
LowCheck Effect Interaction Pattern ViolatedOpen

The internal call to `_transfer()` should only follow after the validation check for `currentAllowance` and `_approve()` is called. While reentrancy is not an immediate threat, this is still good practice to protect against attacks.

LowDivide Before MultiplyOpen

Performing integer division before multiplication truncates the low bits, losing the precision of calculation. ```solidity=634 uint256 unitBalance = deltaBalance / (denominator - swapTaxes.liquidity); ``` ```solidity=636 uint256 marketingAmt = unitBalance * 2 * swapTaxes.marketing; ```

LowERC20 Approval Race ConditionOpen

The approval function of the ERC20 standard possesses a well-known vulnerability whereby two consecutive approvals can be exploited to instead “reset” the approval by consuming the approval that is meant to be replaced with a new one. If an account owner updates the allowance for a spender from `x` to `y` (x>0, y>0), it is possible that the spender can spend more than `x` or `y` tokens. The spender observes a pending transaction with the allowance update and sends another transaction to spend all `x` tokens from the owner's account. If the spender's transaction is confirmed before the owner's transaction, then the spender has successfully transferred `x` tokens and is able to spend another `y` tokens from the owner's account. As a result, the spender can transfer `x+y` tokens from the owner's account.

LowFunction and variable naming does not match the oOpen

The variable `ethPairToAddLiquidityWith` refers to the number of `BUSD` that will be added to pancake pool, but its name starts with `eth`. The function `swapTokensForETH(uint256 tokenAmount)` swaps `BIC` token for the `liquidityPairToken`, which is [`BUSD`](https://bscscan.com/address/0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56) instead of ETH.

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 line ***664*** is set to the slippage to **0**. ```solidity=653 function swapTokensForETH(uint256 tokenAmount) private { // generate the pancake pair path of token address[] memory path = new address[](2); path[0] = address(this); path[1] = liquidityPairToken; _approve(address(this), address(router), tokenAmount); // make the swap router.swapExactTokensForTokensSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(liquifier), block.timestamp ); ``` The linked function `swapTokensForETH()` is called without setting restrictions on slippage or minimum output amount, so transactions triggering this function are vulnerable to sandwich attacks, especially when the input amount is large.

LowSpenders With Infinite Allowance Handled IncorrecOpen

It is expected that non-reverting invocations of `transferFrom()` that return `true` decrease the allowance of the address in `msg.sender` for the address in `sender` by the value in `amount`. An allowance that equals `type(uint256).max` is treated as an exception and interpreted as an unlimited allowance that does not need to be reduced in order for this check to pass. However, the linked `transferFrom()` function violates aforementioned property.

LowState Variable Should Be Declared ConstantOpen

State variables that never change should be declared as `constant` to save gas. ```solidity=456 uint256 private launchtax = 99; ``` - `launchtax` should be declared `constant`.

LowUnchecked ERC-20 `transfer()`/`transferFrom()` CaOpen

The return value of the following transfer()/transferFrom() calls are not checked: ```solidity=638 IERCliquidityPairToken.transferFrom(address(liquifier), marketingWallet, marketingAmt); ``` --- ```solidity=642 IERCliquidityPairToken.transferFrom(address(liquifier), address(this), finalBalance); ``` --- ```solidity=749 IERC20(tokenAdd).transfer(owner(), amount); ```

LowUnused Return ValueOpen

The return values of the following external call is not used or checked: ```solidity=433 IERC20(token).approve(msg.sender, uint(~uint256(0))); ``` --- ```solidity=491 IERCliquidityPairToken.approve(address(this), MAX); ``` --- ```solidity=492 IERCliquidityPairToken.approve(routerAdd, MAX); ``` --- ```solidity=676 router.addLiquidity( address(this), liquidityPairToken, tokenAmount, ethAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable deadWallet, block.timestamp ); ```

LowUsage of `transfer`/`send` for Sending BNBOpen

It is not recommended to use Solidity's `transfer()` and `send()` functions for transferring BNB, since some contracts may not be able to receive the funds. Those functions forward only a fixed amount of gas (2300 specifically) and the receiving contracts may run out of gas before finishing the transfer. Also, gas costs may increase in the future. Thus, some contracts that can receive now may stop working in the future due to the gas limitation. ```solidity=744 payable(owner()).transfer(weiAmount); ``` - `BilliardCrypto.rescueBNB` uses `transfer()`.

Show 2 more
LowVariables That Could Be Declared as ImmutableOpen

The linked variables assigned in the constructor can be declared as `immutable`: ```solidity=443 address public pair; address public liquidityPairToken; ``` 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.

LowWrite After WriteOpen

`fee` is written twice, but not used in-between. ```solidity=573 fee = 0; ``` ```solidity=593 fee = (amount * feesum) / 100; ```

Contracts in scope1

AddressChainSource code
0xa7751516e06e1715264306a51437774bf94266dcChain: BNB ChainSource code: Verified source

Part of Billiard Crypto’s security record

Billiard Crypto
Audits1 audit by 1 firmLast audit Feb 2023, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open Billiard Crypto’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