Skip to content

Instantly share code, notes, and snippets.

@RideSolo
Created August 22, 2019 02:17
Show Gist options
  • Save RideSolo/1149d38feb0f6fe234e5194115fd6ca9 to your computer and use it in GitHub Desktop.
Save RideSolo/1149d38feb0f6fe234e5194115fd6ca9 to your computer and use it in GitHub Desktop.

Clickscrow Token Audit Report.

1. Summary

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

Symbol       : CSW
Name         : Clicks
Capped supply: 500,000,000
Decimals     : 18 
Standard     : ERC20

2. In scope

3. Findings

2 issues were reported including:

  • 2 low severity issues.

3.1. Allowance Decrease

Severity: low

Description

The value to be substructed is decreased using safemath sub function meaning that if the value is higher than the remaining allowance the transaction will throw when it could be set to zero instead. multiple scenario can be imagined for the end user.

Code snippet

    function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
        _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
        return true;
    }

Recommendation

Check if the allowance is lower than the value to be substracted and set the allowance to zero if the condition is met.

3.2. 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 the following code to the transfer(_to address, ...) function:

require( _to != address(this) );

4. Conclusion

The audited contract is safe.

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