CertiK reviewed DBTC on 26 Sep 2024: 28 findings, 0 critical; 15 marked fixed, 5 acknowledged, 8 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 | 2 | 0 |
| Medium | 0 | 3 | 5 |
| Low | 8 | 0 | 10 |
The `DBTCoinNew` contract grants the owner extensive privileges to modify critical state variables. This includes variables such as `startTradeBlock`, `currency`, `_mainPair`, and `totalFundAmountReceive`, among others. The owner’s ability to modify these critical parameters poses a significant risk, as it can lead to potential misuse or accidental misconfiguration, which could affect the contract's overall functionality and security.
In the constructor of the `DBTCoinNew` contract, several addresses are hardcoded to perform critical functions such as marketing, currency transactions, swap routing, and liquidity burning. Below is the relevant code snippet: ```solidity constructor() ERC20('DBTCoin', 'DBTC') Ownable(msg.sender) { fundAddress = payable(0x86845f569AF459ca95c032b9257E3B33a0582efC); currency = 0x55d398326f99059fF775485246999027B3197955; _swapRouter = ISwapRouter(0x10ED43C718714eb63d5aA57B78B54704E256024E); address ReceiveAddress = 0x86845f569AF459ca95c032b9257E3B33a0582efC; burnLiquidityAddress = 0x127d17465b6f6f91e71cd7bFEd11b699832DcDfa; ... } ``` Hardcoding these addresses can lead to potential issues if they are incorrect or need to be updated. This could affect the contract's functionality and security.
The `allToFunder` variable is intended to accumulate fees that are later swapped for currency and distributed to `fundAddress` and `MarketingAddress`. However, the `sellFee` used to update `allToFunder` includes `_sellFundFee`, `_sellMarketingFee`, and `_sellReflowFee`. The `_sellReflowFee` is already accounted for separately in `_reflowAmount`, leading to potential double-counting. ```solidity if (isSell) { uint256 _toSellLPFee = tAmount * _sellLPFee / 10000; _basicTransfer(sender, LPDividendsAddress, _toSellLPFee); (sellFee, burnFee, sellReflowFee, amount) = allSellFeeToAmount(tAmount, sellBurnFee); _reflowAmount += sellReflowFee; amount = amount - _toSellLPFee; allToFunder += sellFee; } else { // Other logic } ``` This miscalculation can result in `allToFunder` being greater than the actual assets available for funding purposes, potentially leading to insufficient funds for `fundAddress` and `MarketingAddress`.
The `_calculateSwapToCurrencyAmount` function in the `DBTCoinNew` contract is intended to calculate the minimum swap amount considering a slippage tolerance. However, since the calculation and the actual swap occur in the same transaction, the price could change due to sandwich attacks, rendering the function ineffective. ```solidity function _calculateSwapToCurrencyAmount(uint256 amount) public view returns (uint256) { uint256 price = getPrice(); uint256 Slippage = 2; price = amount * price / 10 ** decimals(); return price - price * Slippage / 100; } ``` In a sandwich attack, the price is manipulated before this price calculation and the swap execution, leading to potential losses or failed transactions.
It is important to emit events for sensitive actions, particularly those that can be executed by centralized roles or administrators. This ensures transparency and enables tracking of critical changes, which is essential for security and trust in the system. The absence of event logs can lead to a lack of visibility and potential information loss.
The fee variables in the contract have no set limits, allowing fees to potentially reach 100%. If this occurs, users would receive no tokens from the contract, resulting in a complete loss of their investment.
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.
In the `DBTCoinNew` contract, the variable `buy_burnFee` is declared but never used within the contract. This results in unnecessary storage usage and potential confusion for developers and auditors reviewing the code. ```solidity uint256 public buy_burnFee; ``` The `buy_burnFee` variable is intended to represent the buy burn fee but is not used during the buy.
| Address | Chain | Source code |
|---|---|---|
| 0xede7…29200xede744facd6c046ae3177238cb5afcda8a5b2920 | Chain: BNB Chain | 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