I'm getting the error:
Contract "StarNotary" should be marked as abstract.
pragma solidity >=0.4.24;
import "../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract StarNotary is ERC721 {
struct Star {
string name;
}
mapping(uint256 => Star) public tokenIdToStarInfo;
mapping(uint256 => uint256) public starsForSale;
// Create Star using the Struct
function createStar(string memory _name, uint256 _tokenId) public {
Star memory newStar = Star(_name);
tokenIdToStarInfo[_tokenId] = newStar;
_mint(msg.sender, _tokenId);
}
// Putting an Star for sale (Adding the star tokenid into the mapping starsForSale, first verify that the sender is the owner)
function putStarUpForSale(uint256 _tokenId, uint256 _price) public {
require(
ownerOf(_tokenId) == msg.sender,
"You can't sale the Star you don't owned"
);
starsForSale[_tokenId] = _price;
}
function _make_payable(address x) internal pure returns (address payable) {
return address(uint160(x));
}
function buyStar(uint256 _tokenId) public payable {
require(starsForSale[_tokenId] > 0, "The Star should be up for sale");
uint256 starCost = starsForSale[_tokenId];
address ownerAddress = ownerOf(_tokenId);
require(msg.value > starCost, "You need to have enough Ether");
transferFrom(ownerAddress, msg.sender, _tokenId);
address payable ownerAddressPayable = _make_payable(ownerAddress);
ownerAddressPayable.transfer(starCost);
if (msg.value > starCost) {
msg.sender.transfer(msg.value - starCost);
}
}
}
What I know of abstract contracts is that they have to do with interfaces. I have a suspicion that it has to do with the inheritance from ERC721 of the Open Zeppelin library.
ERC721 has three interfaces it's inheriting from: IERC721, IERC721Metadata, IERC721Enumerable. Do I have to go through the entire list of functions from those three interfaces and fill in what's missing in either the StarNotary contract or ERC721?