CertiK reviewed ToDing on 1 Aug 2024: 10 findings, 0 critical; 4 marked fixed, 6 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 | 1 |
| Low | 5 | 0 | 2 |
70% of the `ToDing` tokens are sent to the contract deployer, 30% of the `ToDing` tokens are provided to the DEX pair for liquidity, and all liquidity tokens are subsequently sent to the contract deployer. This is a centralization risk because the deployer can distribute tokens without obtaining the consensus of the community. Any compromise to these addresses may allow a hacker to steal and sell tokens on the market, resulting in severe damage to the project.
In the `startTrade()` function, the contract grants the `_swapRouter` an unlimited allowance: ```solidity=410 function startTrade() external payable onlyOwner { require(0 == startTradeBlock, "trading"); _approve(address(this), address(_swapRouter), ~uint256(0)); ``` Additionally, the `swapToEth()` function explicitly approves the `amount` of tokens to `_swapRouter` each time a token swap is executed: ```solidity=632 function swapToEth(address token, uint256 amount, address to) private { IERC20(token).approve(address(_swapRouter), amount); ``` Since an unlimited approval has already been granted in the `startTrade()` function, this additional approval in `swapToEth()` is redundant.
It is expected that calls of the form `approve(spender, amount)` fail if the address in `spender` is the zero address.
The `_safeTransferETH()` function transfers BNB to a `to` address. It uses a low-level `call` to send the specified amount of BNB (`value`). However, the function does not properly handle cases where the `call` operation fails. This lack of error handling can lead to undetected failed transfers. ```solidity=331 function _safeTransferETH(address to, uint value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); if (success) {} } ```
The `.transfer()` function intends to transfer an ETH amount with a fixed amount of 2300 gas. This function is not equipped to handle changes in the underlying `.transfer()` function which may supply different amounts of gas in the future. Additionally, if the recipient implements a fallback function containing some sort of logic, this may inevitably revert, meaning the vault and owner of the contract will never be able to call certain sensitive functions.
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.
| Address | Chain | Source code |
|---|---|---|
| 0x1592…12c00x1592c5704f9e8c20bf7707c5d42626cecda912c0 | 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