This repository has been archived by the owner on May 26, 2023. It is now read-only.
HollaDieWaldfee - ClaimManagerV1: bountyIsClaimable function returns wrong result for TieredFixedBounty and TieredPercentageBounty #67
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Non-Reward
This issue will not receive a payout
HollaDieWaldfee
medium
ClaimManagerV1: bountyIsClaimable function returns wrong result for TieredFixedBounty and TieredPercentageBounty
Summary
The
ClaimManagerV1.bountyIsClaimable
function returns whether a bounty contract is claimable, i.e. whether payouts can be made from it.For any of the four bounty types, the
bountyIsClaimable
function returnstrue
, indicating that the bounty is claimable, when the bounty is in theOPEN
state.This is correct for
AtomicBounty
andOngoingBounty
.But it is not correct for
TieredFixedBounty
andTieredPercentageBounty
.Vulnerability Detail
ClaimManagerV1.bountyIsClaimable
function looks like this:https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/ClaimManager/Implementations/ClaimManagerV1.sol#L345-L365
So for all four bounty types it returns
true
ifstatus == 0
. The status0
is theOPEN
state.However by looking at the
ClaimManagerV1
contract it is obvious thatTieredFixedBounty
andTieredPercentageBounty
are claimable even in theCLOSED
state. For them theCLOSED
state just means that the competition is closed and e.g. no more funding can occur.Impact
ClaimManagerV1.bountyIsClaimable
function returns an incorrect result which can cause any components using this function to misbehave.Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/ClaimManager/Implementations/ClaimManagerV1.sol#L345-L365
Tool used
Manual Review
Recommendation
The
ClaimManagerV1.bountyIsClaimable
function should returntrue
forTieredFixedBounty
andTieredPercentageBounty
if their state isOPEN
orCLOSED
.Duplicate of #386
The text was updated successfully, but these errors were encountered: