Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 1008 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 1008 Bytes

Cipher Examples

This repo contains a collection of example contracts that run on Cipher, the confidential Oasis Wasm ParaTime.

The Examples

  • vigil - A dead-person's switch that confidentially stores secrets until a (refreshable) set time.

How to use

  1. Grab the Oasis CLI. It can be used to upload, instantiate, and call contracts on Cipher.
  2. Compile a contract using cargo build --release --target wasm32-unknown-unknown
  3. Optionally, optimize the contract using wasm-opt
    TARGET_DIR="target/wasm32-unknown-unknown/release"
    wasm-opt "${TARGET_DIR}/<contract>.wasm" -o "${TARGET_DIR}/<contract>.opt.wasm" -O3 -c
    
  4. Upload the contract: oasis contracts upload "${TARGET_DIR}/<contract>[.opt].wasm"
  5. Instantiate the contract: oasis contracts instantiate <the-instance-id> <yaml-args>
  6. Call the contract: oasis contract call <the-instance-id> <yaml-args>