Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

HollaDieWaldfee - Remaining funds cannot be refunded after partial refund #7

Closed
github-actions bot opened this issue Feb 21, 2023 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@github-actions
Copy link

github-actions bot commented Feb 21, 2023

HollaDieWaldfee

high

Remaining funds cannot be refunded after partial refund

Summary

Deposits to bounties can be refunded via the DepositManagerV1.refundDeposit function.

The amount to be refunded is capped at the availableFunds amount:

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L171-L179

And refunding can occur only once. This is since BountyCore.refundDeposit checks that the depositId has not already been refunded:

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L69

Vulnerability Detail

Think of the following situation:
Funder A has deposited 500 USDC.
Funder A wants to refund his deposits but only 200 USDC are available so he receives only 200 USDC.

Now he is unable to refund the remaining 300 USDC which he loses.

Also if this amount is not claimed it is stuck in the contract.

It should be possible for a funder to refund the remaining funds after a partial refund once the remaining funds become available.

Impact

Funders lose remaining funds after a partial refund and funds can get stuck in the bounty contract.

Code Snippet

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L152-L195

Tool used

Manual Review

Recommendation

It should be possible for a funder to refund the remaining funds after a partial refund once the remaining funds become available.

Duplicate of #257

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue labels Feb 21, 2023
@sherlock-admin sherlock-admin added Medium A valid Medium severity issue Reward A payout will be made for this issue and removed High A valid High 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 Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant