Module runtime
Expand description
Math-runtime deployment + local address cache.
The math runtime classes (one per market family) are declared on
mainnet by the upstream contract deployer but no instances exist —
consumers like the cpi-arb bot need a runtime instance to perform
chain-faithful preflight via compute_hints_view / quote_*.
This module provides:
Family— the four supported families and their canonical mainnet class hashes.runtime_class_hash— class-hash lookup keyed by(chain, family), with mainnet hashes embedded as compile-time constants and sepolia hashes pulled from the bundled manifest.projected_deploy_address— pure address derivation via theget_udc_deployed_addresshelper. Used for dry-runs and idempotency checks.RuntimeCache/RuntimeEntry— TOML-on-disk cache of previously-deployed runtime instances, keyed by chain key + family.
Actual on-chain deploy submission lives in the CLI (it needs an
OwnedAccount) — this crate stays
provider/account-free so it can be embedded in lighter consumers.
Modules§
- mainnet_
class_ hashes - Mainnet math-runtime class hashes (from
the-situationdeployment-mainnet-01.json).
Structs§
- Runtime
Cache - In-memory mirror of
~/.config/deadeye/runtimes.toml. - Runtime
Entry - A cached, previously-deployed math-runtime instance.
Enums§
- Chain
Key - A short, opinionated chain identifier used as the top-level key in
RuntimeCache. We deliberately collapse the full hex felt to a human-readable slug so the cache stays grep-friendly. - Family
- The four market-runtime families supported by the Deadeye contract suite.
Constants§
- LEGACY_
UDC_ ADDRESS_ HEX - Legacy UDC contract address (Cairo 0). This is the only deployer that is predeployed on starknet-devnet-rs and the historical mainnet UDC — every Deadeye contract deployed to date used this UDC.
Functions§
- legacy_
udc_ address - Legacy UDC contract address as a
Felt. - projected_
deploy_ address - Compute the address a math-runtime instance will land at when
deployed via the legacy UDC with
unique = 0(deterministic by salt). - projected_
deploy_ address_ unique - Same as
projected_deploy_addressbut withunique = true(the UDC mixes the deployer address into the salt). Exposed for symmetry; the CLI defaults tounique = falsefor true idempotency. - runtime_
class_ hash - Return the canonical math-runtime class hash for the given
(chain, family). For sepolia, falls back to the bundled deployment manifest; for mainnet, returns the pinned constant.