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

# Thirdweb Engine: Read Contract

Read data from a smart contract via your Thirdweb Engine instance. Calls a read-only function and returns the result. Ideal for: checking balances, reading state, fetching on-chain data for workflow conditions.

![Thirdweb Engine: Read Contract logo](https://ai-icon.b3.fun/logo/thirdweb-engine)
Catalog action Integrations thirdweb-engine

Read data from a smart contract via your Thirdweb Engine instance. Calls a read-only function and returns the result. Ideal for: checking balances, reading state, fetching on-chain data for workflow conditions.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `thirdweb-engine-read-contract` |
| Category | Integrations |
| Connector | `thirdweb-engine` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `smart-contract`, `integration`, `contract`, `read`, `onchain` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `chain` | `string` | Yes | Chain ID \(e.g. '8453' for Base, '1' for Ethereum\) |
| `contractAddress` | `string` | Yes | Contract address to read from |
| `functionName` | `string` | Yes | Solidity function name or full signature \(e.g. "balanceOf" or "function balanceOf\(address\) returns \(uint256\)"\) |
| `args` | `array` | No | Function arguments as strings |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `result` | `string \| number \| boolean \| object \| array \| null` | Yes | Return value from the contract read call |

## Examples

**Workflow node**

```json
{
  "type": "thirdweb-engine-read-contract",
  "payload": {
    "chain": "8453",
    "contractAddress": "0x0000000000000000000000000000000000000000",
    "functionName": "example-functionName"
  },
  "children": [],
  "connector": {
    "type": "thirdweb-engine",
    "id": "conn_thirdweb_engine"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/thirdweb-engine-read-contract/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "chain": "8453",
    "contractAddress": "0x0000000000000000000000000000000000000000",
    "functionName": "example-functionName"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.