I am trying to upgrade a project from ERC721CToken.sol contract to ERC721.sol contract
/// Requires the amount of Ether be at least or more of the currentPrice /// Creates an instance of an token and mints it to the purchaser /// _type The token type as an integer /// _title The short title of the token function buyToken ( uint256 _type, string calldata _title ) external payable { bytes memory _titleBytes = bytes(_title); require(_titleBytes.length >= TITLE_MIN_LENGTH, "Title is too short"); require(_titleBytes.length <= TITLE_MAX_LENGTH, "Title is too long"); require(msg.value >= currentPrice, "Amount of Ether sent too small"); uint256 index = allTokens.length + 1; _mint(msg.sender, index); tokenTypes[index] = _type; tokenTitles[index] = _title; emit BoughtToken(msg.sender, index); } /** * Returns all of the tokens that the user owns * An array of token indices */ function myTokens() external view returns ( uint256[] memory ) { return ownedTokens[msg.sender]; }
Environment
I am using truffle with "@openzeppelin/contracts": "^2.5.0",
Details
I would like to upgrade the above methods to ERC721 format. What will be the equivalent methods for the above?
Code to reproduce