Skip to content

Instantly share code, notes, and snippets.

@yuriy77k

yuriy77k/P3C.md Secret

Forked from MrCrambo/P3C.md
Created August 29, 2018 08:06
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/e6ce76b130a24906ef551a8d070eb0d4 to your computer and use it in GitHub Desktop.
Save yuriy77k/e6ce76b130a24906ef551a8d070eb0d4 to your computer and use it in GitHub Desktop.

P3C Smart Contract audit report.

Summary

This is the report from a security audit performed on P3C Smart Contract by MrCrambo.

The audit focused primarily on the security of P3C Smart Contract.

In scope

  1. https://etherscan.io/address/0xb3775fb83f7d12a36e0475abdd1fca35c091efbe#code

Findings

In total, ** 3 issues** were reported including:

  • 0 high severity issues.

  • 2 medium severity issues.

  • 0 low severity issues.

  • 1 minor remark.

Security issues

1. Transfer to zero address.

Severity: medium

Description

Tokens could be sent to zero address, that means they will be locked and will not be able to use or burn. Function transfer at line 374.

Recommendation

Need to check if _toAddress address is not zero address.

require(_toAddress != address(0));

2. Use SafeMath.

Severity: medium

Description

Lot of math operations done without using SafeMath library which could cause Integer over- or under- flow. For example:

payoutsTo_[_customerAddress] +=  (int256) (_dividends * magnitude);

Recommendation

Use SafeMath library in all math operations for preventing yourself from over- and under- flows.

3. Event names not like described in Solidity style-guide.

Severity: minor

Description

Some of events names start with lowercase, lines 107, 114, 120, 126

Recommendation

All event names should start with Uppercase as declared in solidity style guide

event OnTokenPurchase();

Conclusion

There were find two medium severity issues, that should be fixed before deploying. Also we highly recommend to complete other bugs before use.

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