Code Monkey home page Code Monkey logo

kips's People

Contributors

david-sg avatar istoramandiri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kips's Issues

change network to Kovan test

does anyone here knows why I cant switch to kovan network with this code?
const switchKovanNetwork = async () => {
try {
await window.ethereum.request({
method: "wallet_switchEthereumChain",
params: [{ chainId: "0x42" }],
});
} catch (switchError) {}
}

FC: GitHub API Oraclize

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.

More Accessible Automated Faucet

Some ideas

  • Public Faucet w/ CAPTCHA (for beta testers who are not devs, for making transactions) -> 1 KETH, rate limited to 60 requests per hour (w/ queue)
  • Github OAuth (with approval from validators) -> 5 KETH / Day

MetaMask Trouble

Ive developed an easy dontaion web app using Kovan. Lastly, ive added chain check, allowing only Kovan. When someone is on another chain, i just suggest to change chain with:
window.ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: '0x2A' }],
});
Here comes the problem: it works, but the logo on MetaMask is a question point, but it is supposed to be full purple.
Everything works great and it does not even ask to add a new chain, it looks like theres two linked Kovan testnet: they are two, but work as one.
Ive tried with couple other chains and they dont have the same issue.

(Here working test to check on your own: http://nonnopinto.altervista.org/)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.