Skip to content

Commit 187b595

Browse files
author
Spencer Graham
authored
Merge pull request #2 from CommitPool/first-commit-contract
WIP: First commit contract
2 parents f9a545c + 576fe41 commit 187b595

17 files changed

+30398
-67
lines changed

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
1-
## Solidity Template
1+
## CommitPool Single Player Smart Contract repository
22

3-
To be used when building a new solidity project from scratch.
3+
4+
[CommitPool](http://commitpool.com/) helps people meet their personal goals by holding themselves accountable. CommitPool users stake money to credibly commit to meeting their goals, and lose their stake when they don’t.
5+
6+
Our MVP focuses on a single goal type for individuals, hence the Single Player mode.
7+
8+
## Getting started
9+
10+
Currently Ganache and Node 14 are not playing well together. To get started:
11+
12+
1. Use node 12 (using nvm is recommended)
13+
2. ```npm install```
14+
3. ```npm run-script build```
15+
4. ```npm test``` (to verify the build)
16+
17+
## Features
18+
19+
Single Player mode features:
20+
21+
- [x] Creation of Commitment
22+
- [ ] Management of Activities
23+
- [ ] Management of Measures
24+
- [x] Execution of commitment settlement
25+
26+
#### Creation of Commitment
27+
28+
A commitment consists of an ```activity```, a ```measure``` for given activity, a ```start time```, and ```stake```. We will set the ```end date``` 7 days after the startdate.
29+
30+
#### Management of Activities
31+
32+
An activity consists of a ```name```, a ```measure``` to express activity metrics, an array of accepted ```ranges```, and the ```oracle``` address. Activities can be enabled by setting it to ```allowed```.
33+
34+
For the Single Player mode ```biking``` is the only available activity, as declared in ```scripts/deploy.ts```
35+
36+
#### Management of Measures
37+
38+
A measure has a ```name``` and can be enabled by setting it to ```allowed```.
39+
40+
For the Single Player mode ```km``` is the only available measure, as declared in ```scripts/deploy.ts```
41+
42+
#### Execution of commitment settlement
43+
44+
The contract can be called to process the commitment based on the address of the committer. A check on time and completion determines whether the stake is returned to the committer.
45+
46+
## Architecture
47+
48+
![Architecture diagram of CommitPool](/documentation/architecture.png "Architecture diagram")
49+
50+
## Stack
51+
52+
This repository is a fork from [Paul Berg's Solidity Template](https://github.com/PaulRBerg/solidity-template)
53+
54+
## Get in touch
55+
56+
[commitpool.com](http://commitpool.com/)
57+
58+
59+
60+
Subscribe to our [Substack](https://commit.substack.com/)

buidler.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import "./tasks/clean";
99
import "./tasks/typechain";
1010

1111
usePlugin("@nomiclabs/buidler-waffle");
12+
usePlugin("@nomiclabs/buidler-ethers");
1213
usePlugin("solidity-coverage");
1314

1415
interface HDAccountsConfigExtended extends HDAccountsConfig {

contracts/Greeter.sol

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)