Skip to content

Instantly share code, notes, and snippets.

@yuriy77k
Forked from RideSolo/ETC_onex_audit_report.md
Created December 25, 2018 16:08
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/39dd2472966f8960ab8701ca0a397844 to your computer and use it in GitHub Desktop.
Save yuriy77k/39dd2472966f8960ab8701ca0a397844 to your computer and use it in GitHub Desktop.

ONEX token Audit Report.

1. Summary

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

2. In scope

  • ONEX.sol github commit hash 63b02beee3da39cea86c84703047b5d757e2f756.

3. Findings

3 issues were reported including:

  • 2 medium severity issue.
  • 1 low severity issue.

3.1. Block Gas Limit Error

Severity: medium

Description

When executing mint function, getCoinAge function get called to return the coin*dayholding of a user, transaction execution can throw for block gas limit reached. If a user receives many transaction, after a certain number the block gas limit can be reached when calling getCoinAge. therefore the users will not be able to receive his reward. The for loop uses iterate over transferIns which is causing this issue.

Code snippet

https://github.com/RideSolo/ONEX-Network/blob/master/contracts/ONEX.sol#L241#L252

3.2. Staker Reward

Severity: medium

Description

If a token transfer occurs and a staker didn't claim his reward by calling transfer function using to address equal to his own, the deposit history transferIns will be deleted.

Following onex description "ONEX provides two methods to trigger ONEX staking: 1.Sending a transaction to your own address with any amount of ONEX. 2.Using MyEtherWallet.com or Mist or any other software that can interact with contracts to execute mint() function.", contract developers should inform the stakers that if they transfer tokens after the minimum staking period without claiming their stake will result in the loss of their reward.

Implementing a simple mechanism that allows the addition of the reward to the stakers account if they meet the requirement when transfering tokens to another address can be implemented easily.

Code snippet

https://github.com/RideSolo/ONEX-Network/blob/master/contracts/ONEX.sol#L150

https://github.com/RideSolo/ONEX-Network/blob/master/contracts/ONEX.sol#L169

3.3. Token Transfer to Address 0x0

Severity: low

Description

Onex Token do not require the to address to be non null before transfer. Accidental token loss to address 0x0 can be applicable.

Code snippet

https://github.com/RideSolo/ONEX-Network/blob/master/contracts/ONEX.sol#L144

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