ERC-721
Last updated
This tutorial helps you to create an example ERC-721 compatible token that conforms to , especially .
defines three events and 10 methods as below. supportsInterface
of ERC-721 is derived from and ERC-165 is a part of ERC-721. ERC-721 compatible tokens are the token contracts that implement ERC-721 and ERC-165 interfaces as below.
Based on above interface, developers may customize tokens by adding new features and logics, and deploy on Klaytn network. For more information, refer to official .
In this tutorial, you are going to implement MyERC721Card.sol
which implements a card-type non-fungible token, i.e. MyERC721Card
, which is an ERC-721 token. Each MyERC721Card
has name and level, e.g. "King" with level 1, "Queen" with level 1.
The rest of this tutorial is organized as follows.
1.1 Overall structure of MyERC721Card
code with whole MyERC721Card
code
1.2 Take a look at important functions
2.1 Deploying smart contract using Remix Online IDE
2.2 Deploying smart contract using truffle
MyERC721Card.sol
is based on OpenZeppelin's ERC721 implementation. A major part of the code in this tutorial is forked from .