Skip to content

Instantly share code, notes, and snippets.

@yuriy77k
Forked from RideSolo/ETH_GIGZI-V2_audit_report.md
Created August 10, 2018 09:25
Show Gist options
  • Save yuriy77k/65cc60dd03e4d8353e3419744876c10d to your computer and use it in GitHub Desktop.
Save yuriy77k/65cc60dd03e4d8353e3419744876c10d to your computer and use it in GitHub Desktop.

GIGZI Project Audit Report.

1. Summary

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

GIGZI project promess to issue regulated tokens (GZS silver, GZG gold, GZP platinum) backed by precious metals and also one non-regulated token GZB black. Round of rewards will be distributed to the holders of GZB tokens on their accounts in the form of regulated tokens (GZG) following the project funding. GZB distribution is performed by ICO.

2. In scope

  • GigBlack.sol github commit hash 0989f4a550ef8ae7110635784a96144d5578d7d1.
  • GigSilver.sol github commit hash 0989f4a550ef8ae7110635784a96144d5578d7d1.
  • GigGold.sol github commit hash 0989f4a550ef8ae7110635784a96144d5578d7d1.
  • GigPlatinum.sol github commit hash 0989f4a550ef8ae7110635784a96144d5578d7d1.
  • GigCrowdsale.sol github commit hash 0989f4a550ef8ae7110635784a96144d5578d7d1.
  • FeeableToken.sol github commit hash 0989f4a550ef8ae7110635784a96144d5578d7d1.

2.1. Excluded

3. Findings

3 issues were reported including:

  • 0 high severity issues.

  • 0 medium severity issues.

  • 1 low severity issues.

  • 2 minor remarks.

3.1. Reserved Account of Fee Collector Address not updated

Sevirity: low

Description

The function setTxFeeCollector member of FeeableToken re-assign fee collector address, but do not reset the reserved account old address to avoid fee collection, however addReservedAccount can be used but at the price of extending accountsReserved dynamic array.

Code snippet

https://github.com/GigziProject/GigziContracts/blob/ffe57bdaf1b0d1fb29d182cd03c1890b3be50ac8/contracts/FeeableToken.sol#L65#L68

3.2. Reserved Account Optimization

Severity: minor

Description

Reseverd accounts are used to avoid paying fees for some addresses. Each time if the contract owner wants to add an address he calls addReservedAccount adding a new element to accountsReserved dynamic array, this practice adds too much gas consumption when checking if the address transaction fees are applicable (in isFeeShouldBePaid function).

Code Snippet

https://github.com/Gigzi/contracts/blob/0989f4a550ef8ae7110635784a96144d5578d7d1/contracts/FeeableToken.sol#L60#L63

https://github.com/Gigzi/contracts/blob/0989f4a550ef8ae7110635784a96144d5578d7d1/contracts/FeeableToken.sol#L107#L125

Recommendation

Use a simple mapping where an address will map to a boolean variable. this will considerably optimize transactions gas consumptions. The functions addReservedAccount and isFeeShouldBePaid should be reimplemented as recommended.

3.3. Useless Extra Requirement

Severity: minor

Description

Requiring txFee lower than _value represent extra computation since txFee is calculated using _value as input.

Code Snippet

https://github.com/Gigzi/contracts/blob/0989f4a550ef8ae7110635784a96144d5578d7d1/contracts/FeeableToken.sol#L187

https://github.com/Gigzi/contracts/blob/0989f4a550ef8ae7110635784a96144d5578d7d1/contracts/FeeableToken.sol#L193

4. Conclusion

The contracts reviewed can be considered safe to be deployed. However a lot of optimization has to be done to minimize gas consumption.

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