Hello
When compiling the Kitties contract I am getting the following Error:
I don’t understand what’s supposed to be wrong there… help!
pragma solidity ^0.5.12;
import "./IERC721.sol";
contract Kittycontract is IERC721 {
string public constant name = "EdiKitties";
string public constant symbol = "EK";
struct Kitty {
uint256 genes;
uint64 birthTime;
uint32 mumId;
uint32 dadId;
uint16 generation;
}
Kitty[] kitties;
mapping(uint256 => address) public kittyIndexToOwner;
mapping(address => uint256) ownershipTokenCount;
//Returns the number of tokens in ``owner``'s account.
function balanceOf(address owner) external view returns (uint256 balance) {
return ownershipTokenCount[owner];
}
//Returns the total number of tokens in circulation.
function totalSupply() public view returns (uint) {
return kitties.length;
}
/*
//Returns the name of the token.
function name() external view returns (string memory tokenName) {
return name;
}
//Returns the symbol of the token.
function symbol() external view returns (string memory tokenSymbol) {
return symbol;
}
*/
//Returns the owner of the `tokenId` token.
function ownerOf(uint256 _tokenId) external view returns (address) {
return kittyIndexToOwner[_tokenId];
}
function transfer(address _to, uint256 _tokenId) external {
require(_to != address(0));
require(_to != address(this));
require(_owns(msg.sender, _tokenId));
_transfer(msg.sender, _to, _tokenId);
}
function _transfer(address _from, address _to, uint256 _tokenId) internal {
ownershipTokenCount[_to]++;
kittyIndexToOwner[_tokenId] = _to;
if (_from != address(0)) {
ownershipTokenCount[_from]--;
}
// Emit the transfer event.
emit Transfer(_from, _to, _tokenId);
}
function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) {
return kittyIndexToOwner[_tokenId] == _claimant;
}
}