Skip to main content

contract

The contract query retrieves information about a specific smart contract.

It returns a Contract object containing all contract metadata, token standard implementations, holder counts, creation details, and associated token information.

Schema Definition

contract(
address: String!
): Contract

Arguments

ArgumentTypeDescription
addressString! non-null scalarThe address of the smart contract to retrieve.

Return Type

Contract object

Common Use Cases

  • Display contract metadata (name, symbol, decimals) in token explorers, portfolio trackers, and trading interfaces.
  • Verify smart contract details and token standard implementations (ERC-20, ERC-721, ERC-1155) for wallet integrations and dApp compatibility checks.
  • Monitor contract popularity and adoption by tracking holder counts over time for market analysis and investment research.
  • Analyze contract deployment history including creation timestamps and block numbers for audit trails and verification purposes.

Example

Query

Get ERC-20 Token Contract Details

query GetTokenContract($address: String!) {
contract(address: $address) {
address
name
symbol
decimals
isERC20
isERC721
isERC1155
assetType
holders
createdAt
createdBlock
}
}

Variables

{
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
}

Response

{
"data": {
"contract": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"isERC20": true,
"isERC721": false,
"isERC1155": false,
"assetType": "ERC20",
"holders": 9172146,
"createdAt": "2017-11-28T00:41:21Z",
"createdBlock": 4634748
}
}
}

Implementation Notes

note
  • For ERC-20 tokens, the decimals field indicates how to display token amounts (e.g., USDT uses 6 decimals).
  • The assetType field provides a quick reference to the type category of the contract (e.g., HYBRID for multi-standard contracts and UNKNOWN for contracts without verifiable standard compliance).
  • The isERC20, isERC721, and isERC1155 boolean fields indicate which token standards the contract implements.
  • Contracts may implement multiple standards simultaneously (e.g., a contract could be both ERC-721 and ERC-1155 compliant).
  • The holders field represents the total count of unique addresses holding tokens from this contract, useful for gauging contract adoption.
  • Use the tokens field (available on the Contract object) to fetch paginated lists of individual tokens managed by the contract, particularly useful for NFT collections.