Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

[M-2] `Streets` implements `IERC721Receiver` and allows users to lose their NFT if `IOneShot::safeTransferFrom()` is called

Description

ERC721::onERC721Received() is called by ERC721::safeTransferFrom() or ERC721::_safeMint(). For users to earn CRED, they need to transfer their NFT to Streets through Streets::stake()

Impact

Sending an NFT by calling IOneShot::safeTransferFrom() would mean losing the NFT

Recommended Mitigation

- import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
- contract Streets is IERC721Receiver {
+ contract Streets {
.
.
.
- function onERC721Received(address, address, uint256, bytes calldata) external pure override returns (bytes4) {
- return IERC721Receiver.onERC721Received.selector;
- }
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.