Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FC: GitHub API Oraclize #3

Open
3esmit opened this issue Mar 6, 2017 · 3 comments
Open

FC: GitHub API Oraclize #3

3esmit opened this issue Mar 6, 2017 · 3 comments

Comments

@3esmit
Copy link

3esmit commented Mar 6, 2017

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/

image

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.

@keorn
Copy link

keorn commented Mar 8, 2017

Sounds great to me!

@jdetychey
Copy link

Nice indeed! It seems like it could not be exploited by using someone else's github link as the address to send KETH to is written in the gist. I'd love to see the rest though as from my experience this sort of scheme are kind of hard to secure. It's possible to totally impeach attacks though, notably by using ecrecover to give signed authorization tokens.

@3esmit
Copy link
Author

3esmit commented Mar 17, 2017

Currently I'm working on GitHubOracle, that may be forked to a permissioned design with different rules of withdraw, as kovan paying for all fees for GitTokens claiming that can withdraw from a KETH faucet bank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants