ERC721は、スマートコントラクト内でNon-Fungible Tokenを扱えるようにしたもの
pragma solidity ^0.4.23; import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol"; import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC721/ERC721Mintable.sol"; import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/ownership/Ownable.sol"; contract MyTokenCollection is ERC721Full, ERC721Mintable, Ownable { constructor() public ERC721Full("MyTokenCollection", "MTC"){} function mintTokenCollection(string _tokenURI) public { uint256 newTokenId = _getNextTokenId(); _mint(msg.sender, newTokeId); _setTokenURI(newTokenId, _tokenURI); } function _getNextTokenId() private view returns(uint256){ return totalSupply().add(1); } }
なるほど、Truffleもう一回ちょっとやり直す必要があるかな
Reactの勉強もしないといけないか…