Cant call solidity function from app.js?

Solidity function function betOnTeam(uint team) payable public { emit LogInfo(“INSIDE betOnTeam——————–“); if(team == 1) { if(msg.value == amount) { homeBet = msg.sender; if(homeBet != 0 && awayBet != 0) { //oraclize_query(“URL”, url); oraclize_query(“URL”, “json(https://api.crowdscores.com/v1/matches/123945?api_key=93c4c515196741beaf5e4528b64ea511).outcome.winner”); update(); } } else { throw; } } Here is the .JS file through which i am trying to call this…

How to get contract Balance of ERC20 TOken?

I have my smart contract here https://ropsten.etherscan.io/address/0xE462CbEE0cd420f6c199B0194B1D8D93Fb5e7720#writeContract I want to display the total token Balance of AGI inside my contract. My contract also mints SNET which I also want to display on my website. I use this code window.addEventListener(‘load’, () => { // Wait for loading completion to avoid race conditions with web3 injection timing.…

Error when connecting to web3 and metamask

I use this code to connect ui with smart contract window.addEventListener(‘load’, () => { // Wait for loading completion to avoid race conditions with web3 injection timing. if (window.ethereum) { const web3 = new Web3(window.ethereum); try { // Request account access if needed await window.ethereum.enable(); currentAddress = web3js.eth.accounts[0] // Acccounts now exposed return web3; }…