Contract Serializer

Microservice to extract structured information on EVM smart contract.



Modern NFT contracts may have different names for getPrice, mint and totalSupply methods (or even be a property instead). So it is hard to extract the information and call methods – they just have different names!

The purpose of this tool is to extract NFT contract information in structured way with common names for same properties.

How does it work?

It basically utilises Etherscan API and parse Etherscan ‘Read Contract’ page using BS4.


Check deployed demo: Open link to read the swagger docs.

Get contract’s static variables

Params: chain_id, contract_address

Example response

  "data": {
    "raw_data": {
      "DEVELOPER": "",
      "DEVELOPER_ADDRESS": "0x704c043ceb93bd6cbe570c6a2708c3e1c0310587",
      "MAX_SUPPLY": "10000",
      "MAX_TOKENS_PER_MINT": "20",
      "PROVENANCE_HASH": " ",
      "REFERRAL_PERCENT": "3000",
      "baseURI": "",
      "contractURI": "",
      "getPrice": "200000000000000000000",
      "getReservedLeft": "0",
      "name": "NFT Moon Metaverse",
      "owner": "0x197727ad2ec7326952843fbd83a0d57b907afbdf",
      "saleStarted": "True",
      "startingIndex": "0",
      "symbol": "MOON",
      "totalSupply": "178"
    "serialized": {
      "nft_contract": {
        "price": 200000000000000000000,
        "total_supply": 178,
        "max_supply": 10000,
        "paused": false,
        "max_tokens_per_mint": 20,
        "base_uri": ""
  "contract_address": "0xbc1fe0f3b02ce5ff516f14ac7b79dd6397a54b9c",
  "chain_id": 137

Get ABI of a contract in network

Params: chain_id, contract_address
Example response:

Local development

  1. Copy .env_template file to .env and fill it with your Etherscan creadentials.

  2. Run fastapi server:

uvicorn main:app --reload

Made by team


View Github