andelf / tronpy

TRON Python Client Library.
MIT License
212 stars 96 forks source link

Can not call a contract without ABI #100

Closed krau5 closed 1 year ago

krau5 commented 1 year ago

Hi! I had a perfectly working code and I've changed literally nothing, but today is stopped working in mainnet. Error says: ValueError: can not call a contract without ABI, although, it was working before. I am calling USDT contract. Address: TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t. What's wrong?

tx = (
  self._contract.functions.transfer(
    recipient,
    amount * 10 ** 6)
  .with_owner(self._address)
  .build()
  .sign(self._private_key)
)

response = self._tron_client.broadcast(tx)
krau5 commented 1 year ago

Even the documentation says nothing about the ABI when calling USDT contract

MrNaif2018 commented 1 year ago

Hi, check what the get_contract returns. Maybe it fails to parse data?

MrNaif2018 commented 1 year ago

ABI is fetched automatically from API indeed

krau5 commented 1 year ago

My bad, I got a problem with environment. Reinstalled the project, it worked