GithubHelp home page GithubHelp logo

decentraland / agora Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 13.0 2.86 MB

📝Agora is an off-chain governance tool for decentralized communities.

Home Page: https://agora.decentraland.org

License: Other

JavaScript 22.76% TypeScript 71.63% HTML 1.23% CSS 4.03% Dockerfile 0.18% Shell 0.18%
ethereum vote

agora's Introduction

Marketplace

Decentraland's Marketplace

Frontend

Coverage Status

The Marketplace is a React static site. Its code can be found under the /webapp directory.

Backend

It can be found under /indexer.

How to contribute

Contributing to the Marketplace is easy, you just need to go through the following process:

  1. Look for issues in the Issues tab or create a new one with the proposed changes. We classify issues with the “Enhancement”, “Bug” or “Good first issue” tags. Feel free to check one of those first.
  2. Contact team members via the GitHub issue or use the Code Contribution Discord channel. It’s important to at least check on the issue status before starting.
  3. Set up your GPG key and sign all commits in your branch.
  4. Read the testing standards and the coding standards to produce code that fits the project standards.
  5. Create a PR with the changes, linking the PR to the created issue. If there are visual changes in the PR, attach images.

Copyright & License

This repository is protected with a standard Apache 2 license. See the terms and conditions in the LICENSE file.

agora's People

Contributors

2fd avatar abarmat avatar cazala avatar eijigard avatar eordano avatar hprivakos avatar menduz avatar nachomazzara avatar nicosantangelo avatar oscnet avatar virtualgraph avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agora's Issues

Sort options & votes in the backend

Currently we sort options by value and votes by timestamp on the UI, but we should do this on the backend because we need to add several .sort's in the UI and if we miss them that could lead to inconsistencies between screens

Contributions not validated server side

Exploited on Amusement Park's start up plan. Simply modified the signed message to have 100 contributions instead of undefined and submited. Server accepted as valid vote!

API endpoint to save a vote

  • Validate that poll and option exist
  • Validate signature format
  • Extract account address info from signed message

Monitor to update the current balance of a Token for an Account

An approach for this monitor could be implemented watching Transfer() events on the related Account for to the token used for voting.

Another approach is to issue a getBalance(voter_address) for all the addresses that voted, this would require a refresh scan every once in a while.

Remove `isDCLPoll` and `isDCLToken`

Currently we have two helpers isDCLPoll and isDCLToken that both can be replaced in favor of isDistrictToken from src/modules/token/district_token/utils.ts

Support setting a start_date for the poll

This time will work by hiding the poll from public access until now() > start_date
It will help to preload many polls in advance and make them start at a future date.

Componentize "Cast your vote" and "Your vote"

Currently we have two pieces of code repeated in ParcelDetailPage that we should componentize:

Cast your vote

{isFinished(poll) ? null : (
  <div className="vote">
    <Link
      to={locations.voteDetail(poll.id)}
      className={!isConnected ? 'disabled' : undefined}
    >
      <Button primary disabled={!isConnected}>
        {t('poll_detail_page.cast_vote')}
      </Button>
    </Link>
  </div>
)}

Your vote

{currentVote ? (
  <span className="your-vote">
    {t('poll_detail_page.you_voted', {
      option: getVoteOptionValue(poll.options, currentVote)
    })}.{' '}
    <span className="time-ago">
      {distanceInWordsToNow(currentVote.timestamp)}.
    </span>
  </span>
) : null}

UI Fixes

  • Remove headers from tables in table/mobile, add titles intline

  • Add bottom margin on mobile/table to fix scroll issue

  • Fix progress bar in tablet -> bar + CTA don't fit in screen

<Token> component

Create a component to handle the logic of rendering the "Symbol + Amount or just Amount" depending on the token, so we can remove all those token.symbol === 'MANA' ? ... : ...

Define database model

  • Poll
    • name
    • body
    • token
    • submitter
    • closes_at
    • created_at
    • updated_at
  • Option
    • name
    • poll_id
    • created_at
    • updated_at
  • Account (this is if we want to have some sort of profile)
    • address
    • name
    • email (?)
  • Vote
    • poll_id
    • option_id
    • address
    • signed_message
    • created_at

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.