Skip to main content

javm_cap/
abi.rs

1//! Well-known cnode slot indices the v3 chain ABI exposes at
2//! genesis. Shared between jar-kernel (which populates the slots at
3//! chain init) and consumers like the JAVM transpiler (which emit
4//! chain Images referencing them).
5
6use crate::SlotIdx;
7
8// ---- BareFrame slot indices (kernel-issued caps at chain init) ----
9
10/// Root `Cap::Instance[Gas{0}]` handle. The chain reads this slot
11/// to learn its active gas meter; it's also the entry in the
12/// chain Image's `gas_slots[0]`.
13pub const BARE_GAS_SLOT: SlotIdx = SlotIdx(7);
14
15/// Root `Cap::Instance[Quota{0}]` handle (symmetric to
16/// `BARE_GAS_SLOT`).
17pub const BARE_QUOTA_SLOT: SlotIdx = SlotIdx(8);
18
19/// Chain's `Cap::Instance[YieldCatcher]` (its own catcher; per-block
20/// reset). The chain Image's `yield_marker_slot` points here.
21pub const BARE_YIELD_CATCHER_SLOT: SlotIdx = SlotIdx(9);
22
23/// `Cap::Instance[SetGasMeter]` factory.
24pub const BARE_SET_GAS_METER_SLOT: SlotIdx = SlotIdx(10);
25
26/// `Cap::Instance[SetStorageQuota]` factory.
27pub const BARE_SET_STORAGE_QUOTA_SLOT: SlotIdx = SlotIdx(11);
28
29/// `Cap::Instance[MintGas]` factory.
30pub const BARE_MINT_GAS_SLOT: SlotIdx = SlotIdx(12);
31
32/// `Cap::Instance[MintQuota]` factory.
33pub const BARE_MINT_QUOTA_SLOT: SlotIdx = SlotIdx(13);
34
35/// `Cap::Instance[CreateYieldCatcher]` factory.
36pub const BARE_CREATE_YIELD_CATCHER_SLOT: SlotIdx = SlotIdx(14);
37
38/// `Cap::Instance[HostOpen]` — read-only entry handle for `host_open`.
39pub const BARE_HOST_OPEN_SLOT: SlotIdx = SlotIdx(15);
40
41/// `Cap::Instance[HostSave]` — entry handle for `host_save`.
42pub const BARE_HOST_SAVE_SLOT: SlotIdx = SlotIdx(16);