CertiK reviewed Basenji (Basenji - audit 1) on 12 Apr 2024: 15 findings, 0 critical; 7 marked fixed, 7 acknowledged, 1 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 | 1 | 0 | 1 |
| Medium | 0 | 0 | 3 |
| Low | 0 | 7 | 3 |
In the function `swapBack()`, the `BENJI` tokens are swapped for ETH and then assigned to `devWallet` and `marketingWallet`. Based on lines 1609 to 1612, where the swapping of tokens reduces half of the liquidity, the resulting ETH is distributed among `Dev`, `Marketing`, and a half for `Liquidity`. Therefore, line 1620 should divide the `amountToSwapForETH` instead of `totalTokensToSwap`.
The transaction may be charged fees, so the max holding of the receiver should be the sum of the held tokens and the amount received from the transfer. The fees should not be included in the max holding. ```solidity=1503 require( amount + balanceOf(to) <= maxWallet, "Max wallet exceeded" ); ``` - Max holding is checked. ```solidity=1568 amount -= fees; ``` - Receiving amount is adjusted. ```solidity=493 _balances[recipient] = _balances[recipient].add(amount); ``` - Balance is increased by the adjusted amount.
A sandwich attack may 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 (executing before the target) a transaction to purchase one of the assets and make profits by backrunning (executing after the target) a transaction to sell the asset. ```solidity=1585 uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); ```
olidity version >=0.8.0 includes checked arithmetic operations and underflow/overflow by default, making SafeMath redundant.
The contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assumes their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity=1065 IUniswapV2Router02 public immutable uniswapV2Router; ``` - The contract `Basenji` interacts with third party contract with `IUniswapV2Router02` interface via `uniswapV2Router`.
Some events are never emitted, which can lead to confusion and code maintainability issues. ```solidity=1132 event UpdateUniswapV2Router( address indexed newAddress, address indexed oldAddress ); ``` ```solidity=1151 event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); event AutoNukeLP(); event ManualNukeLP(); ``` ```solidity=1418 event BoughtEarly(address indexed sniper); ```
Some state variables are not used in the codebase. Removing the unused variable and related code could reduce the gas consumption on deployment. ```solidity=1077 uint256 public launchedAtCoefficient; ``` ```solidity=1111 uint256 feeCalculationData; ```
| Address | Chain | Source code |
|---|---|---|
| 0xbc45…85f00xbc45647ea894030a4e9801ec03479739fa2485f0 | Chain: Base | Source code: Verified source |
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