Skip to content

vyperfun/curve-contract

 
 

Repository files navigation

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

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:

pytest tests --pool <POOL NAME>

Valid pool names are the names of the subdirectories within contracts/pools.

Deployment

To deploy a new pool based on one of the templates:

  1. In brownie_hooks.py, set the number of coins and decimal places.
  2. In scripts/deploy.py, set the constructor parameters and deployer account.

To deploy a pool based on StableSwapBase (without lending):

brownie run deploy base --network mainnet

To deploy a pool based on StableSwapYLend (with yearn-style lending):

brownie run deploy ylend --network mainnet

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.

About

Smart contracts for Curve.fi in Vyper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%