Submitted by EV_om
The StakingBase contract allows users to stake services represented by ERC721 tokens. These services are freely transferable, meaning they could be staked by contracts that do not implement the ERC721TokenReceiver interface.
When a user calls unstake() to withdraw their staked service, the contract attempts to transfer the ERC721 token back to the msg.sender (which must match the original depositor) using safeTransferFrom():
However, if the owner is a contract that does not support receiving ERC721 tokens, this transfer will fail. As a result, the service associated with serviceId will be permanently locked in the StakingBase contract, and the original owner will be unable to recover it.
Staked services will become permanently irrecoverable if the owner cannot receive ERC721 tokens.
Consider using transferFrom() instead of safeTransferFrom() when transferring the service back to the owner in unstake(). This will allow the transfer to succeed even if the recipient is not an ERC721 receiver.
ERC721
kupermind (Olas) disputed and commented:
kupermind (Olas) acknowledged and commented:
0xA5DF (judge) decreased severity to Medium and commented:
Olas mitigated
Varun_05 (warden) commented:
