Decoded Actions
The DAO Café indexer automatically decodes proposal calldata into human-readable format. This feature uses the 4bytes.directory API to look up function signatures and decode the parameters.
Endpoint: https://dao.cafe/graphql
How It Works
When a proposal is created on-chain, the calldata (raw encoded function calls) is decoded into a structured format:
- Extract Selector: The first 4 bytes of the calldata are extracted as the function selector
- Lookup Signature: The selector is looked up in the 4bytes.directory API
- Decode Parameters: Using the signature, the remaining calldata is decoded into typed parameters
- Store Result: The decoded actions are stored alongside the raw calldata
Query Decoded Actions
Fetch a proposal with its decoded actions:
Response Structure
The decodedActions field returns an array of decoded actions, one for each target/calldata pair in the proposal:
Successful Decoding
Failed Decoding
When the function selector is not found in 4bytes.directory:
ETH Transfer (Empty Calldata)
When a proposal action is a pure ETH transfer:
Multi-Action Proposals
Proposals can have multiple actions. Each action is decoded independently:
Example response with 3 actions:
DecodedAction Type Reference
DecodedAction
| Field | Type | Description |
|---|
index | Int | Order of action in proposal (0-indexed) |
target | String | Target contract address |
value | String | ETH value in wei |
calldata | String | Original raw calldata (hex) |
decoded | Object | Decoded data or error info |
Decoded (Success)
| Field | Type | Description |
|---|
status | String | Always "success" |
functionName | String | Function name (e.g., "setFee") |
signature | String | Full signature (e.g., "setFee(uint256)") |
args | Array | Decoded arguments |
summary | String | Human-readable one-liner |
Decoded (Error)
| Field | Type | Description |
|---|
status | String | Always "error" |
error | String | Error message |
selector | String | The 4-byte function selector |
hint | String | How to fix the issue |
DecodedArg
| Field | Type | Description |
|---|
name | String | Generic name (arg0, arg1, etc.) |
type | String | Solidity type (uint256, address, etc.) |
value | String | Stringified value |
Adding Missing Signatures
If a function selector is not found in 4bytes.directory, you can submit it:
Via API
Via Contract ABI
Via Solidity File
After submitting your signature, future proposals using that function will be decoded automatically.
UI Display Example
Here’s how you might display decoded actions in your frontend:
SDK Support
The decodedActions field is available through the daocafe-sdk: