This repository has been archived by the owner on May 26, 2023. It is now read-only.
yixxas - solvent()
is implemented wrongly
#300
Labels
Low/Info
A valid Low/Informational severity issue
Non-Reward
This issue will not receive a payout
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
yixxas
medium
solvent()
is implemented wronglySummary
solvent()
is can be used to check the solvency of a bounty. However, the current implementation is wrong and will return an incorrect or misleading result.Vulnerability Detail
solvent()
can currently only be used on ongoing bounty despite what is documented as reported in one of my other issue. In ongoing bounty,payoutVolume
is the amount that is paid to each contributor.solvent()
checks forbalance >= bounty.payoutVolume()
. We are checking if total balance of token in the contract is higher than a SINGLE payout. This means that the bounty is deemed solvent as long as contract is able to pay a single contributor. This is incorrect.Impact
Wrong implementation of
solvent()
results in a wrong return value in most cases.Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/OpenQ/Implementations/OpenQV1.sol#L408-L413
Tool used
Manual Review
Recommendation
We should check the balance with the total number of contributors * payoutVolume to get the correct check.
The text was updated successfully, but these errors were encountered: