{"version":3,"sources":["util/interact.js","WonderGame.js","App.js","reportWebVitals.js","index.js"],"names":["require","config","web3","createAlchemyWeb3","process","contractABI","contractAddress","NetworkID","NetworkName","CMaxSpp","Number","WonderGameContract","eth","Contract","loadStatus","a","methods","paused","call","p","loadCost","cost","c","loadTotalSupply","totalSupply","ts","loadMaxMintAmount","maxMintAmount","mna","wcprovider","providerOptions","walletconnect","package","window","WalletConnectProvider","default","options","rpc","1","5","web3Modal","Web3Modal","cacheProvider","disableInjectedProvider","theme","background","main","secondary","border","hover","connectWallet","connect","_provider","fetchAccountData","address","status","WAuthorized","Provider","Balance","onDisconnect","clearCachedProvider","library","ethers","providers","Web3Provider","listAccounts","_accounts","getNetwork","chainId","toString","switchNetwork","_selectedAccount","length","CheckWalletAddress","request","method","params","waresponse","updateMint","txHash","amnt","m","encodeURIComponent","location","fetch","headers","getCurrentWalletConnected","cachedProvider","mintFunction","message","_library","_account","trim","transactionParameters","to","from","value","utils","toHex","toWei","data","mint","encodeABI","target","href","WonderGame","useState","walletAddress","setWallet","setStatus","setWAuthorized","MintAmount","setMintAmount","Cost","setCost","CStatus","setCStatus","TotalSupply","setTotalSupply","MaxMintAmount","setMaxMintAmount","MaxSupply","useEffect","addWalletListener","prvdr","on","accounts","r","connectWalletPressed","walletResponse","onMintPressed","className","data-collapse","src","alt","style","maxWidth","id","onClick","title","String","substring","width","name","data-name","htmlFor","type","autoFocus","min","max","readOnly","onChange","e","defaultValue","required","document","getElementById","stepDown","xmlns","height","viewBox","fill","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","stepUp","App","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode"],"mappings":"q0QAGAA,EAAQ,KAAUC,SAIlB,IAEMC,GAAOC,EADiBH,EAAQ,KAA9BG,mBAD6FC,yEAI/FC,EAAcL,EAAQ,KAEtBM,EAAkBF,6CAKlBG,EAAmGH,IAEnGI,EAAiGJ,mBAGjGK,GADeC,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BAAKH,UAAU,iBAAf,SACI,qBAAKE,IAAK,sCAAuCC,IAAI,OAEzD,qBAAKH,UAAU,8BAAf,SACI,qBAAKE,IAAK,2CAA4CC,IAAI,GAAGH,UAAU,uB,OC7PhFqC,MARf,WACE,OACE,qBAAKrC,UAAU,MAAf,SACE,cAAC,EAAD,OCMSsC,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,8BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCDdQ,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFzB,SAASC,eAAe,SAM1Ba,M","file":"static/js/main.a5b68515.chunk.js","sourcesContent":["import { ethers } from 'ethers';\nimport Web3Modal from \"web3modal\";\n\nrequire(\"dotenv\").config();\n\n\n\nconst alchemyKey = process.env.REACT_APP_Dev_Mode === \"1\" ? process.env.REACT_APP_Test_Network_URL : process.env.REACT_APP_Main_Network_URL;\nconst { createAlchemyWeb3 } = require(\"@alch/alchemy-web3\");\nconst web3 = createAlchemyWeb3(alchemyKey);\n\nconst contractABI = require(\"../WG-Contract.json\");\n\nconst contractAddress = process.env.REACT_APP_CONTRACT_ADDRESS;\n\nconst CheckWhiteList = process.env.REACT_APP_Check_WhiteList;\nconst WhiteListURL = process.env.REACT_APP_WhiteListURL;\n\nconst NetworkID = process.env.REACT_APP_Dev_Mode === \"1\" ? process.env.REACT_APP_Test_Network_Version : process.env.REACT_APP_Main_Network_Version;\nconst NetworkChainID = process.env.REACT_APP_Dev_Mode === \"1\" ? process.env.REACT_APP_Test_Network_chainId : process.env.REACT_APP_Main_Network_chainId;\nconst NetworkName = process.env.REACT_APP_Dev_Mode === \"1\" ? process.env.REACT_APP_Test_Network_Name : process.env.REACT_APP_Main_Network_Name;\nconst EtherscanURL = process.env.REACT_APP_Dev_Mode === \"1\" ? process.env.REACT_APP_Test_Etherscan_url : process.env.REACT_APP_Main_Etherscan_url\nconst WalletMxMint = Number(process.env.REACT_APP_Wallet_Max_Mint_Amount);\nconst CMaxSpp = Number(process.env.REACT_APP_Max_Supply);\n\nexport const WonderGameContract = new web3.eth.Contract(\n contractABI,\n contractAddress\n);\n\n\nexport const loadStatus = async () => {\n const p = await WonderGameContract.methods.paused().call();\n return !p;\n};\n\nexport const loadCost = async () => {\n const c = await WonderGameContract.methods.cost().call();\n return c;\n};\n\nexport const loadMaxSupply = async () => {\n const ms = await WonderGameContract.methods.maxSupply().call();\n return ms;\n};\nexport const loadTotalSupply = async () => {\n const ts = await WonderGameContract.methods.totalSupply().call();\n return ts >CMaxSpp ? CMaxSpp : ts;\n};\n\nexport const loadMaxMintAmount = async () => {\n const mna = await WonderGameContract.methods.maxMintAmount().call();\n return mna;\n};\nexport const loadSymbol = async () => {\n const smb = await WonderGameContract.methods.symbol().call();\n return smb;\n};\nexport const loadBalanceOf = async (address) => {\n const bo = await WonderGameContract.methods.balanceOf(address).call();\n return bo;\n};\n\n\nexport const loadWalletOfOwner = async (address) => {\n const wo = await WonderGameContract.methods.walletOfOwner(address).call();\n return wo;\n};\n\nexport const loadOwnerOf = async (tid) => {\n const ad = await WonderGameContract.methods.ownerOf(tid).call();\n return ad;\n};\n\nlet wcprovider=null;\nconst WalletConnectProvider = window.WalletConnectProvider.default;\nconst providerOptions = {\n walletconnect: {\n package: WalletConnectProvider,\n options: {\n rpc: {\n 1 : process.env.REACT_APP_Main_Network_URL,\n 5 : process.env.REACT_APP_Test_Network_URL\n }\n }\n }\n};\n\nconst web3Modal = new Web3Modal({\n cacheProvider: true,\n providerOptions,\n disableInjectedProvider: false,\n theme: {\n background: \"#BFCAF7\",\n main: \"#000\",\n secondary: \"#000\",\n border: \"transparent\",\n hover: \"#fff\"\n }\n});\n\nexport const connectWallet = async () => {\n\n try {\n const _provider = await web3Modal.connect();\n wcprovider = _provider;\n return fetchAccountData();\n } catch (e) {\n return {\n address: \"\",\n status: \"Wallet Connection Error!\" ,\n WAuthorized :\"\",\n Provider: null,\n Balance:0\n };\n }\n};\n\nexport const onDisconnect = async () => {\n await web3Modal.clearCachedProvider();\n wcprovider = null;\n}\n\nexport const fetchAccountData = async () => {\n try\n {\n const library = new ethers.providers.Web3Provider(wcprovider);\n const _accounts = await library.listAccounts();\n const _Netowrk = await library.getNetwork();\n if (_Netowrk.chainId.toString() !== NetworkID) {\n if( await switchNetwork() === false)\n {\n return {\n address: \"\",\n status: \"😥 Unable to switch network to \" + NetworkName,\n WAuthorized :\"\",\n Provider: null,\n Balance:0\n };\n }\n }\n const _selectedAccount = _accounts.length > 0 ? _accounts[0] : \"\";\n return {\n address: _selectedAccount,\n WAuthorized : await CheckWalletAddress(_selectedAccount),\n Provider: wcprovider,\n Balance: 0\n };\n }\n catch{\n return {\n status: \"Please connect using the top right button.\",\n address: \"\",\n WAuthorized : \"\",\n Provider: \"\",\n Balance:0\n };\n }\n}\n\nconst switchNetwork =async () => {\n try {\n await wcprovider.request({\n method: \"wallet_switchEthereumChain\",\n params: [{ chainId: NetworkChainID }],\n });\n return true;\n } catch (switchError) {\n return false;\n }\n}\n\nexport const CheckWalletAddress = async (address) => {\n if(CheckWhiteList === \"yes\")\n {\n var waresponse= \"false\";\n try{\n await fetch(WhiteListURL + address,{method: \"GET\" , headers : {\"Accept\": \"application/json\",\"Access-Control-Allow-Origin\" :\"*\",\"Access-Control-Allow-Headers\" : \"Content-Type\" , \"Access-Control-Allow-Methods\" :\"GET\" } })\n .then(response => response.json())\n .then(function(jsonresponse) {\n if(jsonresponse.isWhitelist === true){\n waresponse=\"true\";\n }\n else\n {\n waresponse=\"false\";\n }\n })\n .catch((err) => {\n waresponse=\"false\";\n });\n }\n catch {\n waresponse=\"false\";\n }\n return waresponse;\n }\n else\n {\n return \"true\";\n }\n};\n\nexport const updateMint = async (address,txHash,amnt) => {\n try{\n const m = process.env.REACT_APP_UpdateMintURL + \"_Address=\" + encodeURIComponent(address) + \"&_TxHash=\" + encodeURIComponent(txHash) + \"&_MintURL=\" + encodeURIComponent(window.location) +\"&_MintAmount=\" + encodeURIComponent(amnt);\n await fetch( m ,{method: \"GET\" , headers : {\"Accept\": \"application/json\",\"Access-Control-Allow-Origin\" :\"*\",\"Access-Control-Allow-Headers\" : \"Content-Type\" , \"Access-Control-Allow-Methods\" :\"GET\" } });\n }\n catch {\n }\n};\n\nexport const getCurrentWalletConnected = async () => {\n if (web3Modal.cachedProvider) {\n return await connectWallet();\n }\n else\n {\n return {\n address: \"\",\n status: \"\" ,\n WAuthorized :\"\",\n Provider: null\n \n };\n }\n};\n\nexport const mintFunction = async (address, message) => {\n const CStatus = await loadStatus();\n if(CStatus===false)\n {\n return {status: \"❌ NFT Minting not started.\"};\n }\n \n if (typeof (wcprovider) == 'undefined' || wcprovider == null || address===\"\") {\n //await connectWallet();\n return {\n status: \"Please connect your wallet using the top right button\"\n };\n}\n \n const wauth= await CheckWalletAddress(address);\n if(wauth === \"false\")\n {\n return {status: \"❌ Wallet is not whitelisted.\"};\n }\n\n // const bo= Number(await loadBalanceOf(address));\n // if( (bo + Number(message)) > WalletMxMint )\n // {\n // if(bo===WalletMxMint)\n // {\n // return {status: \"❌ you have exceeded the max mint allowed\"};\n // }\n // else\n // {\n // return {status: \"❌ your maximum NFTs to mint is: \" + (bo > WalletMxMint ? 0 : WalletMxMint - bo)};\n // }\n // }\n const ts= Number(await loadTotalSupply());\n if( (ts + Number(message)) > CMaxSpp)\n {\n return {status: \"❌ NFT Minting is Paused.\"};\n }\n \n const _library = new ethers.providers.Web3Provider(wcprovider);\n const _account = await _library.listAccounts();\n const _Netwrk = await _library.getNetwork();\n\n if(_Netwrk.chainId.toString() !== NetworkID.toString())\n {\n return {\n status:\n \"Please switch the network in your wallet to \" + NetworkName,\n };\n }\n\n if(_account.length === 0){\n return {\n status: \"Please connect your wallet using the top right button\"\n };\n }\n\n if (message.trim() === \"0\") {\n return {\n status: \"❌ \",\n };\n }\n \n const a = await loadCost();\n const transactionParameters = {\n to: contractAddress, \n from: address, \n value: web3.utils.toHex(web3.utils.toWei((a * Number(message)).toString(), \"wei\")),\n //value: parseInt(web3.utils.toWei(web3.utils.toBN(a * Number(message)) ,'wei')).toString(16) ,\n data: WonderGameContract.methods.mint(address,message).encodeABI(),\n };\n\n \n try {\n const txHash = await wcprovider.request({\n method: \"eth_sendTransaction\",\n params: [transactionParameters],\n });\n await updateMint(address,txHash,message);\n return {\n status: (\n \n Please check the transaction in your Wallet, or click here to view the transaction on ehterscan.\n \n ),\n };\n } catch (error) {\n return {\n status: \"Wallet Error: \" + error.message,\n };\n }\n};\n\n\nexport const addTokenMetamask = async() => {\n const smb = await loadSymbol();\n await window.ethereum.request({\n method: 'wallet_watchAsset',\n params: {\n type: 'ERC20', \n options: {\n address: contractAddress, \n symbol: smb, \n decimals: 0, \n },\n },\n });\n}\n\n\n//{/*
\n// Click here to add WonderGame Metaverse NFT to your Metamask wallet. */}","import React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport Countdown from 'react-countdown';\nimport {\n connectWallet,\n mintFunction,\n loadCost,\n loadStatus,\n loadTotalSupply,\n loadMaxMintAmount,\n getCurrentWalletConnected,\n CheckWalletAddress,\n fetchAccountData,\n onDisconnect,\n} from \"./util/interact.js\";\n\n\n\nconst WonderGame = () => {\n const [walletAddress, setWallet] = useState(\"\");\n const [status, setStatus] = useState(\"\");\n const [WAuthorized, setWAuthorized] = useState(\"\");\n const [MintAmount, setMintAmount] = useState(\"2\");\n const [Cost, setCost] = useState(0);\n const [CStatus, setCStatus] = useState(false);\n const [TotalSupply, setTotalSupply] = useState(0);\n const [MaxMintAmount, setMaxMintAmount] = useState(2);\n const [MaxSupply, setMaxSupply] = useState(Number(process.env.REACT_APP_Max_Supply));\n useEffect(async () => {\n const Cost = await loadCost();\n setCost(Cost);\n const CStatus = await loadStatus();\n setCStatus(CStatus);\n const TotalSupply = await loadTotalSupply();\n setTotalSupply(TotalSupply);\n const MaxMintAmount = await loadMaxMintAmount();\n setMaxMintAmount(MaxMintAmount);\n const { address, status,WAuthorized,Provider } = await getCurrentWalletConnected();\n setWallet(address);\n setStatus(status);\n setWAuthorized(WAuthorized);\n addWalletListener(Provider);\n addWalletListener();\n }, []);\n\n // useEffect(async () => {\n // const timer = setTimeout(async () => { const TotalSupply2 = await loadTotalSupply();setTotalSupply(TotalSupply2); }, 60e3)\n // return () => clearTimeout(timer)\n // });\n\n \n\n const addWalletListener = (prvdr) => {\n if(prvdr!==null && typeof(prvdr) !== typeof(undefined)){\n prvdr.on(\"accountsChanged\", async(accounts) => {\n const r = await fetchAccountData();\n setWallet(r.address);\n setStatus(r.status);\n setWAuthorized(r.WAuthorized);\n if(r.address===\"\"){\n await onDisconnect();\n }\n else\n {\n // const tma = await loadTokensMintedPerAddress(CStatus,r.address);\n // setTokenMintedAddress(tma);\n //setMintAmount(MaxMintAmount-tma);\n }\n });\n prvdr.on(\"chainChanged\", async (chainId) => {\n const r = await fetchAccountData();\n setWallet(r.address);\n setStatus(r.status);\n setWAuthorized(r.WAuthorized);\n });\n prvdr.on(\"disconnect\", () => {\n onDisconnect();\n });\n }\n }\n // function updateWallet(wa,wst,watz){\n // setWallet(wa);\n // setStatus(wst);\n // setWAuthorized(watz);\n // }\n \n const connectWalletPressed = async () => {\n if(walletAddress===\"\"){\n const walletResponse = await connectWallet();\n setStatus(walletResponse.status);\n setWallet(walletResponse.address);\n setWAuthorized(walletResponse.WAuthorized);\n //const tma = await loadTokensMintedPerAddress(CStatus,walletResponse.address);\n //setTokenMintedAddress(tma);\n //setMintAmount(MaxMintAmount-tma);\n await addWalletListener(walletResponse.Provider);\n }\n else\n {\n await onDisconnect();\n setStatus(\"\");\n setWallet(\"\");\n setWAuthorized(\"\");\n //setTokenMintedAddress(0);\n //setMintAmount(MaxMintAmount);\n }\n };\n\n \n const onMintPressed = async () => {\n const { status } = await mintFunction(walletAddress, MintAmount);\n setStatus(status);\n if(status === \"Please connect your wallet using the top right button\"){\n await connectWalletPressed();\n }\n };\n\n const renderer = ({days, hours, minutes, seconds, completed }) => {\n if (completed) {\n //setCStatus(false);\n return ;\n } else {\n return