'How to get all specific cryptocurrency platform contracts?
Usually, we need ABI to decode the data in a transaction. Now I want to ask whether we can get all contracts of a specified cryptocurrency. For example, I have a batch of txs waiting to be decoded and they all invoked MakerDao contracts. How can I get all MakerDao ABI by one grab in the database?
Or this is how I used to get contract ABI
connector = f"https://api.etherscan.io/api?module=contract&action=getabi&address={Address}&apikey={self.Etherscan_key}"
self.Abi = basic_json.loads(requests.get(connector).text)
how to know which platform(E.g MakerDao, Aave or Compound, etc.) this contract belong to?
Solution 1:[1]
This is, unfortunately, impossible. To do this, one would need to both be able to detect if a contract implements an ABI (not possible), and to enumerate all smart contracts (even less possible).
It is impossible to detect if a smart contract implements an ABI because of the fact that ABIs are actually abstractions. Ethereum itself has no idea of what a function is.
It's even less possible to enumerate all smart contracts because every address is actually a smart contract (yes, that includes your own wallet). However, even detecting non-empty addresses is extremely difficult as it would require going through the entire blockchain searching for contract deployments (which would appear as ether transfers to the zero address).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pandapip1 |
