This document is a security audit report performed by danbogd, where APO1 token has been reviewed.
Сommit hash 7b18c7689fc90bbbb5fa092c02ae9fd75e1074d7.
In total, 5 issues were reported including:
- 1 medium severity issues
- 4 low severity issues
- 0 owner privileges (ability of owner to manipulate contract, may be risky for investors).
- 0 notes.
No critical security issues were found.
There is no upper limit on receivers.length, it increments each time a new transaction is registered. Eventually, as the count of transactions increases, gas cost of smart contract calls will raise, until reaching an "Out of Gas" error or a "Block Gas Limit" in the worst scenario.
https://github.com/geomad/APO/blob/7b18c7689fc90bbbb5fa092c02ae9fd75e1074d7/apo.sol#L154
Accroding to ERC20 standard, when initializing a token contract if any token value is set to any given address a transfer event should be emited.
https://github.com/geomad/APO/blob/7b18c7689fc90bbbb5fa092c02ae9fd75e1074d7/apo.sol#L113
There are two input arrays, but no check for the same length. In this case it is possible to skip some recipient or token amount and to transfer wrong amount to wrong recipient.
https://github.com/geomad/APO/blob/7b18c7689fc90bbbb5fa092c02ae9fd75e1074d7/apo.sol#L154
-
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) );
decreaseAllowance function revert if the value to be decreased from the total allowed is higher than the allowance (most implementations set the value to zero in this case), a racing condition can occur in this case between the spender and approver and the approver can lose tokens under some specific cases.
https://github.com/geomad/APO/blob/7b18c7689fc90bbbb5fa092c02ae9fd75e1074d7/apo.sol#L200
Set the value of the allowance to zero if the amount to be decreased is higher than the remaining allowance.
uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); }
The review did not show any critical issues, some of medium and low severity issues were found.