Very long synchronization with the network. What could be the reason and how to accelerate? Thanks!
Hi @Dan_Dan welcome to our community. Can you describe in more detail what you are trying to do and the issues you are seeing. We would love to help you out!
I am getting this error message when trying to call balanceOf function inside contract:
‘Could not transact with/call contract function, is contract deployed correctly and chain synced?’
Can someone point me in the right direction?
Hi @gkish could you share you code with us so we can better analyze what you’re trying to do?
I am trying to get ERC20 contract balance in my MetaMask wallet using python. What am I doing wrong? Thanks.
from web3 import Web3
MyWalletAddress = ‘…’
USDC_Address = ‘0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48’
API_KEY = ‘…’
ETHERSCAN_KEY = ‘…’
f = requests.get(link)
json = json.loads(f.text)
abi = json[‘result’]
w3 = Web3(Web3.HTTPProvider(infura_url))
contr = w3.eth.contract(MyWallet_address, abi=abi)
wei = contr.functions.balanceOf(MyWalletAddress).call()
balance = w3.fromWei(wei,‘ether’)
Mike, did you get a chance to check my code?