Decode return bytes
Use call_decode after a raw contract call or when return bytes are already stored. The ABI and function selection must be constant because they determine the SQL schema.
Pass exact selector-free return bytes. The current decoder does not reject a selector prefix or trailing bytes, and incorrectly framed data can decode to an unintended value.
- Use CROSS JOIN LATERAL when return bytes come from a table or CTE.
- Use the relation-input form when ABI/function columns are constant and the return-data column varies.
- Use read_contract when the RPC call and ABI decoding should happen in one helper.
Local SQL