Hi nutrina,
Glad to see you active on the forums! I tested this just now but am not able to replicate the error. It seems to work fine for me. I created an ERC721 token called “High Roller” for the Coin Flip casino demo.
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract HighRoller is ERC721, Ownable {
constructor() public ERC721("High Roller", "HIRL") {
_setBaseURI("https://ipfs.moralis.io:2053/ipfs/");
}
function mint(address to, uint256 tokenId) public onlyOwner {
_mint(to, tokenId);
}
}
migration file
const HighRoller = artifacts.require("HighRoller");
module.exports = async function(deployer, network, accounts) {
await deployer.deploy(HighRoller);
const instance = await HighRoller.deployed();
await instance.mint(accounts[0], 1);
await instance.mint(accounts[0], 2);
};
I’m used ganache-cli
with the deterministic flag and a seed phrase. When I attempted to upgrade my ganache Moralis server instance to the latest version it got stuck spinning, so I created a fresh new server and tested with that.
- Perhaps try updating the the latest version of Moralis
- Does your ERC721 contract implement the metadata interface? That shouldn’t cause the function to fail though.