This document is a security audit report performed by danbogd, where aXpire (AXPR) Token has been reviewed.
In total, 12 issues were reported including:
- 3 medium severity issues
- 1 low severity issues
- 6 owner privileges (ability of owner to manipulate contract, may be risky for investors)..
- 2 notes.
No critical security issues were found.
The owner or a hacker (if the owner's private key will be compromised) can burn any value of tokens he wants whithout any approve from token holders. This is dangerous for investors.
Lines 223-231.
ERC-20 Token Standard specifies for functions transfer and transferFrom:
The function SHOULD throw if the _from account balance does not have enough tokens to spend. But in this implementation it just returns false. This can lead to serious consequences. Because checking the return value of this function is rare.
EIP20 says that: Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event. But in this contract, functions transfer and transferFrom has a condition:
if (_value > 0)
Lines 155-176
Following ERC-20 final description:
"NOTE: To prevent attack vectors like the one described here and discussed here, clients SHOULD make sure to create user interfaces in such a way that they set the allowance first to 0 before setting it to another value for the same spender. THOUGH The contract itself shouldn't enforce it, to allow backwards compatibility with contracts deployed before"
The implemented approve function:
Do not preserve backwards compatibility since it enforces the allowance values to be set.
Do not throw in case if the following condition is true if (_value != 0 && allowed[msg.sender][_spender] != 0) and return false, users might not notice that the changes didn't occur, and external contract calls to this function will highlight many other issues.
Line 183.
Do not try to mitigate the issue and implement increaseApproval and decreaseApproval functions instead.
-
It is possible to double withdrawal attack. More details here.
-
Lack of transaction handling mechanism issue. WARNING! This is a very common issue and it already caused millions of dollars losses for lots of token users! More details here.
Add into a function transfer(address _to, ... )
following code:
require( _to != address(this) );
The contract owner allow himself to:
- pause functions of contract (transfer, transferFrom, approve);
- burn a specific amount of tokens of other token holders;
- change rate duaring crowdsale;
- stop croudsale;
- withdraw ETH and tokens funds before the end of sales;
- softcap is absent.
The contract is managed manually by the owner which is not good for investors.
The function toggleDead() is not used.
Line 340.
The contracts use solidity version 0.4.24. It is suggested to use the latest version and fix all compiler warnings that arise. Compiler version should be fixed to avoid any potential discrepancies in smart contract behavior caused by different versions of compiler.
The review did not show any critical issues, some of medium and low severity issues were found.