Skip to main content

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:
  1. Extract Selector: The first 4 bytes of the calldata are extracted as the function selector
  2. Lookup Signature: The selector is looked up in the 4bytes.directory API
  3. Decode Parameters: Using the signature, the remaining calldata is decoded into typed parameters
  4. 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

FieldTypeDescription
indexIntOrder of action in proposal (0-indexed)
targetStringTarget contract address
valueStringETH value in wei
calldataStringOriginal raw calldata (hex)
decodedObjectDecoded data or error info

Decoded (Success)

FieldTypeDescription
statusStringAlways "success"
functionNameStringFunction name (e.g., "setFee")
signatureStringFull signature (e.g., "setFee(uint256)")
argsArrayDecoded arguments
summaryStringHuman-readable one-liner

Decoded (Error)

FieldTypeDescription
statusStringAlways "error"
errorStringError message
selectorStringThe 4-byte function selector
hintStringHow to fix the issue

DecodedArg

FieldTypeDescription
nameStringGeneric name (arg0, arg1, etc.)
typeStringSolidity type (uint256, address, etc.)
valueStringStringified 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: