Skip to main contentModule keychain
Source use crate::cmd::auth::confirm_and_build; ๐ use crate::cmd::print_json_or; ๐ use crate::cmd::send::SendOptions; ๐ use crate::cmd::send::cast_send; ๐ use crate::cmd::tempo_policy_args::parse_period; ๐ use crate::cmd::tempo_policy_args::parse_scope; ๐ use crate::cmd::tempo_policy_args::parse_selector_bytes; ๐ use crate::tempo::apply_fee_payment; ๐ use crate::tempo::print_expires; ๐ use crate::tempo::require_hardfork; ๐ use crate::tempo::tempo_provider; ๐ use crate::tx::CastTxBuilder; ๐ use crate::tx::SendTxOpts; ๐ use crate::tx::SenderKind; ๐ use crate::tx::apply_poll_interval; ๐ use alloy_ens::NameOrAddress; ๐ use alloy_network::EthereumWallet; ๐ use alloy_network::NetworkTransactionBuilder; ๐ use alloy_primitives::Address; ๐ use alloy_primitives::B256; ๐ use alloy_primitives::Bytes; ๐ use alloy_primitives::U256; ๐ use alloy_primitives::hex; ๐ use alloy_primitives::hex; ๐ use alloy_provider::Provider; ๐ use alloy_provider::ProviderBuilder as AlloyProviderBuilder; ๐ use alloy_rpc_types::BlockId; ๐ use alloy_signer::Signer; ๐ use alloy_sol_types::SolCall; ๐ use chrono::DateTime; ๐ use clap::Parser; ๐ use eyre::Result; ๐ use foundry_cli::json::print_json_object; ๐ use foundry_cli::json::print_json_success; ๐ use foundry_cli::opts::RpcOpts; ๐ use foundry_cli::opts::TempoOpts; ๐ use foundry_cli::opts::TransactionOpts; ๐ use foundry_cli::utils::LoadConfig; ๐ use foundry_cli::utils::now; ๐ use foundry_cli::utils::parse_fee_token_address; ๐ use foundry_cli::utils::parse_json; ๐ use foundry_cli::utils::resolve_lane; ๐ use foundry_common::provider::ProviderBuilder; ๐ use foundry_common::sh_warn; ๐ use foundry_common::shell; ๐ use foundry_common::tempo; ๐ use foundry_common::tempo::AccountsStoreView; ๐ use foundry_common::tempo::KeyType; ๐ use foundry_common::tempo::active_tempo_hardfork; ๐ use foundry_common::tempo::is_tempo_hardfork_active; ๐ use foundry_common::tempo::read_tempo_accounts_store; ๐ use foundry_common::tempo::tempo_accounts_store_path; ๐ use foundry_evm::hardfork::TempoHardfork; ๐ use foundry_wallets::BrowserWalletOpts; ๐ use foundry_wallets::WalletOpts; ๐ use foundry_wallets::WalletSigner; ๐ use foundry_wallets::wallet_browser::signer::BrowserSigner; ๐ use serde::Deserialize; ๐ use serde::Deserialize; ๐ use serde_json::Value; ๐ use serde_json::json; ๐ use std::fmt::Display; ๐ use tempo_alloy::TempoNetwork; ๐ use tempo_alloy::provider::TempoProviderExt; ๐ use tempo_contracts::precompiles::ACCOUNT_KEYCHAIN_ADDRESS; ๐ use tempo_contracts::precompiles::DEFAULT_FEE_TOKEN; ๐ use tempo_contracts::precompiles::IAccountKeychain; ๐ use tempo_contracts::precompiles::IAccountKeychain::CallScope; ๐ use tempo_contracts::precompiles::IAccountKeychain::KeyInfo; ๐ use tempo_contracts::precompiles::IAccountKeychain::KeyRestrictions; ๐ use tempo_contracts::precompiles::IAccountKeychain::LegacyTokenLimit; ๐ use tempo_contracts::precompiles::IAccountKeychain::SelectorRule; ๐ use tempo_contracts::precompiles::IAccountKeychain::SignatureType; ๐ use tempo_contracts::precompiles::IAccountKeychain::TokenLimit; ๐ use tempo_contracts::precompiles::ISignatureVerifier; ๐ use tempo_contracts::precompiles::ITIP20; ๐ use tempo_contracts::precompiles::PATH_USD_ADDRESS; ๐ use tempo_contracts::precompiles::SIGNATURE_VERIFIER_ADDRESS; ๐ use tempo_contracts::precompiles::account_keychain::authorizeAdminKeyCall; ๐ use tempo_contracts::precompiles::account_keychain::authorizeKeyCall; ๐ use tempo_contracts::precompiles::account_keychain::authorizeKeyWithWitnessCall; ๐ use tempo_contracts::precompiles::account_keychain::legacyAuthorizeKeyCall; ๐ use tempo_primitives::transaction::CallScope as AuthCallScope; ๐ use tempo_primitives::transaction::KeyAuthorization; ๐ use tempo_primitives::transaction::PrimitiveSignature; ๐ use tempo_primitives::transaction::SignatureType as AuthSignatureType; ๐ use tempo_primitives::transaction::SignedKeyAuthorization; ๐ use tempo_primitives::transaction::TokenLimit as AuthTokenLimit; ๐ use yansi::Paint; ๐
- AuthScopesJson
- Newtype wrapper for parsed key-authorization
--scopes JSON. - Doctor ๐
- Accumulated
cast keychain doctor report. - DoctorCandidate ๐
- Candidate subject collected before the RPC chain is known.
- DoctorContext ๐
- DoctorStep ๐
- DoctorSubject ๐
- Result of resolving a Tempo Accounts store entry for the doctor.
- InspectedLimit ๐
- JsonCallScope ๐
- Represents a single scope entry in JSON format for
--scopes. - JsonSelectorWithRecipients ๐
- KeyAuthorizationArgs
- Common fields for
cast key-authorization encode and cast key-authorization sign. - ScopesJson
- Newtype wrapper for parsed
--scopes JSON so clap can treat it as a single value.
- AllowedCallMatch ๐
- Outcome of TIP-1011 allowed-call matching.
- AllowedCallsView ๐
- ChainTimestamp ๐
- DoctorStatus ๐
- JsonSelectorEntry ๐
- A selector entry can be either a plain string or an object with recipients.
- KeyAuthorizationSubcommand
- Tempo key-authorization artifact helpers.
- KeyRegistration ๐
- KeychainPolicySubcommand
- Higher-level access-key policy editing commands.
- KeychainRootSigner ๐
- KeychainSubcommand
- Tempo keychain management commands.
- KeychainTxOutcome ๐
- ACCOUNTS_STORE ๐
- ALLOWED_CALLS ๐
- CHAIN_ID ๐
- EXPIRING_NONCE ๐
- EXPIRY ๐
- FEE_TOKEN_BALANCE ๐
- HARDFORK ๐
- HARDFORK_UNKNOWN_HINT ๐
- KEY_REGISTRATION ๐
- LOCAL_SIGNING ๐
- REVOCATION ๐
- RPC ๐
- SPENDING_LIMITS ๐
- SPONSORSHIP ๐
- WIDEN_POLICY_HINT ๐
- abi_key_type ๐
- The key type of an ABI signature type;
None for values outside the known variants. - add_selector_rule_to_scope ๐
- Merges
rule into scope; returns whether the scope changed. - address_label ๐
- address_label_with_address ๐
- allowed_calls_to_json ๐
- check_allowed_calls ๐
- Step 10 helper: allowed calls (TIP-1011) of the on-chain key, or of
pending when the key is
not registered yet. - check_authorization_spending_limits ๐
- Step 9 helper: spending limits of a pending
key_authorization. - check_expiring_nonce ๐
- Validate TIP-1009 expiring-nonce options, if supplied.
- check_expiring_nonce_window ๐
- Checks the validity window against the chain timestamp. The upper bound depends on the active
hardfork and is skipped when it is unknown.
- check_expiry ๐
- Expiry check shared by on-chain keys (
prefix empty) and pending authorizations
(prefix = "key_authorization "). None means the key never expires. - check_fee_token_balance ๐
- Fee-token balance of the account paying for the transaction.
- check_hardfork ๐
- check_local_signing_readiness ๐
- Step 4 helper: verify whether the local side can actually sign as the key.
- check_spending_limits ๐
- Step 9 helper: spending limits of an on-chain key.
- check_sponsorship ๐
- Validate sponsorship configuration, if supplied; returns the step and the fee payer.
- collect_local_candidates ๐
- Step 1 helper: collect Tempo Accounts store candidates.
- decode_and_validate_key_authorization ๐
- Decode a hex RLP key authorization (signed or unsigned) and validate its account binding.
- diagnose_allowed_scopes ๐
- ensure_root_sender ๐
- Ensures
what is signed by the expected root account when one is known. - fetch_chain_timestamp ๐
- format_duration_words ๐
- format_expiry ๐
- format_expiry_for_inspect ๐
- format_period_end ๐
- format_period_suffix ๐
(period resets ...) for a non-zero period end, empty otherwise.- format_recipients ๐
- format_relative_timestamp ๐
- format_relative_timestamp_from ๐
- format_selector ๐
- format_timestamp_iso ๐
- format_utc ๐
- inspected_limit_to_json ๐
- key_entry_to_json ๐
- key_role ๐
root when the key is the account EOA itself, admin when it is a T6 admin key, otherwise
limited.- key_type_label ๐
- key_type_name ๐
- list_keys ๐
cast keychain list / cast keychain show <wallet_address> โ display Tempo Accounts store
entries, optionally filtered to one wallet.- load_accounts_store ๐
- match_allowed_call ๐
- Pure TIP-1011 matching logic.
- parse_auth_limit ๐
- Parse a
--limit TOKEN:AMOUNT[:PERIOD] flag value. - parse_auth_scope ๐
- parse_auth_scopes_json_wrapped ๐
- parse_auth_signature_type ๐
- parse_limit ๐
- parse_scopes_json ๐
- Parse
--scopes JSON flag value. - parse_scopes_json_wrapped ๐
- parse_signature_type ๐
- print_allowed_calls ๐
- print_inspected_limits ๐
- print_key_entry ๐
- print_signed_key_authorization ๐
- redact_private_key_uri_tokens ๐
- remaining_limit ๐
- Remaining spending limit for
token and, on T3+, the current period end. - resolve_key_metadata ๐
- Resolves the root account of
key_address and its local Accounts store entry, if any. - resolve_keychain_root_signer ๐
- Resolve the root-authorized signer used for AccountKeychain policy changes.
- run_authorize ๐
cast keychain authorize / cast keychain auth โ authorize a key on-chain.- run_check ๐
cast keychain check / cast keychain info โ query on-chain key status.- run_inspect ๐
cast keychain inspect <key_address> โ inspect on-chain key policy.- run_key_auth_inspect ๐
cast key-authorization inspect โ decode a signed or unsigned key authorization and print its
fields, including the T6 is_admin / account fields.- run_key_auth_sign ๐
- run_policy_add_call ๐
cast keychain policy add-call โ merge a selector rule into a target scope.- run_verify_keychain ๐
cast keychain verify / verify-admin โ verify a Tempo keychain signature (T6).- sanitize_sponsor_config_error ๐
- select_subject_for_chain ๐
- Step 3 helper: filter candidates to the RPC chain id and pick a single entry.
- selector_signature ๐
- send_keychain_call ๐
- Send an AccountKeychain precompile call as a root-authorized transaction.
- send_keychain_tx ๐
- Send calldata to the Tempo AccountKeychain precompile as a root-authorized transaction.
- send_keychain_tx_with_root_signer ๐
- Send AccountKeychain calldata with an already-resolved root signer.
- tempo_accounts_store_path_display ๐
- validate_pending_key_authorization ๐
- Validates the local pending
key_authorization, returning it with its pass detail.
- Check ๐
- A doctor check as
(name, label).