Coder Social home page Coder Social logo

basket-protocol's Introduction

Basket Protocol

Build Status Coverage Status

A new paradigm for asset management

The Basket protocol establishes a decentralized ecosystem that trustlessly fulfills the primary functions of asset management: selection, execution, and custody. A Basket is a wallet-like instrument that contains a portfolio of digital assets. Unlike a fund, the owner of the Basket has full control and agency of the digital assets that it contains.

Roles in the Basket Protocol Ecosystem

The Basket Protocol deconstructs the traditional asset management model into three functional roles, allowing for specialization, efficiency, and decentralization. Market participants can act in any or all capacities. Meanwhile, the protocol's registry capabilities facilitate the evaluation of and tracking of baskets as well as of the arrangers that created them.

  • Arranger: creates a new basket contract by specifying the composition of tokens and their weights that the basket tokens should contain
  • Supplier: accumulates ERC20 tokens for compiling into baskets and "minting" of basket tokens
  • Buyer: the ultimate holder of the basket token, who owns and controls the basket tokens and the underlying ERC20 tokens they represent

Basket Protocol Contract Suite

Basket Contract

The fundamental building block of the Basket Protocol, a Basket Contract is an extended ERC20 token contract capable of holding and transacting in other ERC20 tokens. In addition to the basic ERC20 token specifications, the basket contract adds the following functionality:

// Deposit ERC20 tokens into the basket contract and "mint" new Basket ERC20
// tokens that represent the underlying tokens
function depositAndBundle(uint _quantity) public payable returns (bool success)
// Extract the underlying ERC20 tokens and "burning" the Basket token
function debundleAndWithdraw(uint _quantity) public returns (bool success)

A holder of a basket token issued by a Basket Contract has direct control over and agency of the underlying ERC20 tokens represented by the basket token. The Basket Contract ensures that the tokens represented by a basket token are always held by the Basket Contract, readily available for any holder who wants to debundle and assume direct ownership of the underlying tokens, at any time.

Basket Factory

Contract that allows Arrangers to construct new ERC20 token portfolios by creating new Basket Contracts. When constructing new baskets, Arrangers specify tokens and weights, creating a "template" for minting new Basket tokens from that basket.

Basket Registry

A registry to keep track of baskets created, quantity of each basket minted and burned, as well as usage of a particular arranger's baskets.

Basket Escrow

Allows for users to create buy and sell orders for baskets, fill orders, and transact in Ether.

Coding Guides

Solidity Compiler

The basket protocol uses Solidity 0.4.21.

  • Introduces "emit LogEvent" syntax
  • Note on 0.4.22: compiler version has been downgraded to 0.4.21 due to potential errors related to ERC20 tokens introduced in 0.4.22 (read more)

Testing

$ truffle install -g [email protected]
Truffle v4.1.5 (core: 4.1.5)
Solidity v0.4.21 (solc-js)

Run test

$ npm test

Running test coverage (solidity-coverage)

# Requires environment variable TEST_COVERAGE=true, which is set in the npm script:
npm run coverage

Deployed Contracts: Ropsten Testnet

We have currently deployed a testnet version of the protocol on Ropsten Ethereum.

Testnet ERC20 Tokens

Basket Factory

Basket Registry

Basket Escrow

Security

The CoinAlpha team, to the extent possible, aims to follow industry best practices and keep up to date with the rapidly developing field of smart contracts and blockchain engineering. Some of the guides and best practices followed include:

Hosho Security Audit

Hosho Audited

  • In July 2018, we hired Hosho, a global leader in blockchain security.
  • Our protocol passed Hosho's comprehensive audit. The full report can be found here: Hosho Security Audit Report.

๐Ÿž Bug Bounty Program

We are also running a bug bounty program. If you find a security issue, please email [email protected]. For more information on the Bug Bounty program, click here: Basket Protocol Bug Bounty Program

Contributions Are Welcome!

We welcome code contributions (via pull requests) as well as bug reports and feature requests through github issues. You may also contact us by email.

Contact

The Basket Protocol was created by CoinAlpha. You can contact us at [email protected].

License

Code released under the Apache-2.0 License.

basket-protocol's People

Contributors

yzhang1994 avatar carlolm avatar fengtality avatar

Watchers

James Cloos 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.