Closed yuriy77k closed 5 years ago
Auditing time 1 day
@MrCrambo assigned
Auditing time: ~ 2 days.
@danbogd assigned
My report is finished.
Estimated auditing time is 2 days.
@gorbunovperm assigned
My report is finished.
OmiseGO (OMG) Token smart contract security audit report performed by Callisto Security Audit Department
In total, 9 issues were reported including:
6 low severity issues.
3 minor observation.
No critical security issues were found.
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 the following code to the transfer(_to address, ...)
function:
require( _to != address(this) );
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.
https://gist.github.com/yuriy77k/d52b7674ca7cf9b221a819db168fb645#file-omgtoken-sol-L164
Do not try to mitigate the issue and implement increaseApproval and decreaseApproval functions instead.
Transfer
, transferFrom
, mint
, TokenTimelock
functions do not prevent from sending tokens to address 0x0.
Add zero address checking
solidity
require(to != address(0));
onlyPayloadSize
modifier is workaround to avoid the Short Address Attack. But it doesn't work properly.
This method failed to execute when it was called from Parity multisignature wallet. The EVM pads call from this multisignature wallet, making the total 96 bytes instead of the expected 68.
If transfer
and transferFrom
are used by a subcontract function with fewer arguments, the onlyPayloadSize check will fail. It is not possible to adapt the workaround to prevent this issue.
More details here.
https://gist.github.com/yuriy77k/d52b7674ca7cf9b221a819db168fb645#file-omgtoken-sol-L81-L86
Remove this workaround.
The contract owner allow himself to pause functions of contract (transfer, transferFrom), mint any value of tokens.
The contract is managed manually by the owner which is not good for investors.
The mint
function should emit the Transfer
event.
https://gist.github.com/yuriy77k/d52b7674ca7cf9b221a819db168fb645#file-omgtoken-sol-L254
In OMGToken.sol, according to the ERC20 standard, the variable decimals should be declared as uint8.
https://gist.github.com/yuriy77k/d52b7674ca7cf9b221a819db168fb645#file-omgtoken-sol-L382
For various reasons (accident, vulnerability on the caller smart contract), _releaseTime variable may have a large value which can lead to overflow and that is more critical to blocking tokens for many many years. We can not rely on the correct input data and should check it in this contract.
https://gist.github.com/yuriy77k/d52b7674ca7cf9b221a819db168fb645#file-omgtoken-sol-L355
Owner could mint
any amount he wants and there is no hard cap.
https://gist.github.com/yuriy77k/d52b7674ca7cf9b221a819db168fb645#file-omgtoken-sol-L251
The audited smart contract can be deployed. Only low severity issues were found during the audit.
https://gist.github.com/yuriy77k/5f84f69befd3f6681f8b5445e24bdb53
https://gist.github.com/yuriy77k/960e5a709d35522a5deb3f35c4ba15b3
https://gist.github.com/yuriy77k/9d28025ce4468a986c8c469a33f34172
Audit request
Audit Top 200 CoinMarketCap tokens.
https://omisego.network/
Deployed at https://etherscan.io/address/0xd26114cd6EE289AccF82350c8d8487fedB8A0C07#code
Source code
https://gist.github.com/yuriy77k/d52b7674ca7cf9b221a819db168fb645
Disclosure policy
Public
Platform
ETH
Number of lines
185