olympus-pro

Crates.ioolympus-pro
lib.rsolympus-pro
version1.0.0
sourcesrc
created_at2022-05-08 07:49:09.928286
updated_at2022-05-08 07:49:09.928286
descriptionCommon helpers for olympus pro
homepagehttps://www.olympusdao.finance/
repositoryhttps://github.com/chainGossip/olympus-pro-terra
max_upload_size
id582392
size14,408
Thomas Lu (chainGossip)

documentation

https://docs.terra.money

README

Olympus Pro contract on terra

Development

Environment Setup

  • Rust v1.44.1+
  • wasm32-unknown-unknown target
  • Docker
  1. Install rustup via https://rustup.rs/

  2. Run the following:

rustup default stable
rustup target add wasm32-unknown-unknown
  1. Make sure Docker is installed

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

After making sure tests pass, you can compile each contract with the following:

RUSTFLAGS='-C link-arg=-s' cargo wasm
cp ../../target/wasm32-unknown-unknown/release/cw1_subkeys.wasm .
ls -l cw1_subkeys.wasm
sha256sum cw1_subkeys.wasm

Production

For production builds, run the following:

docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/workspace-optimizer:0.10.4

This performs several optimizations which can significantly reduce the final size of the contract binaries, which will be available inside the artifacts/ directory.

License

Commit count: 0

cargo fmt