Skip to content

rootprojectco/backend

Repository files navigation

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: info@rootproject.co

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