Skip to content

Instantly share code, notes, and snippets.

@yuriy77k
Forked from danbogd/ETH_HoloToken_audit_report.md
Created June 4, 2019 19:20
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/4afef9710e08a8a9030e58c8590019b6 to your computer and use it in GitHub Desktop.
Save yuriy77k/4afef9710e08a8a9030e58c8590019b6 to your computer and use it in GitHub Desktop.

Holo Token audit report.

1. Summary

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

2. In scope

Сommit hash .

3. Findings

In total, 6 issues were reported including:

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

No critical security issues were found.

3.1. 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.2. Owner Privileges

Severity: owner previliges

Description

Contract owner allow himself to:

  • Selectively burn tokens;
  • Unlimited token minting;
  • Block functions of contract (transfer, transferFrom, approve) at any time he wants.

Code snippet

function burn(uint256 _amount) external onlyDestroyer { require(balances[destroyer] >= _amount && _amount > 0); balances[destroyer] = balances[destroyer].sub(_amount); totalSupply = totalSupply.sub(_amount); Burn(_amount); }

function mint(address _to, uint256 _amount) external onlyMinter canMint returns (bool) { require(balances[_to] + _amount > balances[_to]); // Guard against overflow require(totalSupply + _amount > totalSupply); // Guard against overflow (this should never happen) totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true; }

modifier whenMintingFinished() { require(mintingFinished); _; }

3.3. No checking for zero address

Severity: low

Description

In this functions there are no checking for zero address.

Code snippet

function setDestroyer(address _destroyer) external onlyOwner { destroyer = _destroyer; }

function setMinter(address _minter) external onlyOwner { minter = _minter; }

3.4. Consider using latest version of solidity.

Severity: minor observation

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 low severity issues were found.

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