Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wZEC pool; brownie-token-tester integration #111

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
119 changes: 119 additions & 0 deletions .github/workflows/wzec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: wzec

on:
pull_request:
paths:
- 'tests/**/*.py'
- 'contracts/pools/wzec/**.vy'
push:
paths:
- 'tests/**/*.py'
- 'contracts/pools/wzec/**.vy'


env:
pool: 'wzec'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max_old_space_size=4096


jobs:

unitary-pool:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Compiler Installations
uses: actions/cache@v2
with:
path: |
~/.solcx
~/.vvm
key: compiler-cache

- name: Setup Node.js
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install

- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install Requirements
run: |
pip install wheel
pip install -r requirements.txt

- name: Run Tests
run: brownie test tests/pools/common/unitary --pool ${{ env.pool }}

integration:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Compiler Installations
uses: actions/cache@v2
with:
path: |
~/.solcx
~/.vvm
key: compiler-cache

- name: Setup Node.js
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install

- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install Requirements
run: |
pip install wheel
pip install -r requirements.txt

- name: Run Tests
run: pytest tests/pools/common/integration --pool ${{ env.pool }}

unitary-zap:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Compiler Installations
uses: actions/cache@v2
with:
path: |
~/.solcx
~/.vvm
key: compiler-cache

- name: Setup Node.js
uses: actions/setup-node@v1

- name: Install Ganache
run: npm install

- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install Requirements
run: |
pip install wheel
pip install -r requirements.txt

- name: Run Tests
run: brownie test tests/zaps/common --pool ${{ env.pool }}
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ repos:
rev: 19.3b0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
- repo: https://github.com/PyCQA/isort
rev: 5.7.0
hooks:
- id: isort

default_language_version:
python: python3.8
python: python3.8
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Curve allows users to trade between correlated cryptocurrencies with a bespoke l
* [python3](https://www.python.org/downloads/release/python-368/) from version 3.6 to 3.8, python3-dev
* [brownie](https://github.com/iamdefinitelyahuman/brownie) - tested with version [1.13.0](https://github.com/eth-brownie/brownie/releases/tag/v1.13.0)
* [ganache-cli](https://github.com/trufflesuite/ganache-cli) - tested with version [6.12.1](https://github.com/trufflesuite/ganache-cli/releases/tag/v6.12.1)
* [brownie-token-tester](https://github.com/iamdefinitelyahuman/brownie-token-tester) - tested with version [0.1.0](https://github.com/iamdefinitelyahuman/brownie-token-tester/releases/tag/v0.1.0)


Curve contracts are compiled using [Vyper](https://github.com/vyperlang/vyper), however installation of the required Vyper versions is handled by Brownie.

Expand All @@ -30,8 +32,8 @@ pip install -r requirements.txt

### Organization and Workflow

* New Curve pools are built from the contract templates at [`contracts/pool-templates`](contracts/pool-templates)
* Once deployed, the contracts for a pool are added to [`contracts/pools`](contracts/pools)
- New Curve pools are built from the contract templates at [`contracts/pool-templates`](contracts/pool-templates)
- Once deployed, the contracts for a pool are added to [`contracts/pools`](contracts/pools)

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

Expand Down Expand Up @@ -61,19 +63,19 @@ To deploy a new pool:
2. Edit the configuration settings within [`scripts/deploy.py`](scripts/deploy.py).
3. Test the deployment locally against a forked mainnet.

```bash
brownie run deploy --network mainnet-fork -I
```
```bash
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.
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.

```bash
brownie run deploy --network mainnet
```
```bash
brownie run deploy --network mainnet
```

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

## Audits and Security

Expand Down
20 changes: 20 additions & 0 deletions contracts/pools/wzec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# curve-contract/contracts/pools/wzec

[Curve wZEC pool](). This is a no-lending pool.

## Contracts

- [`StableSwapWZEC`](StableSwapWZEC.vy): Curve stablecoin AMM contract

## Deployments

- [`CurveContractV1`](../../tokens/CurveTokenV1.vy):
- [`LiquidityGauge`](../../gauges/LiquidityGauge.vy):
- [`StableSwapWZEC`](StableSwapWZEC.vy):

## Stablecoins

Curve wZEC pool supports swaps between the following wrapped ZEC coins:

- `wZEC`: [0x4A64515E5E1d1073e83f30cB97BEd20400b66E10](https://etherscan.io/address/0x4A64515E5E1d1073e83f30cB97BEd20400b66E10)
- `renZEC`: [0x1c5db575e2ff833e46a2e9864c22f4b22e0b37c2](https://etherscan.io/address/0x1c5db575e2ff833e46a2e9864c22f4b22e0b37c2)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

Loading