Giter VIP home page Giter VIP logo

gtcr's Introduction

Generalized Token Curated List

JavaScript Style Guide Conventional Commits Commitizen Friendly

Get Started

  1. Clone this repo.
  2. Duplicate .env.example and rename it to .env. Fill the environment variables.
  3. Run nvm use 16
  4. Run yarn to install dependencies and then yarn build:theme && yarn start to start the dev server.

Tested on node version 10.

Supporting New Field Types

The Generalized TCR clients can learn how to parse and decode data stored onchain by reading what are the field types of each column from the metadata object stored on the meta evidence file.

Important

To support a new field type, it is required to update the evidence display interface as well. Otherwise it might not know how to parse it and crash on arbitrator clients, preventing them from properly judging a case.

The evidence display interface code of the Generalized TCR can be found at https://github.com/kleros/gtcr-injected-uis.

Other Scripts

  • yarn format - Lint, fix and prettify all the project.
  • yarn run cz - Run commitizen.
  • yarn run build - Create a production build.

Netlify Deployment

When setting up the repo for publishing on netlify:

  1. Fill the env variables in netlify.toml;
  2. Set the following environment variables on the site's build config in netlify's dashboard:
REACT_APP_RPC_URLS
REACT_APP_FORMATIC_API_KEYS
REACT_APP_NOTIFICATIONS_API_URL

gtcr's People

Stargazers

 avatar  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

gtcr's Issues

Lock and use meta evidence from request.

The contract should be updated to lock the meta evidence used for the request such that an update to the meta evidence doesn't change the terms of previous requests.

Update the UI to account for this.

Respond to network and provider changes.

  • Inform the user to which network he is connected to in order to avoid sending transactions to the wrong network.
  • If the network changes (due to for example, the user connecting his wallet), the UI should attempt refetching the item(s) on the new context.

Add Badge

  • Display an "Add Badge" button in the item details view of the item, if the Related TCR has at least one TCR registered.
  • Clicking the button should open a modal, with a list of options. Each option is a TCR registered on Related TCR.
  • Selecting a TCR and clicking "Add Badge" should open a modal to submit the item to the Badge TCR, with the known fields pre-filled.

TCR factory final deployment step UI

After having deployed a TCR, the UI seems to be stuck on this screen:

image
1- As a user I expect the step 4 to be ticked and not to be able to deploy the same TCR right away.
2- When I connect at a later time I am still facing this same screen but i would expect a fresh screen with the history of what I already deployed.
3- Previous deployments list should also be in a human readable format if possible: if a user has several TCR deployed, it is a pain to know which transaction is related to which TCR and enabled TCR badges.
See after only 2 deployments:

image

Protect users from submitting non-GTCR addresses to a TCR of TCRs

Currently, a use might want to submit the address of a TCR that does not implement the current GTCR API to a TCR of TCRs.

We should probably rename it "GTCR of GTCRs" and verify that the address provided by the user actually refers to the code of a GTCR instance.

Otherwise a user might attempt submitting the Doges on Trial or the T²CR to the list and loose money.

Fix Item Sorting

Currently, the GTCRView contract scans the registry from either the start or the end of the list based on the oldestFirst parameter. The UI then sorts the result to display items with pending requests first.

This is a problem, however. We want items with pending requests to be listed first. Only then we sort by time of submission. Otherwise someone can place a removal request on a very old item and no one would notice.

Tasks:

  • Edit the GTCR contract to emit a RequestSubmitted event every time someone makes a request.
  • Edit the UI to fetch the latest latest RequestSubmitted events (in parallel to the GTCRView.queryItems request). With the IDs of the items, fetch their status in parallel.
  • Add the items with pending requests to the result set and sort.

Display Badges on Item Details View

The item details view should include a component that queries all TCRs registed on the Related TCR with the item's data. If the items are found, a display a badge with theTCR symbol.

Improve description of the "item name" field in the factory

When the user navigates to the TCR, he would see it in components of the UI: "Submit Meme, Remove Meme, Challenge Meme" etc

It shows up in notifications as well, emails and twitter "A meme you submitted to NEC - Storytelling was challenged!"

TCR Navigation breaks items view

If I navigate using a router link, the items component doesn't load the items. Additionally, actions are sent to the incorrect TCR, resulting on an exception.

Factory: Arbitrator field default value explanation

In this hover, although the arbitrator address is already filled in, we may want to add a little text stating something like ‘ This already points to Kleros as the arbitrator’ just to specify cases are already going to Kleros court.

Implement notifications

The top bar should include a notifications icon.

Deploy a registry contract to map the user's address to the TCRs he's interacted with.
Deploy a proxy contract to batch what would be 2 transactions into one. Any transactions sent to a TCR contract should be sent to the proxy contract. The proxy contract forwards the call to the TCR and if the call does not revert, saves the interaction interactions[caller].push(tcr)
Fetch the addresses of the TCRs the user interacted with.
Fetch ItemSubmitted, Evidence, AppealContribution events of each TCR to find items the user submitted, challenged, submitted evidence to or contributed with appeal fees.

The initial proposal would not provide a good UX as it relies on saved information on the client. So a user would receive the same notification more than once across devices, or would miss notifications if it is the first time accessing the app on a new client.

Instead, we provide a backend where notifications are stored at kleros/gtcr-notifications.

Timestamping every entry of item details

A nice enhancement would have to get a timestamp for each historic detail of items:

image
It would make sense to know when each entry has occurred:
"Item Submitted", "Item rejected", etc...

Update crowdfunding card

The crowdfunding card lacks important UI features and looks bland. Display:

  • Progress bars;
  • The potential reward for funding this either side on this round;
  • Use icons.

Mainnet Beta Deployment

Setup GTCR on mainnet beta for the story telling bounty

  • Add a warning "This is beta software/there is a bounty on this code" + option: "Don't remind me again"
  • Point all bots to mainnet deployment.
  • Write a submission policy

Add Badge fields to factory

To allow badges on the GTCR, we add new features to the factory:

  • Allow setting a TCR logo. This will be displayed as the badge symbol on other TCRs.
  • Add a new step to the factory. This step should allow the user to set the parameters of the related TCR: Primary document, challenge period, deposits etc.

TCR Factory: Add "TCR of TCRs" switch.

If this switch is marked as true:

  • Skip the step of selecting the columns. The only column will be the TCR address (of type GTCR Address).
  • Item cards should fetch and display the TCR metadata. (e.g. The TCR logo, name and description).

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.