I am attempting to create a Factory which mints NFTs and while it seems that my transaction has completed, metamask does not register the NFT. See the screenshots of my app: https://imgur.com/a/XWxgQJb
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9; import "./ERC721Token.sol"; contract Factory { event ERC721TokenCreated(address tokenAddress); function deployNewERC721Token(string memory name, string memory symbol) public returns (address) { ERC721Token t = new ERC721Token(name, symbol); emit ERC721TokenCreated(address(t)); return address(t); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9; import "../node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "../node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "../node_modules/@openzeppelin/contracts/utils/Counters.sol"; contract ERC721Token is IERC721Metadata, ERC721URIStorage { using Counters for Counters.Counter; Counters.Counter private _tokenIds; event awardNewItem(uint256 indexed newItemId); constructor(string memory name, string memory symbol) ERC721(name, symbol) {} function awardItem(address player, string memory tokenURI) public returns (uint256) { _tokenIds.increment(); uint256 newItemId = _tokenIds.current(); _mint(player, newItemId); _setTokenURI(newItemId, tokenURI); emit awardNewItem(newItemId); return newItemId; } }
var factory = new web3.eth.Contract(FactoryJson.abi, FactoryAddress); const deployedERC721Token = await factory.methods .deployNewERC721Token("Demo ERC721 Token", "DEMO721") .send({ from: web3.currentProvider.selectedAddress, gasPrice: '1000000000000', gas: 5000000 }); console.log("deployedERC721Token", deployedERC721Token);