I am trying to deploy Smart-contract(ERC721) on my private ethereum network.
But I have this issue. Here is my genesis.
{
"config": {
"chainId": 3333,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"constantinopleBlock": 5,
"clique": {
"period": 5,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x5d29c706",
"extraData": "0x00000000000000000000000000000000000000000000000000000000000000000044b84dc52f7f9551ee3285b7f193ec67bcabf30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0xC1C960",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"alloc" : {
"0x12CA9233383Ab9a15473b9a0c4E70eB68EF3bBbC": {
"balance":"100000000000000000000"
},
"0x951e32829cB884e7E8c91Ea130942DF663503F64": {
"balance":"100000000000000000000"
},
"0x9e693059a0CAb71f88Fd8fCaF303520541298eEE": {
"balance":"100000000000000000000"
},
"0xB23B97c9d1703d4D381bD95bE9576F1787239d09": {
"balance":"100000000000000000000"
},
"0xE9Ae8A724c92Fd83E88fAA463B327421F7db7B72": {
"balance":"100000000000000000000"
}
}
}
I tried with truffle, but it has the same issue.
Here is my smartcontract
pragma solidity ^0.5.0;
import "../node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721.sol";
import "../node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721Metadata.sol";
import "../node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721Enumerable.sol";
import "../node_modules/openzeppelin-solidity/contracts/access/roles/MinterRole.sol";
contract FanTheBase is ERC721, ERC721Metadata, ERC721Enumerable {
constructor () ERC721Metadata("FanTheBase", "FTB") public {
// solhint-disable-previous-line no-empty-blocks
}
struct Color {
uint8 red;
uint8 green;
uint8 blue;
}
Color[] colors;
function mint() public {
Color memory _color = Color(uint8(now), uint8(now-1000), uint8(now-5500));
uint _id = colors.push(_color);
_mint(msg.sender, _id);
}
function getColorFromId(uint id) public view returns (uint8, uint8, uint8){
return (colors[id].red, colors[id].green, colors[id].blue);
}
}
it works with ganache or ropsten Test Network. But it gives me an error when I am trying to deploy it on private network.
I created POA on the aws, I needed to check the smart contract will work on private network before deploying on POA.
import "../node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721.sol";
you could haveimport "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol";
or use the new namingimport "@openzeppelin/contracts/token/ERC721/ERC721.sol";