Shade Protocol Core Contracts
Contract | Reference | Description |
---|---|---|
mint |
doc | Handles asset burning and silk minting |
oracle |
doc | Handles asset price queries |
treasury |
doc | Handles asset price queries |
Development
Development Environment
Install docker for local environment
Source from testnet
docker run -it --rm -p 26657:26657 -p 26656:26656 -p 1337:1337 -v $(pwd):/root/code --name secretdev enigmampc/secret-network-sw-dev
docker exec -it secretdev /bin/bash
Testing the environment
Inside the container:
run python3 contract_tester.py
Environment Setup
- Rust v1.44.1+
wasm32-unknown-unknown
target- Docker
- binaryen
-
Install
rustup
via https://rustup.rs/ -
Run the following:
rustup default stable
rustup target add wasm32-unknown-unknown
-
Make sure Docker is installed
-
To compile the contracts install binaryen
apt install binaryen
Unit / Integration Tests
Each contract contains Rust unit and integration tests embedded within the contract source directories. You can run:
cargo unit-test
cargo integration-test
Compiling
Run this script to run all of the contract's unit / integration tests and then prepare the contracts for production in /contracts/compiled:
bash ./compile-contracts.sh
Testing
You can optionally run extended tests using the tester
To run a test deployment on a public testnet you can run tester.py --testnet public
. For the private testnet you can run tester.py --testnet private
.