Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Invalid

onERC721Recieved not implemented in contracts that are meant to receive NFTs

Summary

The NftLiquidator.sol, LendingPool.sol, RAACNFT.sol all don't have the onERC721Received function which would cause reverts to their safeTransferFrom functions

Vulnerability Details

These functions mentioned above all take in or accept NFTs but none of them implement the onERC721Recieved function that every smart contract needs to implement if they are to accept NFTs to prevent loss of tokens as EIP721 states here

A wallet/broker/auction application MUST implement the wallet interface if it will accept safe transfers.

````solidity
/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.
interface ERC721TokenReceiver {
/// @notice Handle the receipt of an NFT
/// @dev The ERC721 smart contract calls this function on the recipient
/// after a `transfer`. This function MAY throw to revert and reject the
/// transfer. Return of other than the magic value MUST result in the
/// transaction being reverted.
/// Note: the contract address is always the message sender.
/// @param _operator The address which called `safeTransferFrom` function
/// @param _from The address which previously owned the token
/// @param _tokenId The NFT identifier which is being transferred
/// @param _data Additional data with no specified format
/// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
/// unless throwing
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes _data) external returns(bytes4);
}

Impact

safeTransferFrom and transferFrom functions would revert since they don't implement the onERC721Received function

Tools Used

Manual Analysis

Recommendations

The onERC721Recieved function should be implemented.

Updates

Lead Judging Commences

inallhonesty Lead Judge
8 months ago
inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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