Skip to content
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

Closed
github-actions bot opened this issue Feb 21, 2023 · 0 comments
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

Comments

@github-actions
Copy link

github-actions bot commented Feb 21, 2023

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 returns true, indicating that the bounty is claimable, when the bounty is in the OPEN state.

This is correct for AtomicBounty and OngoingBounty.

But it is not correct for TieredFixedBounty and TieredPercentageBounty.

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 if status == 0. The status 0 is the OPEN state.

However by looking at the ClaimManagerV1 contract it is obvious that TieredFixedBounty and TieredPercentageBounty are claimable even in the CLOSED state. For them the CLOSED 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 return true for TieredFixedBounty and TieredPercentageBounty if their state is OPEN or CLOSED.

Duplicate of #386

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue labels Feb 21, 2023
@sherlock-admin sherlock-admin added Non-Reward This issue will not receive a payout and removed Medium A valid Medium severity issue labels Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

1 participant