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 (post-T2) and quote-token graphs.

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§

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§

TIP20_DECIMALS 🔒
Decimal precision for TIP-20 tokens
TIP20_TOKEN_PREFIX 🔒
TIP20 token address prefix (12 bytes) The full address is: TIP20_TOKEN_PREFIX (12 bytes) || derived_bytes (8 bytes)
U128_MAX
u128::MAX as U256
USD_CURRENCY
USD currency string constant.

Statics§

BURN_BLOCKED_ROLE
Role hash that prevents an account from burning tokens.
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 the address has the TIP20 prefix.
validate_usd_currency
Validates that the given token’s currency is "USD".