As per the ERC721 requirements, I have to implement onERC721Recieved. This is how I did it:
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
)external returns(bytes4) {
return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
}
This seems to be in line with what is required of the function. However, this raises two questions:
- If this does not actually use any of the parameters, why pass the parameters to the function at all? It is now throwing errors every time I test the contract.
- What is the reason behind this function?