Skip to content

Latest commit

 

History

History
78 lines (57 loc) · 3.95 KB

README.md

File metadata and controls

78 lines (57 loc) · 3.95 KB

BarnBridge DAO

Implements the BarnBridge Decentralized Autonomous Organization (DAO) Governance contracts, allowing token holders to create proposals, vote upon them, and queues up for execution those proposals that have passed with quorum. Includes an Abrogation mechanism to cancel queued transactions.

Any questions? Please contact us on Discord or read our Developer Guides for more information.

Contracts

Governance.sol

Implements DAO logic Creating proposals, voting, queuing, canceling, executing and abrogating.

Smart Contract Architecture

Overview

Check out more detailed smart contract Slither graphs with all the dependencies: Yield Farming Slither Graphs.

Smart Contract Specification

SPEC

Initial Setup

Install NVM and the latest version of NodeJS 12.x

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash 
# Restart terminal and/or run commands given at the end of the installation script
nvm install 12
nvm use 12

Use Git to pull down the BarnBridge-SmartYieldBonds repository from GitHub

git clone https://github.com/BarnBridge/BarnBridge-DAO.git
cd BarnBridge-YieldFarming

Updating the .env file

Create an API key with a Provider such as Infura to deploy to Ethereum Public Testnet. In this guide, we are using Kovan.

  1. Navigate to Infura.io and create an account
  2. Log in and select "Get started and create your first project to access the Ethereum network"
  3. Create a project and name it appropriately; switch the Network to Kovan
  4. Then, copy the URL and paste it into the section named PROVIDER in the .env file

Create an API key with Etherscan

  1. Navigate to EtherScan and create an account
  2. Log in and navigate to MyAPIKey
  3. Use the Add button to create an API key, and paste it into the indicated section towards the bottom of the config.ts file

Update .env file with the address of the Barn contract from BarnBridge-Barn

  1. Get the Barn address given by deploying BarnBridge-Barn and paste it into the .env file section labeled BARN

Update .env with your wallet information

  1. Finally, insert the mnemonic phrase for your testing wallet. You can use a MetaMask instance, and switch the network to Rinkeby on the upper right. DO NOT USE YOUR PERSONAL METAMASK SEED PHRASE; USE A DIFFERENT BROWSER WITH AN INDEPENDENT METAMASK INSTALLATION
  2. You'll need some Kovan-ETH (it is free) in order to pay the gas costs of deploying the contracts on the TestNet; you can use your GitHub account to authenticate to the KovanFaucet and receive 2 Kovan-ETH for free every 24 hours

Install NodeJS dependencies which include HardHat

npm install

Compile the contracts

npm run compile

Running Tests

npm run test

Note: The result of tests is readily available here.

Running Code Coverage Tests

npm run coverage

Deploying to Kovan

Use the code in the scripts folder to deploy the Governance contract on Kovan

npm run deploy-from-env

MainNet Contracts

Governance.sol

Audits

Discussion

For any concerns with the platform, open an issue on GitHub or visit us on Discord to discuss. For security concerns, please email [email protected].

Copyright 2021 BarnBridge DAO