CertiK reviewed Bear Inu (Bearinu) on 6 Mar 2023: 4 findings, 0 critical; none marked fixed.
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 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 4 | 0 | 0 |
The implementation of the `approve()` function is vulnerable to [a known ERC20 race condition issue](https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729), which could lead to token theft. When a user calls `approve()` for a second time on a spender that has already been allowed, the spender could call `transferFrom()` to transfer the previous value and this would still be a valid transaction. Consider the following exploit scenario: 1. Alice calls `approve(Bob, 100)` to allow Bob to spend 100 tokens. 2. Alice changes her mind and calls `approve(Bob, 50)`. 3. Bob observes the second `approve(Bob, 50)` function call and calls `transferFrom(Alice, Bob, 100)` before the second `approve(Bob, 50)` call. 4. The above scenario can be achieved by front-running. In this case, Bob can transfer another 50 tokens from Alice and in total, he transferred 150 tokens from Alice.
Detailed `require` statements help to identify where issues have occurred. Although most of the arithmetic errors encountered in this contract are handled by Solidity's native overflow/underflow handling, it would be best to also have `require` statements to help identify where errors have occurred. ### transfer() In the `transfer()` function, a `require` statement can be added to ensure `balances[msg.sender] >= value`. ### transferFrom() In the `transferFrom()` function, a `require` statement can be added to ensure `allowance[from][msg.sender] >= value`. A `require` statement can also be added to ensure `balances[msg.sender] >= value`.
The `require()` statements should provide a description of the error or condition not met. ```solidity require(spender != address(0)); ```
State variables that never change should be declared as `constant` to save gas. ```solidity=6 uint public totalSupply = 1000000000000000 * 10 ** 18; ``` - `totalSupply` should be declared `constant`. --- ```solidity=7 string public name = "Bear Inu"; ``` - `name` should be declared `constant`. --- ```solidity=8 string public symbol = "BEAR"; ``` - `symbol` should be declared `constant`. --- ```solidity=9 uint public decimals = 18; ``` - `decimals` should be declared `constant`.
| Address | Chain | Source code |
|---|---|---|
| 0x1783…a26a0x17837004ea685690b32dbead02a274ec4333a26a | Chain: Ethereum | 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