Space and Time

Index Smart Contracts Onchain

Create queryable SXT tables from smart contract events.

Smart contract indexing turns emitted EVM events into SXT Chain tables. Once the tables are created and funded, indexers populate them from live contract activity so you can run SQL over wallet, protocol, and transaction events without operating your own indexing service.

Start with the live indexing flow

The app now has a dedicated contract indexer. It handles ABI discovery, proxy ABI overrides, event-table generation, namespace creation, and funding handoff.

Index a Contract
Step 1

Choose a verified contract

Paste an Ethereum or Base contract address, or paste the block explorer URL. The app fetches the verified ABI and extracts indexable events.

Step 2

Select event tables

Review each event, rename generated tables and columns if needed, and keep useful metadata columns such as block number and transaction hash.

Step 3

Create and fund

Create the namespace and indexed smart contract tables with SXT Chain credits, then fund each derived table account so indexers can process the live event stream.

Step 4

Review and query

Use My Indexed Contracts to inspect schemas, top up table funding, open the source contract on its explorer, and build SQL queries.

What you need

  • A connected wallet.
  • SXT Chain credits for namespace and table creation.
  • SXT tokens for table-account funding.
  • A verified contract ABI on a supported explorer.

Current indexing mode

Live indexing starts from the current block when the indexed smart contract tables are created. Historical backfill is still separate from this tutorial.

Creation and funding

Creating indexed tables uses SXT Chain credits. The app shows the namespace and table creation estimate before you sign.

Each generated table also has a deterministic funding account. Send at least 100 SXT per table so indexers can pick it up.

Query indexed events

After rows arrive, use the generated namespace and table names in SQL. My Indexed Contracts provides one-click query links for each table.

sql
SELECT
BLOCK_NUMBER,
TRANSACTION_HASH,
FROM_ADDRESS,
TO_ADDRESS,
VALUE
FROM YOUR_NAMESPACE.TRANSFER
ORDER BY BLOCK_NUMBER DESC
LIMIT 25;

What to do after indexing

Open My Indexed Contracts to monitor generated tables, continue indexing more events into the same namespace, top up table funds, and launch queries in the workbench or Space and Time Studio.