Some accounts are unable to claim their ERC1155 reward, despite having completed the quest. But this is a medium severity, because it concerns only the smart contracts-based accounts (not EOAs) who did not implement the onERC1155Received hook.
Proof of Concept
If msg.sender of the claim function of Quest contract is a smart contract who did not implement a onERC1155Received hook, then his rewards are stuck in the Quest contract.
Recommended Mitigation Steps
Check if onERC1155Received hook is implemented in a participant contract before whitelisting him off-chain, for example by calling supportsInterface(ERC1155HolderID)and checking that the result is true, on the receiving contract.
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/main/contracts/Erc1155Quest.sol#L42
Vulnerability details
Impact
Some accounts are unable to claim their ERC1155 reward, despite having completed the quest. But this is a medium severity, because it concerns only the smart contracts-based accounts (not EOAs) who did not implement the
onERC1155Received
hook.Proof of Concept
If msg.sender of the
claim
function ofQuest
contract is a smart contract who did not implement aonERC1155Received
hook, then his rewards are stuck in the Quest contract.Recommended Mitigation Steps
Check if
onERC1155Received
hook is implemented in a participant contract before whitelisting him off-chain, for example by callingsupportsInterface(ERC1155HolderID)
and checking that the result is true, on the receiving contract.