Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriy77k/ede3912b0498e812eecd528acbe37137 to your computer and use it in GitHub Desktop.
Save yuriy77k/ede3912b0498e812eecd528acbe37137 to your computer and use it in GitHub Desktop.
Pundi X (NPXS) Token security audit report

Pundi X (NPXS) Token security audit report

Summary

This is the report from a security audit performed on Pundi X (NPXS) Token by gorbunovperm.

Audit Top 200 CoinMarketCap tokens.

https://pundix.com/

In scope

  1. NPXSToken.sol

Findings

In total, 6 issues were reported including:

  • 0 critical severity issue.

  • 0 high severity issue.

  • 3 medium severity issues.

  • 2 low severity issues.

  • 1 owner privileges.

  • 0 minor observations.

Security issues

1. Known vulnerabilities of ERC-20 token

Severity: low

Description

  • 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

Recommendation

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

require( _to != address(this) );

2. Owner Privileges

Severity: owner privileges

Description

  1. The owner receives funds immediately after the purchase of tokens. It should be available after the end of crowdsale. Otherwise, the owner has the opportunity to buy tokens for the same money. (line 149)

  2. RefundVault and WithdrawVault contracts is managed manually by the owner and are not integrated with the Crowdsale contract which is not good for investors. (lines 200 and 446)

  3. The contract owner allowed to pause transfer functions (transfer, transferFrom). (lines 541-545)

  4. The owner can finish minting whenever he wants. Related with issue #4. (line 401)

3. ERC20 Compliance: event missing

Severity: low

Description

According to ERC20 standard when burning coins a transfer event should be emitted. In this case the Burn event is emitted, it is better to additionally use emit Transfer(msg.sender, address(0), value);

Code snippet

4. Crowdsale contract is not associated with a NPXS token contract

Severity: medium

Description

Crowdsale contract creates a token contract which used for Crawdsale. But this created token contract is not NPXSToken but just MintableToken.

Code snippet

5. stopReceive is not implemented for transferFrom

Severity: medium

Description

stopReceive mechanism is used for transfer function but not implemented for transferFrom function. It is possibler to approve funds to yourself and send through transferForm without any restrictions.

Code snippet

6. ERC223 Compliance, transferAndCall issues

Severity: medium

Description

  1. Judging by the call of the tokenFallback function, this token should support the ERC223 standard. But in this case it should be called in the transfer function also. And should to check whether the recipient is a contract. And function transfer(address, uint, bytes) should be implemented. Please, read this

  2. Judding by transferAndCall function this token should support the ERC677 standard. But in this case it should call contractFallback not tokenFallback function. And should to check whether the recipient is a contract. Please, read this

  3. transferAndCall function not use whenNotPaused modifier and tokens may be transfered even if contract is paused.

Code snippet

Conclusion

There are some vulnerabilities were discovered in these contracts.

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