thats my main js file , i want to read totalsupply from my contract which is on mainnet bsc…
and print it on my console ,
login = async () => {
Moralis.Web3.authenticate().then(function (user) {
console.log(user.get('ethAddress'))
})
}
async function cptsupply() {
const web3 = await moralis.enable();
const options = {
chain: "bsc",
address: "0x28e4f32fa7e842ad0a6e530bb6b4ec03b36d5078",
function_name: "totalSupply",
abi: window.abi,
};
const allowance = await Moralis.runContractFunction(options);
console.log(allowance);
}