const serverUrl = âhttps://mg7bo35bvnr0.usemoralis.com:2053/serverâ;
const appId = âxltfxOMya7zPYfh6d4jzeYBeM1qAhLq2SuW0ObpAâ;
Moralis.start({ serverUrl, appId });
const TOKEN_CONTRACT_ADDRESS = â0x9bC9d174270872E6401ede67C0A8A6B0A959722câ;
init = async () => {
hideElement(userInfo);
hideElement(createItemForm);
Window.web3 = await Moralis.enableWeb3();
Window.tokenContract = new web3.eth.Contract(contracttokenAbi, TOKEN_CONTRACT_ADDRESS);
initUser();
};
im getting this error main.js:13 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading âContractâ)
This is my contract file;
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;
import â@openzeppelin/contracts/token/ERC721/ERC721.solâ;
import â@openzeppelin/contracts/utils/Counters.solâ;
contract nftToken is ERC721 {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor () ERC721('nftToken', 'RS'){}
struct Item{
uint256 id;
address creator;
string uri;
}
mapping(uint256 => Item) public Items;
function createItem(string memory uri) public returns(uint256){
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_safeMint(msg.sender, newItemId);
Items[newItemId] = Item(newItemId, msg.sender, uri);
return newItemId;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
return Items[tokenId].uri;
}
}
What i am getting wrong