hello @abcoathup ,
Thanks for asking and reply , I use remix to deploy ERC721. I only get transaction failed no further information. I deployed EnumerableMap, EnumerableSet, SafeMath successfully on vm and privatechain, only deploy ERC721 failed.
I doubt three points.
-
ERC165 - _registerInterface do I need to deploy any contract for this ?
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
constructor(string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
secondly - abi in ERC721 contract. it looks like a feature in solidity, right ? Is abi internal variable ? if yes, which version of geth support this new feature ?
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory _tokenURI = _tokenURIs[tokenId];
// If there is no base URI, return the token URI.
if (bytes(_baseURI).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(_baseURI, _tokenURI));
}
// If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
return string(abi.encodePacked(_baseURI, tokenId.toString()));
}
thirdly - enable EIPs what eips I missed in genesis.json
"miningMethod" : "NoProof",
"homesteadForkBlock": "0x00",
"EIP150ForkBlock": "0x00",
"EIP158ForkBlock": "0x00",
"byzantiumForkBlock": "0x00",
"constantinopleForkBlock": "0x00",
My dev environment as following :
geth - 1.7.3-stable-4bb3c89d
myNFT - https://drive.google.com/file/d/1454wXTKxgpwFz6As97zTwbyt_HZqM6uA/view?usp=sharing
genesis.json - https://drive.google.com/file/d/1N5Dgsd5zh7urZikx0mxdfY06mmdWBlh-/view?usp=sharing