Attribution.fromData
Extracts an Attribution.Attribution from transaction calldata.
Imports
Named
import { Attribution } from 'ox/erc8021'Examples
Schema 0 (Canonical Registry)
import { Attribution } from 'ox/erc8021'
const attribution = Attribution.fromData(
'0xdddddddd62617365617070070080218021802180218021802180218021'
)
{ codes: ['baseapp'], id: 0 }Schema 1 (Custom Registry)
import { Attribution } from 'ox/erc8021'
const attribution = Attribution.fromData(
'0xddddddddcccccccccccccccccccccccccccccccccccccccc210502626173656170702C6D6F7270686F0E0180218021802180218021802180218021'
)
{ codes: ['baseapp', 'morpho'], codeRegistry: { address: '0xcccccccccccccccccccccccccccccccccccccccc', chainId: 8453, }, id: 1 }Schema 2 (CBOR-Encoded)
import { Attribution } from 'ox/erc8021'
const attribution = Attribution.fromData(
'0xdddddddda161616762617365617070000b0280218021802180218021802180218021'
)
{ appCode: 'baseapp', id: 2 }Definition
function fromData(
data: Hex.Hex,
): Attribution | undefinedSource: src/erc8021/Attribution.ts
Parameters
data
- Type:
Hex.Hex
The transaction calldata containing the attribution suffix.
Return Type
The extracted attribution, or undefined if no valid attribution is found.

