Skip to content

Template repository you can clone to start you Risc0 smart contract

License

Notifications You must be signed in to change notification settings

Hyle-org/template-risc0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template for a Hyle-Risc0 smart contract

This basic implementation is based on "counter" contract, that increment / decrement a value.

Prerequisites

Clone the hyle repo, checkout the version you need, and run:

export RISC0_DEV_MODE=1
cargo run -- --pg

Quickstart

Build and register the contract

To build and register the smart contract on the local node, run:

cargo run -- register-contract

The expected output on the node is 📝 Registering contract counter.

Executing the Project Locally in Development Mode

During development, faster iteration upon code changes can be achieved by leveraging dev-mode, we strongly suggest activating it during your early development phase.

RISC0_DEV_MODE=1 cargo run

Execute the contract & send a tx on-chain

RISC0_DEV_MODE=1 cargo run -- increment

Directory Structure

It is possible to organize the files for these components in various ways. However, in this starter template we use a standard directory structure for zkVM applications, which we think is a good starting point for your applications.

project_name
├── Cargo.toml
├── contract 
│   ├── Cargo.toml
│   └── src
│       └── lib.rs         <-- [Contract code goes here, common to host & guest]
├── host
│   ├── Cargo.toml
│   └── src
│       └── main.rs        <-- [Host code goes here]
└── methods
    ├── Cargo.toml
    ├── build.rs
    ├── guest
    │   ├── Cargo.toml
    │   └── src
    │       └── main.rs    <-- [Guest code goes here]
    └── src
        └── lib.rs

About

Template repository you can clone to start you Risc0 smart contract

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages