Code Monkey home page Code Monkey logo

cw-tokens's Introduction

CosmWasm Tokens

CircleCI

This is a collection of cw20-related contracts extracted from cw-plus. These serve as examples of what is possible to build and as starting points for your own CosmWasm token contracts.

None of these have been audited or are considered ready-for-production as is. Contributions may come from many community members. Please do your own due dilligence on them before using on any production site, and please raise Github issues for any bugs you find.

You are more than welcome to create a PR to add any cw20-related contract you have written that you would like to share with the community.

Contracts Download Docs
cw20-atomic-swap Release v0.14.2 Docs
cw20-bonding Release v0.14.2 Docs
cw20-escrow Release v0.14.2 Docs
cw20-staking Release v0.14.2 Docs
cw20-merkle-airdrop Release v0.14.2 Docs

Warning None of these contracts have been audited and no liability is assumed for the use of this code. They are provided to turbo-start your projects.

Contracts

All contracts add functionality around the CW20 Fungible Token standard:

  • cw20-atomic-swap an implementation of atomic swaps for both native and cw20 tokens.
  • cw20-bonding a smart contract implementing arbitrary bonding curves, which can use native and cw20 tokens as reserve tokens.
  • cw20-staking provides staking derivatives, staking native tokens on your behalf and minting cw20 tokens that can be used to claim them. It uses cw20-base for all the cw20 logic and only implements the interactions with the staking module and accounting for prices.
  • cw20-escrow is a basic escrow contract (arbiter can release or refund tokens) that is compatible with all native and cw20 tokens. This is a good example to show how to interact with cw20 tokens.
  • cw20-merkle-airdrop is a contract for efficient cw20 token airdrop distribution.

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.8

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

Licenses

All code in this repo will always be licensed under Apache-2.0.

cw-tokens's People

Contributors

hobbyworldstar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.