Creating the ERC721 Token contract

We will start by creating a .sol file in our contracts directory and will name this file Condos.sol:

  1. We will begin writing our contract by first declaring the Solidity compiler version as shown here:
pragma solidity ^0.5.2;
  1. Next, as shown in the following code, we will import the dependent sample contract templates from the openzeppelin library:
import "openzeppelin-solidity/contracts/token/ERC721/ERC721Metadata.sol";

ERC721Metadata.sol is an extremely useful resource for creating non-fungible tokens. It implements the hashmap TokenURI for storing token metadata. This helps as the native ERC721 standard does not implement a standard for capturing token metadata. It can be used to quickly create an ERC721 ...

Get Blockchain Development for Finance Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.