/contracts-smart-escrow

Solidity smart contracts for "smart escrow" service

Primary LanguageJavaScript

Smart-escrow contracts

Baked with <3 by Jincor

Smart-escrow

This contract should receive money from investors(crowdsale) and control phased money spendings raised during token sale by the team. Each next tranche of ETH to the team is allowed only after approval of previous phases by the team with the documents and according to the roadmap.

Settings:

  1. Voting round length(start time, end time)
  2. Min number of tokens required to participate in round
  3. Percent of positive votes required to succeed(calculated based on fact amount of voters)
  4. Voting reason
  5. Message
  6. Value < this.balance

New voting round can be initiated from admin panel. New vote round can be initiated only after approval documentation uploaded

If round succeed we must send the corresponding value of ETH to the team. If failed - ETH should be available to withdraw by token holders R = (ETH / A) * V .

R - reward

ETH - amount of ETH tranche Value

A - total supply of all tokens

V - amount of tokens on holders balance

Contract architecture

We tried to develop as simple and flat contract as we can. Contract hierarchy

How to setup development environment and run tests?

  1. Install docker if you don't have it.
  2. Clone this repo.
  3. Run docker-compose build --no-cache.
  4. Run docker-compose up -d.
  5. Install dependencies: docker-compose exec workspace yarn.
  6. To run tests: docker-compose exec workspace truffle test.
  7. To merge your contracts via sol-merger run: docker-compose exec workspace yarn merge. Merged contracts will appear in merge directory.