CertiK reviewed Bitgain on 13 Sep 2023: 9 findings, 0 critical; 2 acknowledged, 7 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 | 0 | 0 |
| Low | 7 | 0 | 0 |
In the function `transferFrom()`, the function transfers tokens before checking if the message sender has enough of an allowance. ```solidity=541 _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "TOKEN20: transfer amount exceeds allowance")); ``` It would be better to validate the allowance first to reduce gas costs in case it reverts.
Commented out code is redundant and can be misleading.
The mentioned functions lack the zero check for the parameter `amount`. When `amount == 0`, these functions won't make any changes in the contract.
Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring tokens to a zero address can result in a permanent loss of those tokens. ```solidity=477 payable(serviceFeeReceiver_).transfer(serviceFee_); ``` - `serviceFeeReceiver_` is not zero-checked before being used.
The contract `StandardToken` inherits functionalities from the `Ownable` contract such as the `transferOwnership()` that allows setting the new `owner` without guaranteeing the designated account is able to actuate transactions on-chain.
The `SafeMath` library is used unnecessarily. With Solidity compiler versions 0.8.0 or newer, arithmetic operations will automatically revert in case of integer overflow or underflow.
It is not recommended to use Solidity's `transfer()` and `send()` functions for transferring native tokens, 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, EVM instructions' 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=477 payable(serviceFeeReceiver_).transfer(serviceFee_); ``` - `StandardToken.constructor` uses `transfer()`.
| Address | Chain | Source code |
|---|---|---|
| 0x957f…b7d10x957fa93b3e131229305bad9a9a4a280b30fab7d1 | Chain: BNB Chain | Source code: Verified source |
1,045 projects reviewed · 1,376 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