@1hive/apps-redemptions 中文文档教程
Redemptions
1Hive 的赎回应用程序允许 Aragon 组织授予其代币持有人赎回代币的权利,以换取按比例分享的组织资产。
Project Stage: Rinkeby
Redemptions 应用程序已发布到 Rinkeby 测试网络上的 open.aragonpm.eth
。 如果您遇到任何问题或有兴趣参与贡献,请查看我们未解决的问题。
Security Review Status: Contracts updated for audit as of commit d61a3b9b419e154894f3dc2ac2eae291612c6519
此 repo 中的代码未经审计。
How to try Redemptions immediately
我们有一个 Redemptions demo DAO 在 Rinkeby 上直播!
How to run Redemptions locally
首先确保您有节点、npm 和 Aragon CLI安装和工作。 可以在此处找到关于如何设置的说明。 您还需要启用 Metamask 或某种网络钱包才能在浏览器中签署交易。
Git 克隆这个仓库。
git clone https://github.com/1Hive/redemptions-app.git
导航到 redemptions-app
目录。
cd redemptions-app
安装 npm 依赖项。
npm i
在您的本地环境中部署一个带有 Redemptions 的 dao。
npm run start:template
如果一切正常,您的新 DAO 将被部署,您的浏览器将打开 http://localhost:3000/#/YOUR-DAO-ADDRESS。 它应该看起来像这样:
您还将在终端中看到本地部署的配置。 它应该看起来像这样:
Ethereum Node: ws://localhost:8545
ENS registry: 0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1
APM registry: aragonpm.eth
DAO address: YOUR-DAO-ADDRESS
目前,您本地测试网上唯一部署的是带有 Redemptions 应用程序的 Aragon DAO。 在新终端中导航到 redemptions-app
目录。 然后运行此脚本在本地测试网上部署一些代币合约进行交互。
npm run deploy-tokens YOUR-DAO-ADDRESS
如果成功,您将已将 ANT、DAI、OMG 和 ETH 的合约部署到本地测试网。 然后,终端将在您的本地测试网上显示代币的名称及其地址。 它应该看起来像这样:
Token Address Balance
----- ------------------------------------------ -------
ANT 0x7F381a654914a4C865123B33fD8178efc0Ee5C2D 40
DAI 0xB5Cc76D092aA440087447EBD3A29E9E0b8A4bf9E 100
OMG 0x3d09CfCdD3136aaE7A4B26875A7BAcA0C3d8A03b 14189
ETH 0x0000000000000000000000000000000000000000 0.1
现在,如果您导航回您的浏览器 (http://localhost:3000/#/YOUR-DAO-ADDRESS),您将能够打开 Redemptions 应用程序并将这些令牌之一添加到您的本地部署的兑换应用程序。
How to deploy Redemptions to an organization
赎回已在 redemptions.open.aragonpm.eth
上发布到 rinkeby 上的 APM
要部署到组织,您可以使用 Aragon CLI。
aragon dao install <dao-address> redemptions.open.aragonpm.eth --app-init-args <vault-address> <token-manager-address>
兑换应用程序必须对 Vault
具有TRANSFER_ROLE
权限,对令牌管理器
具有BURN_ROLE
权限。
Contributing
我们欢迎社区贡献!
请查看我们的 [open Issues]() 以开始使用。
如果您发现可能影响安全的事情,请立即通知我们。 联系我们的最快方式是通过我们的team Keybase chat 中的#dev 频道。 只要打个招呼,你发现了一个潜在的安全漏洞,我们就会私信给你讨论细节。
Redemptions
1Hive's Redemptions app allows Aragon organizations to grant their token holders the right to redeem tokens in exchange for a proportional share of the organizations treasury assets.
???? Project Stage: Rinkeby
The Redemptions app has been published to open.aragonpm.eth
on the Rinkeby test network. If you experience any issues or are interested in contributing please see review our open issues.
???? Security Review Status: Contracts updated for audit as of commit d61a3b9b419e154894f3dc2ac2eae291612c6519
The code in this repo has not been audited.
How to try Redemptions immediately
We have a Redemptions demo DAO live on Rinkeby!
How to run Redemptions locally
First make sure that you have node, npm, and the Aragon CLI 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/redemptions-app.git
Navigate into the redemptions-app
directory.
cd redemptions-app
Install npm dependencies.
npm i
Deploy a dao with Redemptions installed on your local environment.
npm run start:template
If everything is working correctly, your new DAO will be deployed and your browser will open http://localhost:3000/#/YOUR-DAO-ADDRESS. It should look something like this:
You will also see the configuration for your local deployment in the terminal. It should look something like this:
Ethereum Node: ws://localhost:8545
ENS registry: 0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1
APM registry: aragonpm.eth
DAO address: YOUR-DAO-ADDRESS
Currently the only thing deployed on your local testnet is an Aragon DAO with the Redemptions app. In a new terminal navigate to the redemptions-app
directory. Then run this script to deploy some token contracts on your local testnet to interact with.
npm run deploy-tokens YOUR-DAO-ADDRESS
If successful, you will have deployed contracts for ANT, DAI, OMG, and ETH to your local testnet. The terminal will then display the names of the tokens and their addresses on your local testnet. It should look something like this:
Token Address Balance
----- ------------------------------------------ -------
ANT 0x7F381a654914a4C865123B33fD8178efc0Ee5C2D 40
DAI 0xB5Cc76D092aA440087447EBD3A29E9E0b8A4bf9E 100
OMG 0x3d09CfCdD3136aaE7A4B26875A7BAcA0C3d8A03b 14189
ETH 0x0000000000000000000000000000000000000000 0.1
Now if you navigate back to your browser (http://localhost:3000/#/YOUR-DAO-ADDRESS) you'll be able to open the Redemptions app and add one of these tokens to your locally deployed Redemptions app.
How to deploy Redemptions to an organization
Redemptions has been published to APM on rinkeby at redemptions.open.aragonpm.eth
To deploy to an organization you can use the Aragon CLI.
aragon dao install <dao-address> redemptions.open.aragonpm.eth --app-init-args <vault-address> <token-manager-address>
The Redemptions app must have the TRANSFER_ROLE
permission on Vault
and the BURN_ROLE
permission on the Token Manager
.
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.