> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> Index ink! WASM smart contracts on Substrate — typegen, contract event decoding, and storage state queries for ink-based dApps.

# ink! contracts support

This section describes additional options available for indexing [ink!-based WASM contracts](https://use.ink), supported by chains with a `Contracts` pallet. At the moment of writing, AlephZero, Shibuya (Astar testnet), Shiden (Kusama parachain) and Astar (Polkadot parachain) are the most popular chains for deploying ink! contracts.

[Generate an ink! indexing squid automatically](/en/sdk/squid-sdk/resources/tools/squid-gen), follow the [WASM squid tutorial](/en/sdk/squid-sdk/tutorials/ink) for a step-by-step instruction or check out the [squid-wasm-template](https://github.com/subsquid-labs/squid-wasm-template) reference project.

## Processor configuration

Request events by the contract address as described on the [`SubstrateBatchProcessor` reference page](/en/sdk/squid-sdk/reference/processors/substrate-batch/data-requests#addcontractscontractemitted), e.g.

```ts theme={"system"}
import * as ss58 from '@subsquid/ss58'
import {toHex} from '@subsquid/util-internal-hex'

const ADDRESS = toHex(ss58.decode('XnrLUQucQvzp5kaaWLG9Q3LbZw5DPwpGn69B5YcywSWVr5w').bytes)

const processor = new SubstrateBatchProcessor()
  .setGateway('https://v2.archive.subsquid.io/network/shibuya-substrate')
  .setRpcEndpoint('https://shibuya.public.blastapi.io')
  .addContractsContractEmitted({
    contractAddress: [ADDRESS],
    extrinsic: true
  })
  .setFields({
    event: {
      phase: true
    }
  })
```

Generate and use the facade classes for decoding ink! smart contract data as described in the [typegens reference](/en/sdk/squid-sdk/resources/tools/typegen). You can also make [direct contract state queries](/en/sdk/squid-sdk/resources/tools/typegen/state-queries) using the `Contract` class generated by `squid-ink-typegen`.
