Skip to content

AttestedSigner.getPolicyId

Computes the ID of the policy that creator creates with salt: keccak256(abi.encode(creator, salt)).

Only creator can create a given ID, so it can create the same policy on every chain.

TIP-1161

Imports

Named
import { AttestedSigner } from 'ox/tempo'

Examples

import { AttestedSigner } from 'ox/tempo'
 
const policyId = AttestedSigner.getPolicyId({
  creator: '0x0101010101010101010101010101010101010101',
  salt: `0x${'55'.repeat(32)}`
})

Definition

function getPolicyId(
  options: getPolicyId.Options,
): Hex.Hex

Source: src/tempo/AttestedSigner.ts

Parameters

options

  • Type: getPolicyId.Options

The creator and salt.

options.creator

  • Type: abitype_Address

Caller of createPolicy.

options.salt

  • Type: 0x${string}

32-byte salt the creator chooses.

Return Type

The policy ID.

Hex.Hex