Skip to main content

Module tip20

Module tip20 

Source
Expand description

TIP-20 token standard — Tempo’s native fungible token implementation.

Provides ERC-20-like balances, allowances, and transfers with Tempo extensions: role-based access control, pausability, supply caps, transfer policies (TIP-403), opt-in staking rewards, EIP-2612 permits (T2+), quote-token graphs, and virtual addresses (TIP-1022).

Re-exports§

pub use slots as tip20_slots;

Modules§

IRolesAuth
Module containing a contract’s types and functions.
ITIP20
TIP20 token interface providing standard ERC20 functionality with Tempo-specific extensions.
dispatch
ABI dispatch for the TIP20Token precompile.
rewards
Opt-in staking [rewards system] for TIP-20 tokens.
roles
Role-based access control for TIP-20 tokens.
slots

Structs§

Recipient 🔒
Resolved transfer recipient for TIP-1022 virtual address support.
TIP20Token

Enums§

RolesAuthError
Container for all the IRolesAuth custom errors.
RolesAuthEvent
Container for all the IRolesAuth events.
TIP20Error
Container for all the ITIP20 custom errors.
TIP20Event
Container for all the ITIP20 events.

Constants§

U128_MAX
u128::MAX as U256
USD_CURRENCY
USD currency string constant.

Statics§

BURN_BLOCKED_ROLE
Role hash that authorizes burning tokens from blocked accounts.
EIP712_DOMAIN_TYPEHASH
EIP-712 domain separator typehash
ISSUER_ROLE
Role hash for minting new tokens.
PAUSE_ROLE
Role hash for pausing token transfers.
PERMIT_TYPEHASH
EIP-712 Permit typehash: keccak256(“Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)”)
UNPAUSE_ROLE
Role hash for unpausing token transfers.
VERSION_HASH
EIP-712 version hash: keccak256(“1”)

Functions§

is_tip20_prefix
Returns true if addr has the TIP-20 token prefix.
validate_usd_currency
Validates that the given token’s currency is "USD".