Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yuriy77k/23b820cc0dbcced4d173dcbd105b9464 to your computer and use it in GitHub Desktop.
Save yuriy77k/23b820cc0dbcced4d173dcbd105b9464 to your computer and use it in GitHub Desktop.

AMO Project audit report.

1. Summary

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

2. In scope

Сommit hash 329d08712c2555330ec7613df676aa88c9183fdf.

3. Findings

In total, 9 issues were reported including:

  • 1 high severity issues
  • 1 medium severity issues
  • 2 low severity issues
  • 4 owner privileges (ability of owner to manipulate contract, may be risky for investors)..
  • 1 notes.

No critical security issues were found.

3.1. Bug in the code.

Severity: high

Description

The buy function of AMOCoinSale contract missing a line of code required for transfer purchase tokens for buyer account, but nevertheless TokenPurchase event presents.

Code snippet

https://github.com/AMO-Project/AMO-Contracts/blob/329d08712c2555330ec7613df676aa88c9183fdf/contracts/AMOCoinSale.sol#L364-L392

3.2. The owner can prohibit any user to transfer funds.

Severity: medium

Description

The owner or a hacker (if the owner's private key will be compromised) can lock account any user at any time, which will make it impossible to transfer funds. This is dangerous for investors and for exchanges too.

Code snippet

https://github.com/AMO-Project/AMO-Contracts/blob/329d08712c2555330ec7613df676aa88c9183fdf/contracts/AMOCoin.sol#L179-L186

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: owner previliges

Description

The contract owner allow himself to:

  • Evacuate Tokens at any time.
  • Missing burn function after crowdsale.
  • Enable and disable transfer functions.
  • Set rate, hardcap for evry round.

3.5. Check fundAddr address

Severity: low

Description

The ether is redirected to address fundAddr. So, one needs to check in advance that this address is not the address of contract. In if case if, for example, address of fundAddr is a contract and its fallback function is implemented as follows: function { throw; }

no purchase transaction will work.

Code snippet

https://github.com/AMO-Project/AMO-Contracts/blob/329d08712c2555330ec7613df676aa88c9183fdf/contracts/AMOCoinSale.sol#L15 https://github.com/AMO-Project/AMO-Contracts/blob/329d08712c2555330ec7613df676aa88c9183fdf/contracts/AMOCoinSale.sol#L388

3.6. Consider using latest version of solidity.

Severity: note

Description

The contracts use solidity version 0.4.18. 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 high, 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