Sigil documentation
ReferenceRust referencesigil-execution

sigil-execution · contract

Source declarations, signatures and documentation for contract.

Source: sigil/node/sigil-execution/src/contract.rs. SHA-256: 7defbad9f717653f76cc1a7f43191bbad41f07a9ff416cc10c35bf46c3fd562c.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

contract::ContractStatus

Lifecycle status of a deployed contract.

#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ContractStatus {
    /// Contract accepts calls.
    #[default]
    Active,
    /// Contract is suspended by governance/controller; calls reject.
    Suspended,
    /// Contract is being migrated as part of an upgrade — no calls.
    Migrating,
    /// Contract has been retired and is read-only.
    Archived,
}

Source line: 28.

contract::DEFAULT_ALLOWED_HOST_FUNCTIONS

Conservative default ANVIL host-function allowlist used when a contract is deployed without an explicit list.

pub const DEFAULT_ALLOWED_HOST_FUNCTIONS: &[&str];

Source line: 42.

contract::ContractRecord

Live, on-chain record of a deployed agent contract.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ContractRecord {
pub contract_did: String,
pub zone_id: String,
pub controller_did: String,
pub runtime: ContractRuntime,
pub code_hash: SigilHash,
pub state_root: SigilHash,
pub upgrade_policy: ControlPolicy,
pub call_policy: ControlPolicy,
pub revenue_account: Option<String>,
pub allowed_host_functions: Vec<String>,
pub kind: ContractKind,
pub status: ContractStatus,
/// Whether this contract opts in to autonomous Vigils callbacks.

#[serde(default)]
pub accepts_vigil_callbacks: bool,
pub created_height: u64,
pub updated_height: u64,
/// Optional model-commitment pointer (set by ModelManager-style

/// contracts that point at a verified compute artifact). Updated

/// only via `UpgradeContract { new_model_commitment, model_receipt_id }`.

#[serde(default, skip_serializing_if = "Option::is_none")]
pub model_commitment: Option<SigilHash>
}

Source line: 54.

contract::ContractRecord::is_callable

Returns true when the contract is currently callable.

pub fn is_callable(&self) -> bool;

Source line: 81.

contract::ContractRecord::is_upgradable

Returns true when the contract may be upgraded (active or migrating). Archived/suspended cannot be upgraded.

pub fn is_upgradable(&self) -> bool;

Source line: 87.

contract::ContractRecord::allows_host_fn

Returns true if the contract is permitted to invoke host_fn.

pub fn allows_host_fn(&self, host_fn: &str) -> bool;

Source line: 95.

contract::ContractEvent

A persisted contract event (emitted via the ANVIL emit_event host function or by the executor for lifecycle events).

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ContractEvent {
pub contract_did: String,
pub block_height: u64,
pub seq: u64,
pub topic: String,
/// Indexed key/value pairs; opaque bytes preserved verbatim.

#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub indexed: Vec<(String, Vec<u8>)>,
pub data: Vec<u8>
}

Source line: 105.

contract::ContractEventQuery

Filter for list_contract_events.

#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct ContractEventQuery {
pub contract_did: Option<String>,
pub topic: Option<String>,
pub from_height: Option<u64>,
pub to_height: Option<u64>,
pub limit: Option<u32>
}

Source line: 118.

On this page