I have created an ERC721 Contract and put it up on Ropsten just for testing. (here is the contract address:0x4D650FeB68b26B1f9F16a85e965d935e1A01BEb7). I used openzepplin for all of the actual contracts in fact I didnt change anything and the main contract I am interacting with is below. So Ive written some code to interact with it using Web3. I try the awardItem function and nothing really happens. I am confused cause I thought a function that would need to do any calculations would require it to be payable and to create a transaction. But looking at the base code they have I dont see payable anywhere. Is this normal or am I missing something really important? I ran the awardItem function several times but it seems like it doesnt actually do anything and I cant figure out what the tokenID exactly is, looks like its just 1. At any rate, any ideas or suggestions would greatly be appreciated!!
// contracts/GameItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import “@openzeppelin/contracts/token/ERC721/ERC721.sol”;
import “@openzeppelin/contracts/utils/Counters.sol”;
contract GameItem is ERC721 {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() public ERC721("GameItem", "ITM") {}
function awardItem(address player, string memory tokenURI)
public
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(player, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}
}