-
Notifications
You must be signed in to change notification settings - Fork 12
Description
I'm researching a optimal way of creating a faucet for GitHub users with Oraclize.
I think a easy way to do it is to user register account using a gist file containing his address.
oraclize_query("URL", strConcat("https://gist.githubusercontent.com/",_github_user,"/",_gistid,"/raw/"));
Register could check in API what is the age of the user
With a registered account, he can claim free KETH every day, based in his last page(s) IssueCommentEvent
oraclize_query("URL", strConcat("json(https://api.github.com/users/",_github_user,"/events/public?page=1).$[?(@.type="IssueCommentEvent")].[repo][name]"));
?(@.type="IssueCommentEvent") would filter only Issues comments, this is important to avoid star/unstar event.
See other events type: https://developer.github.com/v3/activity/events/types/
We could interate over an array this response and check how many events are in "known" repositories, previously registered by faucet owner.
For each known repository in this list, user would earn one point:
- 0-5: 1 KETH
- 5-10: 5 KETH
- 10-20: 10 KETH
- 20-30: 20 KETH
There is the option to check user organizations in https://api.github.com/users/$user/orgs and search for known public organizations, such as ethereum, ethcore, etc, this would give the user like 100 KETH.
Also, adding a middle-man to connect with API is a option to check more details and just answer the points to the contract.
I think is better to don't use a middle-man if possible, and try to relay only on oraclize, but then the options are limited and gas fees might be high.
