That link is broken, but I'll give it a whirl.
We would like to use the Etherscan Developer API to review transactions against a given contract address and find out:
- Does this contract implement ERC-721?
- What is the list of token transfers on this contract or other useful info.
There is a lot you can do with the Etherscan Developer API. For example, here's one URL that pulls data from Ethereum Mainnet -> Etherscan -> JSON parser -> Shields.io and renders it as an image to calculate the number of Su Squares remaining for sale:
First, the source documentation is at https://etherscan.io/apis
It is not possible to determine which contracts support ERC-721. Source: The ERC-721 Validator. So we are going to have to use some approximation.
Here is a some ERC-721 contract, I won't tell you which one: 0xE9e3F9cfc1A64DFca53614a0182CFAD56c10624F.
We can use a special query against Etherscan to guess if it is ERC-721 compliant. This will check the original contract creation code (limiting the
Just load that file and grep that code for
42842e0e, the function signature for
safeTransferFrom(address,address,uint256) and boom you found it! This makes me pretty confident because I don't expect non-721 contracts to implement that method. This approach is not fail-safe, because there are function signature collisions (expect to try 500k attempts* to collide with that one), because contracts can lie, and because a contract can use a proxy to another backing implementation.
Likewise, you can query more transactions and filter on
input begins with
42842e0e to find transfers. This is still a big approximation because those transfers might fail and also because there are many ways (including internal transactions) to transfer rather than using the
This is a fun tool to test and have fun with, but for actual analysis you will want to use a real tool.
- 2^32 byte combinations * 0.5 collision luck factor / ~5000 bytes per contract initialization