Skip to main content

Crate tempo_precompiles

Crate tempo_precompiles 

Source
Expand description

Tempo precompile implementations.

Re-exportsΒ§

pub use error::IntoPrecompileResult;
pub use error::Result;
pub use account_keychain::AuthorizedKey;

ModulesΒ§

account_keychain
Account keychain precompile for managing session keys and spending limits.
error
Unified error handling for Tempo precompiles.
ip_validation πŸ”’
IP address validation utilities for validator configuration.
nonce
2D nonce management precompile and expiring nonce replay protection, enabling concurrent transaction execution as part of Tempo Transactions.
stablecoin_dex
On-chain CLOB (Central Limit Order Book) for stablecoin trading.
storage
EVM storage abstraction layer for Tempo precompile contracts.
test_utiltest-utils
Test utilities for precompile dispatch testing
tip20
TIP-20 token standard β€” Tempo’s native fungible token implementation.
tip20_factory
TIP-20 token factory precompile β€” deploys new TIP-20 tokens at deterministic addresses.
tip403_registry
TIP-403 transfer policy registry precompile.
tip_fee_manager
Fee manager precompile for transaction fee collection, distribution, and token swaps.
validator_config
Validator Config (V1) precompile – manages the on-chain consensus validator set. Will be migrated to Validator Config V2 post T2 hardfork
validator_config_v2
Validator Config V2 precompile – index-canonical, on-chain, consensus validator registry with signature-gated operations, IP uniqueness enforcement, and migration support from V1.

MacrosΒ§

tempo_precompile πŸ”’

StructsΒ§

DelegateCallNotAllowed
Custom error with signature DelegateCallNotAllowed() and selector 0x0d89438e.
StaticCallNotAllowed
Custom error with signature StaticCallNotAllowed() and selector 0xbeaba5b7.

ConstantsΒ§

ACCOUNT_KEYCHAIN_ADDRESS
DEFAULT_FEE_TOKEN
ECRECOVER_GAS
Gas cost for ecrecover signature verification (used by KeyAuthorization and Permit).
INPUT_PER_WORD_COST
Input per word cost. It covers abi decoding and cloning of input into call data.
NONCE_PRECOMPILE_ADDRESS
PATH_USD_ADDRESS
STABLECOIN_DEX_ADDRESS
TIP20_FACTORY_ADDRESS
TIP403_REGISTRY_ADDRESS
TIP_FEE_MANAGER_ADDRESS
VALIDATOR_CONFIG_ADDRESS
VALIDATOR_CONFIG_V2_ADDRESS

TraitsΒ§

Precompile
Trait implemented by all Tempo precompile contract types.

FunctionsΒ§

dispatch_call πŸ”’
Decodes calldata via decode, then dispatches to f.
extend_tempo_precompiles
Registers Tempo-specific precompiles into an existing [PrecompilesMap] by installing a lookup function that matches addresses to their precompile: TIP-20 tokens (by prefix), TIP20Factory, TIP403Registry, TipFeeManager, StablecoinDEX, NonceManager, ValidatorConfig, AccountKeychain, and ValidatorConfigV2. Each precompile is wrapped via the tempo_precompile! macro which enforces direct-call-only (no delegatecall) and sets up the storage context.
fill_precompile_output πŸ”’
Fills gas accounting fields on a [PrecompileOutput] from the storage context.
input_cost
Returns the gas cost for decoding calldata of the given length, rounded up to word boundaries.
metadata πŸ”’
Dispatches a parameterless view call, encoding the return via T.
mutate πŸ”’
Dispatches a state-mutating call that returns ABI-encoded data.
mutate_void πŸ”’
Dispatches a state-mutating call that returns no data (e.g. approve, transfer).
tempo_precompiles
Returns the full Tempo precompiles for the given config.
unknown_selector
Returns an ABI-encoded UnknownFunctionSelector revert for the given 4-byte selector.
view πŸ”’
Dispatches a read-only call with decoded arguments, encoding the return via T.