Git Product home page Git Product logo

curve-contract's Introduction

curve-contract

Vyper contracts used in Curve exchange pools.

Overview

Curve is an exchange liquidity pool on Ethereum designed for extremely efficient stablecoin trading and low risk, supplemental fee income for liquidity providers, without an opportunity cost.

Curve allows users to trade between correlated cryptocurrencies with a bespoke low slippage, low fee algorithm. The liquidity pool is also supplied to lending protocol where it generates additional income for liquidity providers.

Testing and Development

Dependencies

Curve contracts are compiled using Vyper, however installation of the required Vyper versions is handled by Brownie.

Setup

To get started, first create and initialize a Python virtual environment. Next, clone the repo and install the developer dependencies:

git clone https://github.com/curvefi/curve-contract.git
cd curve-contract
pip install -r requirements.txt

Organization and Workflow

See the documentation within contracts and it's subdirectories for more detailed information on how to get started developing on Curve.

Running the Tests

The test suite contains common tests for all Curve pools, as well as unique per-pool tests. To run the entire suite:

brownie test

To run tests on a specific pool:

brownie test tests/ --pool <POOL NAME>

Valid pool names are the names of the subdirectories within contracts/pools. For templates, prepend template- to the subdirectory names within contracts/pool-templates. For example, the base template is template-base.

You can optionally include the --coverage flag to view a coverage report upon completion of the tests.

Deployment

To deploy a new pool:

  1. Ensure the pooldata.json for the pool you are deploying contains all the necessary fields.

  2. Edit the configuration settings within scripts/deploy.py.

  3. Test the deployment locally against a forked mainnet.

    brownie run deploy --network mainnet-fork -I

    When the script completes it will open a console. You should call the various getter methods on the deployed contracts to ensure the pool has been configured correctly.

  4. Deploy the pool to the mainnet.

    brownie run deploy --network mainnet

    Be sure to open a pull request that adds the deployment addresses to the pool README.md.

Audits and Security

Curve smart contracts have been audited by Trail of Bits. These audit reports are made available on the Curve website.

There is also an active bug bounty for issues which can lead to substantial loss of money, critical bugs such as a broken live-ness condition, or irreversible loss of funds.

License

(c) Curve.Fi, 2020 - All rights reserved.

curve-contract's People

Contributors

iamdefinitelyahuman avatar michwill avatar samwerner avatar pengiundev avatar fubuloubu avatar acryptosx avatar jameslefrere 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.