Skip to content

Attribution.toDataSuffix

Converts an Attribution.Attribution to a data suffix that can be appended to transaction calldata.

Imports

Named
import { Attribution } from 'ox/erc8021'

Examples

Schema 0 (Canonical Registry)

import { Attribution } from 'ox/erc8021'
 
const suffix = Attribution.toDataSuffix({
  codes: ['baseapp', 'morpho']
})
'0x626173656170702c6d6f7270686f0e0080218021802180218021802180218021'

Schema 1 (Custom Registry)

import { Attribution } from 'ox/erc8021'
 
const suffix = Attribution.toDataSuffix({
  codes: ['baseapp'],
  codeRegistryAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
})

Definition

function toDataSuffix(
  attribution: Attribution.Attribution,
): Hex.Hex

Source: src/erc8021/Attribution.ts

Parameters

attribution

The attribution to convert.

attribution.codeRegistryAddress

  • Type: abitype_Address

Address of the custom code registry contract.

attribution.codes

  • Type: readonly string[]

Attribution codes identifying entities involved in the transaction.

attribution.id

  • Type: 1
  • Optional

Schema identifier (1 for custom registry).

Return Type

The data suffix as a Hex.Hex value.

Hex.Hex