Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/confio/poe-contracts
Tgrade PoE smart contracts
https://github.com/confio/poe-contracts
Last synced: about 1 month ago
JSON representation
Tgrade PoE smart contracts
- Host: GitHub
- URL: https://github.com/confio/poe-contracts
- Owner: confio
- License: apache-2.0
- Created: 2021-12-29T08:50:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-16T11:12:47.000Z (over 1 year ago)
- Last Synced: 2024-10-05T12:36:00.160Z (2 months ago)
- Language: Rust
- Size: 1.26 MB
- Stars: 25
- Watchers: 5
- Forks: 8
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - confio/poe-contracts - Tgrade PoE smart contracts (Rust)
README
# PoE Contracts
This repo maintains contracts and support libraries for building the Tgrade PoE contracts.
These are **not** available under an open source license, you need permission from Confio to use them.It is organized like [`cosmwasm-plus`](https://github.com/CosmWasm/cosmwasm-plus). You can use that as a reference.
## Compiling
To compile all the contracts, run the following in the repo root:
```
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.12.4
```This will compile all packages in the `contracts` directory and output the
stripped and optimized wasm code under the `artifacts` directory as output,
along with a `checksums.txt` file.If you hit any issues there and want to debug, you can try to run the
following in each contract dir:
`RUSTFLAGS="-C link-arg=-s" cargo build --release --target=wasm32-unknown-unknown --locked`## Creating a new contract
You can start with [cosmwasm-template](https://github.com/CosmWasm/cosmwasm-template) as a basis:
```bash
cd contracts
cargo generate --git https://github.com/CosmWasm/cosmwasm-template.git --name CONTRACT_NAME
cd CONTRACT_NAME# remove unneeded files
rm -rf .circleci .github .git
rm .cargo-ok .editorconfig .gitignore rustfmt.toml
rm Developing.md Importing.md Publishing.md LICENSE NOTICE# regenerate schema for CI tests
cargo schemagit add .
```Then add it to CI, by editing `.circleci/config.yml`. Just copy the `contract_tgrade_dso` section and
rename it, pointing to your new contract.Finally, update `Cargo.toml` to use the current version used by all other contracts in this repo.
## Debugging
Sometimes errors might be not helpful enough, or actual error with vague description might come from
depths of other tgrade or cosmwasm related dependencies.
In such case you might want to check backtraces.Make sure you have `nightly` installed:
```bash
$ rustup install nightly
```
and then run:
```bash
$ RUST_BACKTRACE=1 cargo +nightly test --features backtraces
```
to get more detailed backtraces.