Code Monkey home page Code Monkey logo

cosmwasm-plus's Introduction

CosmWasm Plus

CircleCI

Specification Download Docs
cw0 cw0 on crates.io Docs
cw1 cw1 on crates.io Docs
cw2 cw2 on crates.io Docs
cw3 cw3 on crates.io Docs
cw20 cw20 on crates.io Docs
cw721 cw721 on crates.io Docs
Contracts Download Docs
cw1-subkeys cw1-subkeys on crates.io Docs
cw1-whitelist cw1-whitelist on crates.io Docs
cw3-fixed-multisig cw3-fixed-multisig on crates.io Docs
cw20-atomic-swap cw20-atomic-swap on crates.io Docs
cw20-base cw20-base on crates.io Docs
cw20-escrow cw20-escrow on crates.io Docs
cw20-staking cw20-staking on crates.io Docs
cw721-base cw721-base on crates.io Docs

This is a collection of specification and contracts designed for use on real networks. They are designed not just as examples, but to solve real-world use cases, and to provide a reusable basis to build many custom contracts.

If you don't know what CosmWasm is, please check out our homepage and our documentation to get more background. We are running a public testnet you can use to test out any contracts.

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

Note All code in pre-1.0 packages is in "draft" form, meaning it may undergo minor changes and additions until 1.0. For example between 0.1 and 0.2 we adjusted the Expiration type to make the JSON representation cleaner (before: expires: {at_height: {height: 12345}} after expires: {at_height: 12345})

Specifications

The most reusable components are the various cwXYZ specifications under packages. Each one defines a standard interface for different domains, eg. cw20 for fungible tokens, cw721 for non-fungible tokens, cw1 for "proxy contracts", etc. The interface comes with a human description in the READMEs, as well as Rust types that can be imported.

They contain no logic, but specify an interface. It shows what you need to implement to create a compatible contracts, as well as what interface we guarantee to any consumer of such contracts. This is the real bonus of specifications, we can create an escrow contract that can handle many different fungible tokens, as long as they all adhere to the cw20 specification.

If you have ideas for new specifications or want to make enhancements to existing spec, please raise an issue or create a pull request on this repo.

Contracts

We provide sample contracts that either implement or consume these specifications to both provide examples, as well as provide a basis for code you can extend for more custom contacts, without worrying about reinventing the wheel each time. For example cw20-base is a basic implementation of a cw20 compatible contract that can be imported in any custom contract you want to build on it.

CW1 Proxy Contracts:

  • cw1-whitelist a minimal implementation of cw1 mainly designed for reference
  • cw1-subkeys a simple, but useful implementation, which lets us use a proxy contract to provide "allowances" for native tokens without modifying the bank module

CW20 Fungible Tokens:

  • cw20-base a straightforward, but complete implementation of the cw20 spec along with all extensions. Can be deployed as-is, or imported by other contracts
  • 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.

Licenses

This repo contains two license, Apache 2.0 and AGPL 3.0. All crates in this repo may be licensed as one or the other. Please check the NOTICE in each crate or the relevant Cargo.toml file for clarity.

All specifications will always be Apache-2.0. All contracts that are meant to be building blocks will also be Apache-2.0. This is along the lines of Open Zepellin or other public references.

Contracts that are "ready to deploy" may be licensed under AGPL 3.0 to encourage anyone using them to contribute back any improvements they make. This is common practice for actual projects running on Ethereum, like Uniswap or Maker DAO.

cosmwasm-plus's People

Contributors

ethanfrey avatar maurolacy avatar orkunkl avatar whalelephant avatar webmaster128 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.