Skip to content

Instantly share code, notes, and snippets.

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

SafeUpgradeableTokenERC20 audit report.

1. Summary

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

2. In scope

Сommit hash a755f5ee08e2612b62d36652f626a74a26f34d37.

3. Findings

In total, 4 issues were reported including:

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

No critical security issues were found.

3.1. Allowance Approval

Severity: medium

Description

Following ERC-20 final description:

"NOTE: To prevent attack vectors like the one described here and discussed here, clients SHOULD make sure to create user interfaces in such a way that they set the allowance first to 0 before setting it to another value for the same spender. THOUGH The contract itself shouldn't enforce it, to allow backwards compatibility with contracts deployed before.

Do not throw in case if the following condition is true require((value == 0) || (_allowances[msg.sender][spender] == 0)) and return false, users might not notice that the changes didn't occur, and external contract calls to this function will highlight many other issues.

Code snippet

https://github.com/guylando/EthereumSmartContracts/blob/a755f5ee08e2612b62d36652f626a74a26f34d37/SafeUpgradeableTokenERC20/contracts/SafeUpgradeableTokenERC20.sol#L217-L229

3.2. Owner Privileges

Severity: owner previliges

Description

  • The contract owner allow himself to pause functions of contract (transfer, transferFrom, approve, increaseAllowance, decreaseAllowance) here.

  • Owner can upgrade contract and implement any logic in the new contract. And even if the new contract will be audited, at any time possible to change the address of the new contract again to not audited and insecure here.

  • Evacuate Tokens at any time here.

4. Conclusion

The review did not show any critical issues, some of 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