Read contract state (view/pure functions)
Query smart contract state by calling view or pure functions. This endpoint executes read-only operations that don't modify blockchain state and don't require gas fees.
Request Body
| Field | Type | Required | Description |
|---|
sender.vaultId | UUID | Yes | Vault identifier for the call |
chainId | number | Yes | Blockchain network ID |
contractAddress | string | Yes | Smart contract address (0x..., 42 chars) |
functionName | string | No | Function name (e.g., balanceOf, totalSupply) |
functionSignature | string | No | Full function signature (e.g., balanceOf(address)) |
parameters | array | No | Function parameters with type/value |
abi | array | No | Contract ABI for result decoding |
data | string | No | Pre-encoded function call data (alternative to functionSignature + parameters) |
Parameters Array
Each parameter object includes:
| Field | Type | Description |
|---|
type | string | Solidity type (e.g., address, uint256) |
value | string/number/boolean | Parameter value |
Key Differences from Contract Write
| Aspect | Contract Read | Contract Write |
|---|
| Gas Required | No (reads are free) | Yes |
| Transaction | No (uses eth_call) | Yes (on-chain) |
| Response | Instant (synchronous) | Async (confirmation) |
| State Changes | Cannot modify | Can modify |
| Approvals | Not required | May be required |
Read Call Workflow
- Validation — Validates contract address and function details
- Encoding — Encodes function call parameters
- Policy Check — Evaluates against policies (can block)
- Execution — Executes eth_call via RPC
- Decoding — Decodes and returns result
Response Fields
| Field | Type | Description |
|---|
success | boolean | Whether the contract read call succeeded |
contractAddress | string | Contract address that was queried |
functionName | string | Function that was called, if provided |
chainId | number | Chain ID where the call was executed |
result | object | Contract read call result (raw + decoded) |
result.data | string | Raw hex-encoded result from the contract call |
result.decoded | any | Decoded result if ABI was provided |
transactionId | UUID | Transaction ID for audit trail and tracking |
status | string | Final workflow status (e.g., COMPLETED) |
Use Cases
- Query token balances (balanceOf)
- Check total supply (totalSupply)
- Read contract state variables
- Verify allowances and approvals
- Query NFT ownership and metadata
- Check price feeds and oracles
Required Permission
contracts:read