Skip to content

Instantly share code, notes, and snippets.

@RideSolo
Last active August 9, 2018 15:18
Show Gist options
  • Save RideSolo/f1e99c8dbb8f936bbf5c160721e93364 to your computer and use it in GitHub Desktop.
Save RideSolo/f1e99c8dbb8f936bbf5c160721e93364 to your computer and use it in GitHub Desktop.

DappVolume Project Audit Report.

1. Summary

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

2. In scope

3. Findings

4 issues were reported including:

  • 1 medium severity issue.

  • 2 low severity issues.

  • 1 minor remark.

3.1. Return on Investment (misleading definition)

Sevirity: medium

Description

Concerning the function updateInvestor member of dappVolumeAd contract, and as advertised in the website "An investor can get bought out by a bigger investor and will get 120% of their investment back".

The implementation of the function doesn't reflect the above mentioned definition. if an investor invests more ethers than investmentMin state variable, and the next investor invests the exact required amount the first investor will not get 120% of his investment back but less (the percentage will depend on its payment).

The opposite is also true, an investor can get more than 120% of his ethers back if the next investor sends more than the required amount.

Code snippet

https://github.com/dappvolume/smart-contracts/blob/f95df2c546ff2d175adc3854c75e365377ca0ba4/dappVolumeAd.sol#L136#L141

3.2. Lost Ether

Sevirity: low

Description

lastAddress member of dappVolumeHearts contract, is not set in the contructor. This issue lead to lose the first half of the ethers sent using update function member of the same contract. Half of the ethers sent will go to the address 0x0, however this issue will concern only the first transaction.

Recommendation

Set the lastAddress to the owner address when creating the contract.

Code snippet

https://github.com/dappvolume/smart-contracts/blob/f95df2c546ff2d175adc3854c75e365377ca0ba4/dappVolumeHearts.sol#L82#L88

3.3. dappId Requirement

Sevirity: low

Description

In order for a dapp to be advertised the id input for the function updateAd has to be higher than zero (dappVolumeAd contract), the same requirement is not applied in order for a dapp to be liked in function update member of dappVolumeHearts.

Code snippet

https://github.com/dappvolume/smart-contracts/blob/f95df2c546ff2d175adc3854c75e365377ca0ba4/dappVolumeHearts.sol#L82#L88 https://github.com/dappvolume/smart-contracts/blob/f95df2c546ff2d175adc3854c75e365377ca0ba4/dappVolumeAd.sol#L106#L133

3.4. Unnecessary Use of Require

Sevirity: minor

Description

In setAccountNickname and setAccountUrl functions members of dappVolumeProfile contract, the use or require to check if the message sender address is different than 0x0 address is unnecessary. This is just adding extra computation and gas consumption since msg.sender cannot be equal to 0x0.

Code snippet

https://github.com/dappvolume/smart-contracts/blob/f95df2c546ff2d175adc3854c75e365377ca0ba4/dappVolumeProfile.sol#L9 https://github.com/dappvolume/smart-contracts/blob/f95df2c546ff2d175adc3854c75e365377ca0ba4/dappVolumeProfile.sol#L15

4. Conclusion

One medium issue was highlighted, the definition of the investment program of the DappVolume project has to be updated following the updateInvestor function definition.

This contract is safe to be used, but the above mentioned issue can lead to conflict with the investors. The project team has to solve this problem.

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