Skip to content

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'],
registry: {
address: '0xcccccccccccccccccccccccccccccccccccccccc`
chainId: 8453,
}
id: 1
}

Definition

function fromData(
  data: Hex.Hex,
): Attribution | undefined

Source: 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.

Attribution.Attribution