Skip to content

Instantly share code, notes, and snippets.

@danbogd
Last active August 31, 2019 13:31
Show Gist options
  • Select an option

  • Save danbogd/bdb8d739cddbd2c73951e2035d329f31 to your computer and use it in GitHub Desktop.

Select an option

Save danbogd/bdb8d739cddbd2c73951e2035d329f31 to your computer and use it in GitHub Desktop.

NTP Tokens audit report.

1. Summary

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

2. In scope

  • ntp.sol github commit hash 72fac4492abee0b14ac0133b94197b5bfe2ca9d6.

3. Findings

In total, 4 issues were reported including:

  • 2 medium severity issues.
  • 2 low severity issues.

No critical security issues were found.

3.1. The owner can mint any value of tokens he wants.

Severity: medium

Description

The owner or a hacker (if the owner's private key will be compromised) can mint any value of tokens he wants. The token can become worthless very quickly. This is dangerous for investors.

Code snippet

https://github.com/networktokenpayment/networktokenpayment/blob/72fac4492abee0b14ac0133b94197b5bfe2ca9d6/ntp#L337-L341

3.2. Check input value of change TokensPerEth.

Severity: medium

Description

There is necessary to check the input value of the updateTokensPerEth function for zero-value. In case of the argument is not specified, the user can pay money but not get tokens.

Code snippet

https://github.com/networktokenpayment/networktokenpayment/blob/72fac4492abee0b14ac0133b94197b5bfe2ca9d6/ntp#L199-L202

3.3. 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.4. Owner Privileges

Severity: low

Description

The contract owner allow himself to:

  • set the price
  • finish distribution tokens
  • withdraw all fonds of contract
  • burn and mint tokens

The contract is managed manually by the owner which is not good for investors.

4. Conclusion

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

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