Erc1155Quest.withdrawRemainingTokens() will withdraw all remaining tokens including unclaimed tokens #95
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-528
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Erc1155Quest.sol#L54-L63
Vulnerability details
Impact
Quest.claim() will always revert after Erc1155Quest.withdrawRemainingTokens() has been called.
Unclaimed users/receipts will not be able to claim, their rewards will lose.
Proof of Concept
Erc1155Quest.withdrawRemainingTokens() will withdraw all remaining tokens including unclaimed tokens:
Therefore, after it's called, anyone calling
claim()
will revert because there are no reward tokens left in the contract.While the
Erc20Quest.withdrawRemainingTokens()
will leave the unclaimedTokens in the contract forclaim()
:Tools Used
VS Code
Recommended Mitigation Steps
We should leave the unclaimed tokens in the contract when calling Erc1155Quest.withdrawRemainingTokens(), just as the
Erc20Quest.withdrawRemainingTokens()
did.The text was updated successfully, but these errors were encountered: