https://github.com/alincode/fitbit-dapp
https://github.com/alincode/fitbit-dapp
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/alincode/fitbit-dapp
- Owner: alincode
- License: mit
- Created: 2018-08-14T17:08:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T17:00:15.000Z (over 7 years ago)
- Last Synced: 2025-07-03T19:06:41.230Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://alincode.github.io/fitbit-dapp
- Size: 2.17 MB
- Stars: 0
- Watchers: 1
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fitbit Dapp
**learning resource**
* [Oraclize Documentation](https://docs.oraclize.it/#ethereum-quick-start-simple-query)
* [slides - Introduction to fitbit dapp by alincode](https://slides.com/alincode/fitbit-dapp-intro/fullscreen)
* [slides - Introduction to oraclize by alincode](https://slides.com/alincode/oraclize201810#/)



## Run it
```
npm i
npm start
```
## build & publish
```sh
npm run build
git add -A && git commit -m "bundle"
git push
```
### Player
* signup
you need to wait 2~3 minute, until oraclize callback. then you could see you are signed.
* playerRefund
if contest end over 3 days, but the owner still not end the contest, the user could click refund button, then get money back.
```
struct Player {
address addr;
uint amount;
string userId;
uint createdAt;
uint beginStep;
uint endStep;
bool refunded;
string encryptHeader;
}
```
### Funder
* fund: funder could fund many times, second time will update amount and name.
```
struct Funder {
address addr;
uint amount;
uint createdAt;
string name;
}
```
### Owner
* Step1: contestDone
it will update all user end step and save the doneAt.
* Step2: award
if will check doneAt, make a sure, you already waiting for 10 minutes. then you can call this function.
it will count all winner and award money to winner.