A *simple* implementation of token curated registries.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contracts
migrations
test
.gitattributes
.gitignore
LICENSE
package-lock.json
package.json
readme.md
truffle-config.js
truffle.js

readme.md

Simple Token Curated Registry Implementation

Most of the code for this Token Curated Registry implementation is derived from the generic TCR implementation from Mike Goldin (and the adChain team).

This implementation strips out most of the details and only keeps the basic TCR functionality. Consider this to be the "hello world" for TCR implementation.

Why this implementation?

This TCR implementation is for getting a basic understanding of community driven curation using TCRs. While the generic implementation is comprehensive and elegant, it is also too advanced to be used for understanding basic token based curation functions. This simpler implementation strips out all advanced and complex functions and configuration parameters and only includes the basic curation functions - apply, challenge, vote, resolve, claim rewards.

What's making it simple?

To keep this TCR implementation simple, following functions and components are not implemented or included.

  1. PLCR voting - Instead of using PLCR voting, we are using just a list of polls and votes. There is no revealing of votes at a later stage. All votes are revealed by default.
  2. Configurable parameters - All TCR parameters are hard-coded. Also, only a subset of parameters are used (min deposit, apply stage length, commit stage length).
  3. Hard-coded rewards formula - The rewards calculation formula for all challenges is the same and is hard-coded as we are not using dispensation percentage and vote quorum parameters.
  4. Only basic curation functions are implemented. Exits, deposit reduction, etc. are not implemented.

When all this is left out, what's still in there?

Good question!

The following simple flow is implemented here,

  1. Initialize a TCR with a token
  2. Apply for a listing
  3. Challenge an applied/whitelisted listing
  4. Vote on a challenge (without commit-reveal)
  5. Update status of a listing (resolve challenge)
  6. Claim rewards after a challenge is resolved (based on a hard-coded formula)

This basic flow helps understand the power of community driven curation using TCRs.

Structure

The repository follow the structure of a regular truffle app created using truffle init. The contracts directory has two contracts - token and tcr. The token contract is default ERC20 contract and the tcr contract has what's described in the sections above. The test directory has positive unit tests for both contracts.

Important Note

This TCR implementation is only for demo purposes. The solidity smart-contracts in this repository are not audited or verified and they should not be used in real scenarios.

For real world (production) usage, please refer to the generic TCR implementation from Mike Goldin which is also being used in the adChain registry.