Giter Site home page Giter Site logo

ethsingapore's Introduction

(Status.im [ETH -> Kyber -> DAI])

I'm not stable, but my DAI is. The aforementioned reason is a fantastic argument for being able to instantly swap your ETH into DAI and send it to a contact. Within Status.im, currently it's only possible to send your contacts assets that you already hold, but with the same number of transactions you could send them anything which has an ETH pair on Kyber.

Sending an asset pegged to fiat within a chat context is a use-case that is tried, tested and proved.

My hackathon submission is comprised of two pieces:

  • Tiny proxy contract in front of Kyber Network's proxy (proxy.sol)
  • Status extension (extension.txt)

The function of each is described below.

## proxy.sol

Kyber network's own contracts currently allow you to purchase a token with ETH by directly sending ETH to the proxy contract. The proxy does not however allow us to forward the resulting token to an address that we do not control. For this reason, I have created a small contract which forwards the ETH and calls the correct function (tradeWithHint) in the Kyber Proxy, with a single additional argument - the address of the token receiver.

The result is exactly the same as calling the Kyber Proxy directly, except the token is immedietely delivered to the recipient.

(Search proxy gif and you get this bad ass chica)

extension.txt

The Status extension component of this submission was the most difficult, which is why I have added a funny gif to my solution. Please notice it senpai.

The extension allows you to execute the command /send-dai with a single argument: the amount of DAI that you wish to send to your contact. Upon execution, this command then fetches the price of DAI (in ETH) from the Kyber Proxy, performs some arithmetic (surprisingly difficult in Status 🙃) to craft and send the transaction.

The extension could be a lot better, but there are some reasonably large limitations in the extensions API.

DOOT DOOT

ethsingapore's People

Contributors

morelazers avatar

Watchers

James Cloos avatar srihari kapu avatar  avatar

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.