Complete the code to declare the ERC-721 interface.
interface IERC721 is IERC165 {
function [1](address owner) external view returns (uint256);
}The function name in the ERC-721 standard is balanceOf, which returns the number of NFTs owned by an address.
Complete the code to emit the Transfer event when an NFT is transferred.
event Transfer(address indexed from, address indexed to, uint256 indexed [1]);
The ERC-721 standard defines the Transfer event with the third parameter named tokenId, representing the NFT's unique identifier.
Fix the error in the function signature for safeTransferFrom with data parameter.
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata [1]) external;
The ERC-721 standard defines the last parameter of safeTransferFrom as bytes calldata data, which allows passing additional data with the transfer.
Fill both blanks to complete the mapping declaration for token owners and balances.
mapping(uint256 => address) private [1]; mapping(address => uint256) private [2];
In the ERC-721 implementation, _owners maps token IDs to owner addresses, and _balances maps owner addresses to their token count.
Fill all three blanks to complete the function that checks if an address is approved or owner of a token.
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
address owner = [1](tokenId);
return (spender == owner || spender == [2](tokenId) || isApprovedForAll(owner, [3]));
}The function uses ownerOf to get the token owner, getApproved to get the approved address for the token, and compares spender to check permissions.