- Create a new contract that inherits the BasicERC721 contract created in the previous recipe. This removes the need to declare the token and ownership properties:
pragma solidity ^0.4.23;import "./BasicERC721.sol";contract ERC721Token { //...}
- A token can be transferred by the owner or by the approved person. The approval can be of two types. The user can set approval for one specific token or all the tokens owned by an address. Create two different mappings to maintain this:
// Mapping from token ID to approved addressmapping (uint256 => address) internal tokenApprovals;// Mapping from owner to operator approvalsmapping (address => mapping (address => bool)) internal operatorApprovals;
- Declare dedicated functions to verify ...