Omniscia DAFI Protocol Audit

Data Manual Review Findings

Data Manual Review Findings

DAT-01M: Improper Reward Attribution

TypeSeverityLocation
Logical FaultMinorData.sol:L62

Description:

The userReward function assigns the current reward instead of the reduction the reward is decremented by to the rewardValue of a particular user.

Example:

contracts/Data.sol
58function userReward(address _address) external onlyDAFI{
59
60 require(reward > 0, "All Dafi reward consumed!");
61
62 DAFIRewardDetail[_address].rewardValue = reward;
63 DAFIRewardDetail[_address].given = true;
64 reward = reward.sub(reduction);
65 platformUsers.push(_address);
66}

Recommendation:

We advise the reduction to be used in the reward of a user to ensure fair distribution unless the intention is to indeed award a diminishing reward value.

Alleviation:

The intention of the codebase is to award a constantly-diminishing value and as such, the code should remain as is and this exhibit can be considered null.