Skip to content

Instantly share code, notes, and snippets.

@yuriy77k
Forked from danbogd/ETH_IOSToken_audit_report.md
Created April 6, 2019 17:51
Show Gist options
  • Save yuriy77k/78729a1cad92e731b3ab77e884e9deee to your computer and use it in GitHub Desktop.
Save yuriy77k/78729a1cad92e731b3ab77e884e9deee to your computer and use it in GitHub Desktop.

IOSToken audit report.

1. Summary

This document is a security audit report performed by danbogd, where IOSToken has been reviewed.

2. In scope

3. Findings

In total, 4 issues were reported including:

  • 1 medium severity issues.
  • 2 low severity issues.
  • 1 minor observation.

No critical security issues were found.

3.1 Non-compliance with ERC-20 Token Standard.

Severity: medium

Description

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.

Code snippet

Lines 60, 70.

3.2. Known vulnerabilities of ERC-20 token

Severity: low

Description

  1. It is possible to double withdrawal attack. More details here.

  2. 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.

Recommendation

Add into a function transfer(address _to, ... ) following code:

require( _to != address(this) );

3.3. No checking for zero address.

Severity: low

Description

Transfer & transferFrom functions do not prevent from sending tokens to address 0x0.

Recommendation

Add zero address checking

require( _to != address(0) );

3.4. Consider using latest version of solidity.

Severity: minor observation

Description

The contracts use solidity version 0.4.19. 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.

4. Conclusion

The review did not show any critical issues, some of medium and low severity issues were found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment