onERC721Received
is implemented in the Streets
contract so that a user can directly send NFTs to it using safeTransferFrom
but since it doesn't update the stakes
mapping, there would be no way for the user to get back their NFT.
Streets
contract is meant to be able to receive NFTs sent directly to it's address but if a user does this (using safeTransferFrom
), they will have their NFT stuck in the contract forever. This is because the only way to get an NFT out of the Streets
contract is by calling the unstake
function which checks the stakes
mapping to make sure the user who had staked the NFT is the one unstaking it now. However, since onERC721Received
doesn't update the stakes
mapping, this check will fail and the user won't be able to get back their NFT.
Permanent loss of NFT.
Foundry
Put the staking logic in the onERC721Received
function as well.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.