Giter Club home page Giter Club logo

backend's Introduction

RootProject Contracts pre-alpha v0.1

RootProject is a crowdfunding platform for social projects powered by a crypto currency.

Website: https://rootproject.co Telegram: https://t.me/Rootproject E-mail: [email protected]

Smart Contracts

Smart Contract I: ProjectValidation - under construction.

Smart Contract II: PensionFundRelease - the "medium-term pension fund", as described in the RootProject whitepaper. The contract freezes funds for a custom period of time, and releases funds continously after the approval of validators.

Specification

Methods

vote

function vote(bool approve, string justification) onlyValidator returns (uint index)

Generates a vote for the fund to release or burn, and it's justification.


isReleaseApproved

function isReleaseApproved() constant returns (bool approved)

Checks if release approved by all validators.


isBurnApproved

function isBurnApproved() constant returns (bool approved)

Checks if burn approved by all validators.


getPaymentAmount

function getPaymentAmount() constant returns (uint amount)

Executes payment calculation.


balance

function balance() constant returns (uint amount)

Returns current fund balance in ROOTs.


releaseRoots

function releaseRoots() returns (uint releasedAmount)

Executes fund release.


Events

Voted

event Voted(bool approve, address validator, string justification)

Triggered when new vote is deployed.


Released

event Released(uint amount, address worker)

Triggered when fund is released.


Requirements

General:

  • Node.js v7.6.0+
  • truffle v3.2.2+
  • testrpc v3.0.5+

Requirements installation steps:

  • npm install -g truffle ethereumjs-testrpc
  • npm install
  • truffle install

Testing

To run the test, execute the following commands from the project's root folder:

  • testrpc &> /dev/null & npm test

Collaborators

License

All smart contracts are open source and distributed under the GNU GPL v.3

backend's People

Contributors

akraminkin avatar frostiq avatar poznyakbogdan avatar quazia avatar shkafcoupe avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backend's Issues

Fix releaseRoots function

We need to fix releaseRoots in such way, that should release roots if all conditions met will pass.
One of the things that we need to do for this, is to change deployment chain in tests and to add some tokens on to the PensionFundRelease account

Implement recurrent payments

For now, only first payment can be released.
You will need to add logic for recurrent payments:

  • After the first payment is released, all consecutive payments must be allowed only after reccurentPaymentInterval + lastPaymentTime.
  • The amount of every consecutive payment must be less or equal to reccurentPaymentPercent% of the initial ROOTS amount
  • Recurrent payments must occur till all the ROOTS will be released

The feature must be fully covered by tests

Project Validation contract

The contract must allow performing next workflow:

  • ROOTs tokens are deposited into a Project smart contract by the creator of the contract.
  • Those funds will be sent to the worker’s “Pension Fund” only if “Validators” sign the contract.
  • Both the Project Manager’s and Project Starter’s signature are required to confirm the project’s completion.
  • Should one of them fail to sign the contract or report that the project does not meet the requirements, a RootProject Independent Checker gets sent to assess the project’s status.
  • The Independent Checker has the “master signature” and can overrun the Project’s Manager’s and Starter’s decision.
  • ROOTs are sent either to the worker’s “Pension Fund” smart contract, or back to contributors should the project fail to be completed

The contract has no specific date. Funds breakdown - 2/3 is tokenized dollars, 1/3 is ROOTS token. 2 validators approve - project manager + campaign starter. If both approve - tokenized dollars go to worker’s wallet immediately, the ROOTS go to the pension fund smart contract.

If one person disagrees or is idle - freeze contract, masterkey by RootProject (this can be implemented in the future)

https://github.com/rootprojectco/backend/wiki

Integrate JS linter

The linter must ensure that:

  • Arrow functions must be used instead of regular functions, where possible
  • let must be used instead of var, where possible
  • ; must be omitted, where possible
  • any other reasonable rule

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.