• Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Badger Logo

Badger Finance

Badger Finance is a community DAO, focused on bringing Bitcoin to DeFi. The DAO's debut products are Sett, a yield aggregator, and Digg, a BTC-pegged elastic supply currency.

Visit our GitBook for more detailed documentation.

Build

The Badger contracts & tests are built around the Eth-Brownie Python framework.

If you're not familiar with brownie, see the quickstart guide.

Dependencies

  • Python 3.9
  • Node.js 10.x development environment (for Ganache).
  • Eth-Brownie
  • Ganache (v6.12.1)

Install

This repository is currently only supported on Linux based systems. For Windows 10 users, it is recommended to use the Windows Subsystem for Linux 2 (WSL2) in order to run Linux executables natively and interact with the system in a convenient way. Instructions on how to quickly setup WSL2 can be found here.

For Ubuntu, you can install the prerequisite packages with the following command:

sudo apt-get install -y python3 python3-virtualenv python3-pip

For other systems, install Python 3.9, Pip, and use pip to install virtualenv with

pip install virtualenv

To install NodeJS and yarn on UNIX based systems, it is recommended to use the following commands:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
nvm install v14.16.1
npm install -g yarn

With prerequisites installed, install the project with:

git clone https://github.com/Badger-Finance/badger-system
cd badger-system
yarn install --lock-file
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Compile

source venv/bin/activate
brownie compile

Test

source venv/bin/activate
brownie test

Add coverage and gas profiling

source venv/bin/activate
brownie test --coverage --gas

Local Instance

Run a local ganache instance connected to badger contracts, with all Sett-related assets distributed to a test account specified in the TEST_ACCOUNT env variable. Assumes the default network is mainnet-fork in the brownie config and uses Alchemy as a web3 provider through the ALCHEMYAPI_TOKEN env variable. Ganache will continue to run until the process is closed.

source venv/bin/activate
export TEST_ACCOUNT=<enter your account here>
export ALCHEMYAPI_TOKEN=<enter Alchemy key here>
brownie run scripts/local_instance.py

Running Scripts on non-Ethereum chains

The included brownie-config.yaml has configurations for running forked environments on non-ethereum chains where Badger contracts are deployed. To run scripts against another chain, append the appropriate --network parameter to any brownie run or brownie test command.

The appropriate live Badger deploy for that chain will automatically be read.

As an example, bsc-fork is the networkID for a Binance Smart Chain forked environment.

brownie run scripts/local_instance.py --network bsc-fork

Badger Deploy Files

These files maintain a registry of all live Badger contracts on a given chain.

Post-Update

  • Set boost flag to false to upload boosts to production instead of staging
  • Run scripts with --network mainnet instead of --network mainnet-fork

Documentation

You can read more about Badger at our GitBook.

Discussion

To join the community, head over to the Discord server.

More Repositories

1

badger-multisig

Badger DAO's EVM multisig operations.
Python
48
star
2

digg-core

Core contracts of Digg BTC-pegged elastic supply currency
JavaScript
21
star
3

strategy-convex-staking-optimizer

Solidity
10
star
4

v2-ui

Badger Protocol Application Interface
TypeScript
9
star
5

badger-sdk

Badger Protocol Typescript SDK
TypeScript
8
star
6

gitcoin

Repo for gitcoin hack-a-thons,bonunties and code snippets.
7
star
7

badger-strategies

5
star
8

price-bots

Discord price bots for Badger DAO.
Python
5
star
9

badger-subgraph

TypeScript
5
star
10

badger-api

Serverless API for Badger DAO protocol.
TypeScript
5
star
11

badger-avatars

Solidity
4
star
12

Redwall

TypeScript
3
star
13

badger-rewards

Python
3
star
14

harvest-monitor-bot

Discord bot to monitor Badger strategy harvests using Etherscan API
JavaScript
3
star
15

badger-influence-analytics

Jupyter Notebook
3
star
16

python-keepers

Python based keeper bots for Badger setts.
Python
3
star
17

badger-registry

On Chain Registry for V1, V1.5 and V2 Vaults as well as Known Addresses via extensibly key address pairs
Solidity
3
star
18

strategy-aura-staking

Python
2
star
19

badger-utils

Library that keeps shared code for badger project
Python
2
star
20

gnosis-multisig-monitor

Python
2
star
21

auraBal-staker

Python
2
star
22

daowatch

Python
2
star
23

aura-autovoter

Python
1
star
24

badger-voter-sdk

Library for voters shared code
Python
1
star
25

ebtc-purple-paper

Contains the eBTC Protocol's Purple Paper
1
star
26

vested-aura

Python
1
star
27

badger-infra

Solidity
1
star
28

BadgerDiscordBot

Python
1
star
29

SourceCred

from template
Shell
1
star
30

badger-voting

Badger main repo for voting tickets
1
star
31

univ3-bot-pricing

Python
1
star
32

strategy-convex-helpers

bCVX and bcvxCRV Strategies and Test suites
Solidity
1
star