ERC1155Quest.withdrawRemainingTokens allow owner to withdraw token that should be reserved for claiming #322
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
Vulnerability details
Impact
Erc1155Quest allow owner to withdraw all balance from the Quest contract anytime, unlike in Erc20Quest where the owner's ability to withdraw token is significantly restricted (owner can only withdraw protocol fee, and remaining token less claimable portion). Although this is an privileged function, the way that its implementation deviated from the other Quest contract Erc20Quest made this Med RIsk since one may expect proper restriction in terms of admin withdrawing reward token when using ERC1155 token as ERC20 token.
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Erc1155Quest.sol#L54
Recommended Mitigation Steps
Implement checks as appeared in Erc20Quest
The text was updated successfully, but these errors were encountered: