animist-io / wallowa

Solidity contracts for Animist with tests, continuous integration and docs
http://animist.io
ISC License
2 stars 0 forks source link

wallowa

(Warning: Draft. Pre-alpha.)

This repo will house Solidity templates that target Animist IoT endpoints. Initial work is being done on a simple contract that allows contestants to participate in a wagered race from one endpoint to another.

Installation

$ npm install -g truffle
$ npm install -g ethereumjs-testrpc

To run test-rpc with 5 accounts that are preserved between sessions

$ ./bin/rpc.sh

Tests

$ truffle test

Race.sol Build Status

Draft. Incomplete (see issues).

Race.sol allows contestants commit stakes to a race and pay an Animist IoT node to authenticate their presence at specified start, finish and through points. If implemented in a mobile app the solidity file would serve as a template whose details are filled out, compiled and deployed on a race by race basis.

(See /resources/ProvidedRace.sol for an example of a race where a third party - an app producer/provider - manages transactions on behalf of racers)

Description

Contract Mechanics

Each step consists of:

a) Endpoint verification of racer presence (accomplished w/ the endpoints account)
b) Racer's request to the contract advance them a step. (Predicated by endpoint ver.)

After each step the contract checks to see if the racer has finished. If a racer has finished and the block they ended on has been mined, they may query the contract to see if they won and receive a reward.

Design Issues

To Do

Repo Goals: