Code Monkey home page Code Monkey logo

badger-system's Introduction

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.

badger-system's People

Contributors

0xdragoon avatar affaxltd avatar andy8052 avatar badgerassassin avatar c0rv0s avatar dapp-whisperer avatar darruma avatar gallodasballo avatar mandalorian-101 avatar mitche50 avatar mqduck avatar mushroomsforest avatar notbdu avatar okjintao avatar sajanrajdev avatar shuklaayush avatar thegismar00 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.