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_
util test-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Β§
- Delegate
Call NotAllowed - Custom error with signature
DelegateCallNotAllowed()and selector0x0d89438e. - Static
Call NotAllowed - Custom error with signature
StaticCallNotAllowed()and selector0xbeaba5b7.
ConstantsΒ§
- ACCOUNT_
KEYCHAIN_ ADDRESS - DEFAULT_
FEE_ TOKEN - ECRECOVER_
GAS - Gas cost for
ecrecoversignature 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 tof. - 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 thetempo_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
UnknownFunctionSelectorrevert for the given 4-byte selector. - view π
- Dispatches a read-only call with decoded arguments, encoding the return via
T.