Skip to main content

Module tempo

Module tempo 

Source
Expand description

Tempo precompile and contract initialization for Foundry.

This module provides the core initialization logic for Tempo-specific precompiles, fee tokens (PathUSD, AlphaUSD, BetaUSD, ThetaUSD), and standard contracts.

It includes the shared genesis initialization function used by both anvil and forge.

Re-exportsΒ§

use alloy_primitives::Address; πŸ”’
use alloy_primitives::Bytes; πŸ”’
use alloy_primitives::U256; πŸ”’
use revm::state::Bytecode; πŸ”’
use tempo_contracts::ARACHNID_CREATE2_FACTORY_ADDRESS; πŸ”’
use tempo_contracts::CREATEX_ADDRESS; πŸ”’
use tempo_contracts::CreateX; πŸ”’
use tempo_contracts::MULTICALL3_ADDRESS; πŸ”’
use tempo_contracts::Multicall3; πŸ”’
use tempo_contracts::PERMIT2_ADDRESS; πŸ”’
use tempo_contracts::Permit2; πŸ”’
use tempo_contracts::SAFE_DEPLOYER_ADDRESS; πŸ”’
use tempo_contracts::SafeDeployer; πŸ”’
use tempo_contracts::contracts::ARACHNID_CREATE2_FACTORY_BYTECODE; πŸ”’
use tempo_contracts::precompiles::VALIDATOR_CONFIG_ADDRESS; πŸ”’
use tempo_hardfork::TempoHardfork; πŸ”’
use tempo_precompiles::error::TempoPrecompileError; πŸ”’
use tempo_precompiles::storage::PrecompileStorageProvider; πŸ”’
use tempo_precompiles::storage::StorageCtx; πŸ”’
use tempo_precompiles::tip20::ITIP20; πŸ”’
use tempo_precompiles::tip20::TIP20Token; πŸ”’
use tempo_precompiles::tip20_factory::TIP20Factory; πŸ”’
use tempo_precompiles::validator_config; πŸ”’
use crate::constants::SYSTEM_PRECOMPILE_STUB; πŸ”’

ModulesΒ§

IAccountKeychain
Account Keychain interface for managing authorized keys
IAddressRegistry
TIP-1022 virtual address registry interface.
IFeeManager
FeeManager interface for managing gas fee collection and distribution.
IReceivePolicyGuard
Module containing a contract’s types and functions.
ISignatureVerifier
Module containing a contract’s types and functions.
IStablecoinDEX
StablecoinDEX interface for managing orderbook based trading of stablecoins.
ITIP20ChannelReserve
TIP-20 channel reserve ABI.
ITIP403Registry
Module containing a contract’s types and functions.

StructsΒ§

AddressRegistry
SignatureVerifier
StablecoinDEX
TIP20ChannelReserve
TipFeeManager

ConstantsΒ§

ACCOUNT_KEYCHAIN_ADDRESS
ADDRESS_REGISTRY_ADDRESS
ALPHA_USD_ADDRESS
Reserved Tempo TIP20 fee-token addresses created during Foundry genesis.
BETA_USD_ADDRESS
IMPLICIT_APPROVAL_LIST
TIP-1035 Implicit Approval List.
PATH_USD_ADDRESS
Protocol pathUSD token address.
RECEIVE_POLICY_GUARD_ADDRESS
SIGNATURE_VERIFIER_ADDRESS
STABLECOIN_DEX_ADDRESS
TEMPO_PRECOMPILE_ADDRESSES
All well-known Tempo precompile addresses.
TEMPO_TIP20_TOKENS
All well-known TIP20 fee token addresses on Tempo networks.
THETA_USD_ADDRESS
TIP20_CHANNEL_RESERVE_ADDRESS
Native TIP-1034 channel reserve precompile address.
TIP20_FACTORY_ADDRESS
TIP403_REGISTRY_ADDRESS
TIP_FEE_MANAGER_ADDRESS

FunctionsΒ§

active_tempo_precompile_addresses
Returns the well-known Tempo precompile addresses active at hardfork.
create_and_mint_token πŸ”’
Helper function to create and mint a TIP20 token.
initialize_tempo_genesis_at_hardfork
Initialize Tempo precompiles and contracts for a specific active hardfork.
initialize_tempo_genesis_inner
Inner genesis initialization logic. Must be called within a [StorageCtx] scope (either via [StorageCtx::enter] or [StorageCtx::enter_evm]).
initialize_tempo_genesis_inner_with_precompiles πŸ”’
initialize_tempo_test_genesis_inner
Inner genesis initialization for Forge’s local test EVM.
is_implicitly_approved
Returns true iff addr is on the IMPLICIT_APPROVAL_LIST for the given hardfork.
is_tempo_precompile_active_at
Returns whether a well-known Tempo precompile address is active at hardfork.
is_tip20_prefix
Returns true if addr has the TIP-20 token prefix.