Giter VIP home page Giter VIP logo

compound-governance-examples's Introduction

Quick Start: Compound Governance

Code examples for building your own interface for Compound Protocol Governance. The COMP & Governance smart contracts are live on the Ethereum Main and Ropsten test networks.

Full Quick Start Tutorial on the Compound Medium Blog

What is Compound?

Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system. Learn more on the website:

Compound Finance

What is Compound Protocol Governance?

The Compound protocol is upgraded and configured in a decentralized fashion. All changes (from supported assets, to system parameters) are decided by COMP token-holders using the voting system.

Community members can create proposals or vote on proposals to modify the protocol. This is made possible by the Compound Governance smart contract.

In order to participate in governance, users do not need to hold any COMP token in their Ethereum wallet. However, users need to have COMP delegated to their address. Delegation is a utility function in the COMP ERC-20 token contract.

Learn more in the Compound Protocol Governance Documentation.

Examples

The following code examples can be used in a Web3-enabled website.

There are examples for querying the Ethereum blockchain directly as well as examples that use the Compound REST API. Operations that get can be done using either implementation. However set operations must be performed by writing to the blockchain with Web3, which requires ETH to be spent on gas fees.

For latest contract addresses and ABIs, see the networks page in the docs.

Get All COMP Token Holders

Get All Delegates

Get All Proposals (All States)

Get All Ballots for a Proposal

Delegate Your Voting Rights

Cast Your Vote for an Active Proposal

Signature Examples

Running

Clone this repository. Use a Web3 enabled browser (like Brave, or install the MetaMask browser extension). Serve the files from an HTTP server; The HTML files will not work if you open them directly in your browser. The following command line commands includes an HTTP server, which is installed with Node.js and npm.

git clone [email protected]:compound-developers/compound-governance-examples.git
cd compound-governance-examples/
npm install -g http-server
http-server -p 8080

Then go to http://localhost:8080/api-examples/get_proposals in your web browser.

Compound Governance Resources

compound-governance-examples's People

Contributors

ajb413 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.