Giter VIP home page Giter VIP logo

community-gateway's Introduction

Nectar Community

Nectar Logo

With the aim of building the world’s largest community of decentralised exchange users, the Nectar token (NEC) encompasses governance and platform loyalty functionalities specifically tailored for decentralised exchanges.

Nectar.community is the main hub where NEC token holders, via the necDAO, are able to propose and vote on the future direction and decisions of integrated platforms, starting with the DeversiFi decentralised exchange platform, along with having the scope to govern:

  • Ownership of the Nectar ERC20 Token controller smart-contract for future upgrades
  • Governance of the necDAO, one of the world’s largest funded DAOs (17k ETH)
  • A whitelisted tokens registry dictating the assets which can be traded on the platform (eg DeversiFi)
  • The Ethereum Name Service records registered for platforms integrating NEC. (eg DeversiFi smart-contracts)

Participation in the necDAO will be open to all Nectar holders, who will be able to make proposals, deploy capital and grow the DAO as they see fit. In order to participate, users will essentially “stake” their NEC by sending them to the necDAO in exchange for “Reputation” (voting power).

These tools are created open-source to help NEC holders interact safely with the Nectar smart contracts. Over time these will evolve, and contributions of new features are welcomed. Nectar.community has support for ledger, metamask, and keystore files.

Voting DApp

The voting in this implementation makes use of the properties of Giveth's MiniMe token.

Proposals are submitted by holders of NEC tokens, managed by ProposalManager.sol, and stored to a DHT using Grenache, with the storage hash saved on Ethereum.

Once a proposal has been accepted by an admin, it triggers a clone of the NEC token to be created, giving all token holders a matching balance of voting tokens for the proposal. When a user casts their vote their tokens are destroyed.

Example Proposal Screenshot

Token Listing Proposals are also voted on and managed by TokenListingManager.sol.

Listing Votes: Proposing A Token (currently inactive)**

Every 2 weeks a new listing proposal begins, allowing a certain number of tokens to be selected by the community to be listed.

To propose a token for voting, you can add the details yourself in a JSON file and add a pull request.

More details about the process for submitting a token will be available once the token voting functionality becomes active again.

Traderboard

Implemented in nectar.community is a traderboard, where the live rankings of every trader on the DeversiFi decentralised exchange can be seen:
Traderboard Example

Statistics are displayed in 30 day Volume rank as default, with options to change the time period, with the table updating accordingly. A novelty trophy is also shown corresponding to each wallets volume amount, ranging from minnow ($100k 30 day volume) to whale ($5m 30 day volume). Addresses holding NEC are also displayed with a NEC logo in the trophies column.

Mainnet Contracts

TokenProposalManager.sol is deployed at: 0x2b2D7d874bBfb73F85b2F8A9EE0D9F3E93722622

ProposalManager.sol is deployed at: 0xB24Ed9d62d4c660FAF56a4cDdADa06C88b2d5DdB with JSON Interface (ABI):

[{"constant":false,"inputs":[{"name":"_admin","type":"address"}],"name":"removeAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_admin","type":"address"}],"name":"isAdmin","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_proposalId","type":"uint256"}],"name":"denyProposal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getNotApprovedProposals","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_proposalId","type":"uint256"}],"name":"proposal","outputs":[{"name":"_proposer","type":"address"},{"name":"_startBlock","type":"uint256"},{"name":"_startTime","type":"uint256"},{"name":"_duration","type":"uint256"},{"name":"_storageHash","type":"bytes32"},{"name":"_active","type":"bool"},{"name":"_finalized","type":"bool"},{"name":"_totalYes","type":"uint256"},{"name":"_totalNo","type":"uint256"},{"name":"_token","type":"address"},{"name":"_approved","type":"bool"},{"name":"_denied","type":"bool"},{"name":"_hasBalance","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_duration","type":"uint256"},{"name":"_storageHash","type":"bytes32"}],"name":"addProposal","outputs":[{"name":"_proposalId","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getApprovedProposals","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nProposals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"onTransfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"getActiveProposals","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newAdmin","type":"address"}],"name":"addAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_proposalId","type":"uint256"}],"name":"approveProposal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_proposalId","type":"uint256"},{"name":"_yes","type":"bool"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"onApprove","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"tokenFactory","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"address"}],"name":"proxyPayment","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProposal","type":"uint256"},{"indexed":true,"name":"_voter","type":"address"},{"indexed":false,"name":"yes","type":"bool"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Vote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProposal","type":"uint256"}],"name":"Approved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idProposal","type":"uint256"},{"indexed":false,"name":"duration","type":"uint256"},{"indexed":false,"name":"storageHash","type":"bytes32"}],"name":"NewProposal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]  
  

The Nectar token (NEC) is deployed at 0xcc80c051057b774cd75067dc48f8987c4eb97a5e

Prerequisites / First time setup

  • Copy frontend config src/constants/config.dist.json to src/constants/config.json and edit if needed

  • Copy server config server/config.dist.js to server/config.js and edit if needed

  • Run yarn to install dependencies

  • Run yarn prod to build frontend

  • Create sqlite database used for backup and create table by running server/create.sql. Set the database location in server/config.js

  • Make sure to have a grenache-grape node running and set it's url in server/config.js and src/constants/config.json

  • Run the Grenache service by running node server/crud-service.js

  • Run the backend by running node server/index.js

CLI commands

To start the website development build locally run yarn dev

To start the website production build locally run yarn prod-serve

To build production files in the dist directory run yarn prod

License

MIT

community-gateway's People

Contributors

darcsideadmin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

community-gateway's Issues

error handling: remove throws

in production, they will crash the whole server application, which will lose all current state and the server is restarted.

here is one occurence: https://github.com/ethfinex/community-gateway/blob/e34035dd1559106ceebfbe0ddb876f9cfa9c0b7f/server/crud-service.js#L42

you probably want to handle the error different, e.g. by logging them and inspect them over time - and also reply to the connecting party that something went wrong (right now the open socket would just close/crash).

Ethfinex Trustless - Trustless Traderboard Interface

There is a bounty of 1.5 ETH available for this issue on Gitcoin

Current

An API has been created to get a list of all traders and trading volumes in a particular day, if they have used Ethfinex Trustless (https://trustless.ethfinex.com). This API also provides trading volume results sorted by token, as well as overall across all tokens. This is available at the github repository below, which includes additional resources:

https://github.com/ethfinex/ethfinex-trading-competition

At the moment there is no user interface available to display this information, although the API is deployed at: https://competition.nectar.community/api/v1/results where you can view current results.

Wanted

A functional and “aesthetical” UI, as a page in nectar.community (https://nectar.community), displaying the top trading addresses for trustless.ethfinex.com with filter functionality across available pairs and time-frames.

Feature completeness includes:

  • Ability to display address leaderboard for individual pairs AND overall
  • Ability to display address leaderboard for a selection of pairs, e.g. ETH/USDT AND ZRX/USDT but not others
  • Ability to view leaderboard within a customisable time-frame; hours, days, weeks, months
  • Ability to view the changing leaderboard activity in real-time
  • An aesthetically pleasing UI, matching the existing Ethfinex brand colours and theme visible at nectar.community

Definition of Complete

You have successfully completed this bounty, when:

  • All features above are implemented and functional with a satisfactory user-interface, as described above.
  • The style/css matches that of the rest of the nectar.community website
  • There is a pull-request opened with the feature to https://github.com/ethfinex/community-gateway

Submission

Please submit your work by making a pull request to the Github repository.

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.