Closed code423n4 closed 1 year ago
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Quest.sol#L104
If the claim function runs out of gas, the caller can never claim any rewards without transferring the nfts to another address first
claim
Currently, the claim function loops over the msg.senders NFT's. If this list ever becomes too large, the function will run out of gas.
msg.sender
VSCode
Consider implementing pagination for reward claiming.
kirk-baird marked the issue as duplicate of #135
kirk-baird marked the issue as satisfactory
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Quest.sol#L104
Vulnerability details
Impact
If the
claim
function runs out of gas, the caller can never claim any rewards without transferring the nfts to another address firstProof of Concept
Currently, the
claim
function loops over themsg.sender
s NFT's. If this list ever becomes too large, the function will run out of gas.Tools Used
VSCode
Recommended Mitigation Steps
Consider implementing pagination for reward claiming.