Ethereum Asked by Uzair Kath on December 14, 2020
token.methods.balanceOf(accounts[0]).call().then(result=>{
console.log(result);
$creditsValue.innerHTML = result;
});
In this code when I try to fetch the balance from the contract dynamically it does not work and returns 0.
But when I check the balance manually it works like this:
token.methods.balanceOf('0xC9bb53aBc2DAA3726D6D2FD38B2664F2889EBb0d').call().then(result=>{
console.log(result);
$creditsValue.innerHTML = result;
});
Although the dynamic expression works fine in local network, but this problem is arising on the test network
Can someone please tell what’s the problem it is urgent
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP