GithubHelp home page GithubHelp logo

rbharath / adchainregistry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adchain/adchainregistry

0.0 1.0 0.0 797 KB

adChain registry smart contracts

License: Apache License 2.0

JavaScript 100.00%

adchainregistry's Introduction

AdChainRegistry

Codeship Status for AdChain/AdChainRegistry

A token-curated registry listing the domains of high-quality web publishers with authentic human audiences.

Commands

Compile contracts using truffle

$ npm run compile

Run tests

$ npm run test

Run tests and log TestRPC stats

$ npm run test gas

Application Process

  1. A publisher calls apply() to create an application and puts down a deposit of AdToken. The apply stage for the application begins. During the apply stage, the application is waiting to be added to the whitelist, but can be challenged or left unchallenged.

    The application is challenged:

    1. A challenger calls challenge() and puts down a deposit that matches the publisher's.

    2. A vote starts (see Voter and Reward Process).

    3. After the results are in, the anyone calls updateStatus().

      If the applicant won, the domain is moved to the whitelist and they recieve a portion of the challenger's deposit as a reward. Their own deposit is saved by the registry.

      If the challenger won, their deposit is returned and they recieve a portion of the applicant's deposit as a reward.

    The application goes unchallenged:

    1. At the end of the apply stage, updateStatus() may be called, which adds their name to the whitelist. The applicant's deposit is saved and can be withdrawn when their whitelist period expires.
  2. To check if a publisher is in the registry, anyone can call isWhitelisted() at any time.

Rechallenges

  1. Once a domain is whitelisted, it can be re challenged at any time. To challenge a domain already on the whitelist, a challenger calls challenge() and puts down a deposit of adToken to match the current minDeposit parameter.

  2. If a whitelisted domain is challenged and does not have enough tokens deposited into the contract (ie a whitelist's current deposit is less than the minDeposit parameter), then the domain is automatically removed from the whitelist.

Publisher Interface

  1. Deposit() - if the minDeposit amount is reparametrized to a higher value, then owners of whitelisted domains can increase their deposit in order to avoid being automatically removed from the whitelist in the event that their domain is challenged.

  2. Withdraw() - if the minDeposit amount is reparametrized to a lower value, then the owners of a whitelisted domain can withdraw unlocked tokens. Tokens locked in a challenge may not be withdrawn.

  3. Exit() - the owner of a listing can call this function in order to voluntarily remove their domain from the whitelist. Domains may not be removed from the whitelist if there is an ongoing challenge on that domain.

Voter and Reward Process

  1. The vote itself is created and managed by the PLCR voting contract.

  2. Voters who voted on the losing side gain no reward, but voters who voted on the winning side can call claimReward() to claim a portion of the loser's (either the applicant's or the challenger's) deposit proportional to the amount of AdToken they contributed to the vote.

  3. No tokens are ever lost or burned because the reward pool of tokens is repartitioned every time claimReward() is called.

Reparameterization Process

  1. To propose a new value for a parameter, a user calls changeParameter() and puts down a deposit of AdToken with the parameter and the new value they want to introduce. A vote to make or disregard the proposed change is started immediately. The deposit will be returned to the user upon completion of the poll.

  2. After voters have committed and revealed their votes within the vote contract, anyone calls processProposal() to evaluate the results of the vote. Deposited tokens are returned to the user who proposed the parameter change. If the results show that the proposed change is approved, the parameter value in the params mapping is changed.

  3. To check the value of parameters, a user calls get() with the string keyword of the parameter.

adchainregistry's People

Contributors

irene-lin avatar kangarang avatar miguelmota avatar mzeitlin8 avatar skmgoldin avatar terryli0095 avatar yorhodes avatar

Watchers

 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.