Skip to main content

execute_contract

Function execute_contract 

Source
pub fn execute_contract(contract: &Contract, inputs: &str) -> Result<String>
Expand description

Execute a contract with given inputs (convenience function — public API)

§Arguments

  • contract — parsed & verified contract
  • inputs — JSON string: array of { "operation": "name", "inputs": { ... } } OR single { "operation": "name", "inputs": { ... } }

§Returns

JSON string with execution result including provenance log

§Guarantees

  • Deterministic: same inputs → same outputs
  • Bounded: resource limits enforced (memory, time)
  • Verifiable: preconditions checked, postconditions verified
  • Logged: all state changes recorded in provenance