[][src]Module transact::contract::archive

Enables loading smart contract archives from scar files.

A scar file is a tar bzip2 archive that contains two required files:

  • A .wasm file that contains a WASM smart contract
  • A manifest.yaml file that contains, at a minimum:
    • The contract name
    • The contract version
    • The contract's input addresses
    • The contract's output addresses

Examples

use transact::contract::archive::{default_scar_path, SmartContractArchive};

let archive = SmartContractArchive::from_scar_file("xo", "0.1", &default_scar_path())
    .expect("failed to load scar file");

Structs

Error
SmartContractArchive

The definition of a smart contract, including the contract's associated metadata and the bytes of the smart contract itself.

SmartContractMetadata

The metadata of a smart contract archive.

Functions

default_scar_path

Load default location(s) for scar files.