Web3.py ABI – How to Call Smart Contract Functions Without the ABI

abicontract-invocationweb3.py

I make python bots for smart contracts, but I'm not too much of an expert.

What I usually do is download the ABI from the block explorers. However, what if I want to call a function from any random contract address without having its ABI?

I want to make a way to generate the ABI for the function – where I know what's the name of the function, and what would be the inputs.

Best Answer

  • I suggest you to first take a look at this answer to get familiar with the ABI concept.
  • After reading that, you could use etherscan's api to do the job.

Hope this helps.