I am working on a NFT project using the ERC721 token standard, and I cannot get the ERC721 contract to deploy in remix.
Here is the ERC721 contract:
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
function totalSupply() constant returns (uint256 totalSupply); //implemented
function implementsERC721() public pure returns (bool); //implemented
function balanceOf(address _owner) public view returns (uint256 _balance); //implemented
function ownerOf(uint256 _tokenId) public view returns (address _owner); //implemented
function transfer(address _to, uint256 _tokenId) public; //implemented
function approve(address _to, uint256 _tokenId) public; //implemented
function takeOwnership(uint256 _tokenId) public; //implemented
function transferFrom(address _from, address _to, uint _tokenId) public; //implemented
}
Here is the contract that implements all of the functions:
contract OwlOwnership is ERC721, OwlHatchery {
using SafeMath for uint256;
modifier onlyOwnerOf(uint _owlId) {
require(msg.sender == owlToOwner[_owlId]);
_;
}
mapping (uint => address) owlApprovals;
function implementsERC721() public pure returns (bool) {
return true;
}
function balanceOf(address _owner) public view returns (uint256 _balance) {
return ownerOwlCount[_owner];
}
function ownerOf(uint256 _tokenId) public view returns (address _owner) {
return owlToOwner[_tokenId];
}
function _owns(address _claimant, uint256 _tokenId) internal view returns (bool){
return owlToOwner[_tokenId] == _claimant;
}
function _approvedFor(address _claimant, uint256 _tokenId) internal view returns (bool){
return owlApprovals[_tokenId] == _claimant;
}
function _transfer(address _from, address _to, uint256 _tokenId) private {
ownerOwlCount[_to] = ownerOwlCount[_to].add(1);
ownerOwlCount[msg.sender] = ownerOwlCount[msg.sender].sub(1);
owlToOwner[_tokenId] = _to;
Transfer(_from, _to, _tokenId);
}
function transfer(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) {
_transfer(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) {
require(_to != address(0));
require(_to != address(this));
require(_approvedFor(msg.sender, _tokenId));
require(_owns(_from, _tokenId));
_transfer(_from, _to, _tokenId);
}
function approve(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) {
owlApprovals[_tokenId] = _to;
Approval(msg.sender, _to, _tokenId);
}
function takeOwnership(uint256 _tokenId) public {
require(owlApprovals[_tokenId] == msg.sender);
address owner = ownerOf(_tokenId);
_transfer(owner, msg.sender, _tokenId);
}
}
I can deploy all other contracts in my project besides the ERC721 contract. I keep getting "This contract does not implement all functions and thus cannot be created.". Any ideas?