Skip to content

TokenId.compute

Computes a deterministic TIP-20 token address from a sender address and salt.

The address is computed as: TIP20_PREFIX (12 bytes) || keccak256(abi.encode(sender, salt))[:8]

TIP-20 Token Standard

Imports

Named
import { TokenId } from 'ox/tempo'

Examples

import { TokenId } from 'ox/tempo'
 
const id = TokenId.compute({
  sender: '0x1234567890123456789012345678901234567890',
  salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
})

Definition

function compute(
  value: compute.Value,
): bigint

Source: src/tempo/TokenId.ts

Parameters

value

  • Type: compute.Value

The sender address and salt.

value.salt

  • Type: 0x${string}

The salt (32 bytes).

value.sender

  • Type: abitype_Address

The sender address.

Return Type

The computed TIP-20 token id.

bigint