GithubHelp home page GithubHelp logo

takertao2 / token-request-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opiumprotocol/token-request-app

0.0 1.0 0.0 32.46 MB

Aragon app that allows someone to request native tokens from a DAO in exchange for another token

License: GNU General Public License v3.0

Solidity 13.62% HTML 0.11% JavaScript 86.27%

token-request-app's Introduction

Token Request

CircleCI Coverage Status

1Hive's Token Request app allows users to create a vote which requests an Organization's tokens in exchange for payment. For example a user may request minting 100 organization tokens in exchange for 100 DAI. The request would require a vote to approve, if the vote is rejected the user would receive their payment back and if it is approved the payment would be deposited in the organization's vault.

๐Ÿšจ Security review status: Contracts audited

How does it work

The Token Request App should be granted the Create Votes permission on an instance of the Aragon Voting app. When a user makes a request they should transfer the payment to the Token Request app which will hold them in escrow while the vote is created and executed. If the vote duration passes and the payment is still in the Token Request app, the user should be able to claim their tokens. If the vote passes then executing the vote should transfer the users tokens from the Token Request app to the organizations vault, and mint tokens from the token manager for the user.

Initialization

The token request app is initialized by passing the address of a token manager instance, the address of a _vault instance, and an array of addresses _acceptedDepositTokens. The _acceptedDepositTokens array must be less than the MAX_ACCEPTED_DEPOSIT_TOKENS variable which is set to 100.

Roles

The Token Request application should implement the following roles:

  • Finalise token requests
  • Change Vault Address
  • Change Token Manager Address
  • Add/remove offered tokens to/from the accepted offered token list

Interface

We do not need to provide an interface for changing parameters as this can be done by power users using the aragonCLI.

The interface allows users to request tokens, where they would specify the amount and the associated payment. It also allows for withdrawing their requests at any time.

For a detailed view of the flow of the app check out our user-guide

How to run Token Request app locally

First make sure that you have node, npm, and the aragonCLI installed and working. Instructions on how to set that up can be found here. You'll also need to have Metamask or some kind of web wallet enabled to sign transactions in the browser.

Git clone this repo.

git clone https://github.com/1Hive/token-request-app.git

Navigate into the token-request-app directory.

cd token-request-app

Install npm dependencies.

npm i

Deploy a dao with Lock app installed on your local environment.

npm run start:template

How to deploy to an organization

Token Request app has been published to APM on Mainnet and Rinkeby at token-request.aragonpm.eth

To deploy to an Aragon DAO you can use the Aragon CLI.

aragon dao install <dao-address> token-request.aragonpm.eth --app-init-args <vault-address> <token-manager-address>

Contributing

We welcome community contributions!

Please check out our open Issues to get started.

If you discover something that could potentially impact security, please notify us immediately. The quickest way to reach us is via the #dev channel in our team Keybase chat. Just say hi and that you discovered a potential security vulnerability and we'll DM you to discuss details.


token-request-app's People

Contributors

rperez89 avatar fabriziovigevani avatar willjgriff avatar yeqbfgxjiq avatar 0xgabi avatar lkngtn avatar sembrestels avatar

Watchers

James Cloos 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.