@1hive/apps-conviction-voting 中文文档教程
Conviction Voting
1Hive 的信念投票应用程序用于根据整个组织对提案的信念为提案分配资金。 可以通过在提案上抵押组织代币来表示信念,并且在经过一段时间后才会完全激活。
Project Stage: Rinkeby
Conviction Voting 应用程序已发布到 Rinkeby 网络上的 open.aragonpm.eth
。 如果您遇到任何问题或有兴趣参与贡献,请查看我们的未决问题。
Security Review Status: pre-audit
此存储库中的代码尚未经过审核。
How to run Conviction Voting app locally
Conviction Voting 模板需要使用 1Hive's Tokens app,因此请按照 README 中的说明部署该应用在本地开发链中。 许多开发链可以在同一台计算机中共存,请确保您将代币应用程序部署在将要部署定罪投票的同一开发链中。
要使用 Conviction Voting 应用程序,您只需执行以下操作:
npm install
npm start # It actually starts `npm run start:ipfs:run`
如果一切正常,您的新 DAO 将被部署并且您的浏览器将打开 http://localhost:3000/#/YOUR-DAO-ADDRESS。 像这样:
它应该看起来 conviction voting app">
注意:脚本 npm run start:ipfs:run
所做的是运行 npm run start:ipfs:template
,杀死 devchain,然后重新启动它15 秒的出块时间,因此我们可以看到信念随着时间的推移而增长。
How to deploy Conviction Voting to an organization
定罪投票已在 Rinkeby 上发布到 APM,地址为 conviction-voting.open.aragonpm.eth
。
具有最新功能的更新版本可在 conviction-beta.open.aragonpm.eth
要部署组织,您可以使用 Aragon CLI。
aragon dao install <dao-addr> conviction-voting.open.aragonpm.eth --app-init-args <org-token> <vault-addr> <funds-token> 9999599 2000000 20000 200000000000000000
这是您可以使用的初始化参数:
: The token address of the DAO's token. The supply for tokens with 18 decimals should not exceed 34,028,236,692, a supply bigger than that can cause errors (more details). : The DAO's main vault/agent address. It can be 0x0000000000000000000000000000000000000000
to set it up for conviction signaling (without money allocation).: The token address that is going to be allocated. The token must be in the vault/agent. It can 0x0000000000000000000000000000000000000000
to set it up for conviction signaling (without money allocation).- The rest of the parameters are:
decay = 0.9999599
, which sets up conviction halftime to 3 days.maxRatio = 0.2
, which sets the threshold formula to only allow proposals that request less than 20% of the funds.rho = 0.002
, which fine tunes the threshold formula.minThresholdStakePercentage = 0.2
, which sets the minimum percent of stake token active supply that is used for calculating the threshold
安装应用程序后,我们可以为任何人创建权限,以创建关于定罪投票的提案,以及用于定罪投票以从金库/代理转移资金的权限:
aragon dao acl create <dao-addr> <conviction-voting-app> CREATE_PROPOSALS_ROLE 0xffffffffffffffffffffffffffffffffffffffff <voting-app>
aragon dao acl create <dao-addr> <vault-app> TRANSFER_ROLE <conviction-voting-app> <voting-app>
Background
在 DAO 中分配资金的过程今天正在使用感觉非常笨重,通常需要独立评估一系列是/否票。 这些组织还面临许多挑战,例如 51% 攻击、低参与度,以及总体上无法有效地确定优先级和决定何时有许多潜在选项都在同时竞争考虑。
由 Commons Stack 和Block Science 提供了一个有趣的解决方案,与我们已经提出的其他方法相比,它感觉更有机、更像 DAO。
我们将信念投票作为 Aragon 应用程序的实施旨在用于从共享资金库中集体分配资金,或者在没有资金分配的情况下使用提案时发出优先级信号。
可以随时提交提案以供考虑,并且没有明确的过期时间。
用户一次可以为一个提案投票,当他们这样做时,他们的代币加权余额会增加对该提案的信心。 通过这种方式,我们可以认为对提案的投票有点像针对特定提案的信号发射,当信号移动时,需要时间才能完全到达新提案,同时信号的残余部分在信号源被重定向后的一段时间内,仍然可以在之前的提案中感受到。
只有积累了足够的信念,才能执行提案。 可以执行提案的阈值取决于请求的资金相对于共享资金库中可用资金的比例。 请求资金和可用资金之间的这种关系意味着可以执行提案的阈值取决于系统在任何给定时间的状态。 随着提案通过并从国库中移除资金,剩余的提案将变得更难通过(因为它们现在代表共享国库的更大比例),相反,随着新资金被添加到共享国库中,通过现有提案的门槛将减少。 这为组织相对于其收入的支出率提供了一些自然的自我调节。
基于时间的积累迫使选民优先考虑他们的信念,并可能鼓励成员更有效地达成双方都能接受的妥协,以最有效地利用他们对 DAO 资金分配的影响。
Structure
此应用程序具有以下结构:
root
├── app
├ ├── src
├ └── package.json
├── contracts
├ ├── ConvictionVoting.sol
├ └── Template.sol
├── migration
├── test
├── arapp.json
├── manifest.json
├── truffle.js
└── package.json
- app: Frontend folder. Completely encapsulated, has its own package.json and dependencies.
- src: Source files.
- package.json: Frontend npm configuration file.
- contracts: Smart Constracts folder.
ConvictionVoting.sol
: Aragon app contract.Template.sol
: Aragon Template to deploy a fully functional DAO.- migrations: Migrations folder.
- test: Tests folder.
- arapp.json: Aragon configuration file. Includes Aragon-specific metadata for your app.
- manifest.json: Aragon configuration file. Includes web-specific configurations.
- truffle.js: Truffle configuration file.
- package.json: Main npm configuration file.
Contributing
我们欢迎社区贡献!
请查看我们的未决问题以开始使用。
如果您发现可能影响安全的事情,请立即通知我们。 联系我们的最快方式是通过我们的team Keybase chat 中的#conviction-voting 频道。 只要打个招呼,你发现了一个潜在的安全漏洞,我们就会私信给你讨论细节。
Contributors
感谢这些优秀的人 (emoji key):
这个项目遵循 all-contributors 规范。 欢迎任何形式的贡献!
Conviction Voting
1Hive's Conviction Voting app is used to allocate funds on proposals based on the conviction an entire organization has on them. Conviction can be signaled by staking organization tokens on proposals, and it is not fully activated until a certain period of time has passed.
???? Project Stage: Rinkeby
The Conviction Voting app has been published to open.aragonpm.eth
on Rinkeby network. If you experience any issues or are interested in contributing please see review our open issues.
???? Security Review Status: pre-audit
The code in this repository has not been audited.
How to run Conviction Voting app locally
The Conviction Voting template requires the use of 1Hive's Tokens app, so please follow the instructions in the README to deploy the app in the local devchain. Many devchains can coexist in the same computer, make sure you are deploying the Tokens app in the same devchain that is going to be deployed Conviction Voting.
To use the Conviction Voting application, you can simply do:
npm install
npm start # It actually starts `npm run start:ipfs:run`
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:
NOTE: What the script npm run start:ipfs:run
does is running npm run start:ipfs:template
, kill the devchain, and reinitiate it with a block time of 15s, so we can see conviction growing over time.
How to deploy Conviction Voting to an organization
Conviction Voting has been published to APM on Rinkeby at conviction-voting.open.aragonpm.eth
.
A newer version with the latest functionality is available at conviction-beta.open.aragonpm.eth
To deploy an organization you can use the Aragon CLI.
aragon dao install <dao-addr> conviction-voting.open.aragonpm.eth --app-init-args <org-token> <vault-addr> <funds-token> 9999599 2000000 20000 200000000000000000
This are the initalization parameters you can use:
: The token address of the DAO's token. The supply for tokens with 18 decimals should not exceed 34,028,236,692, a supply bigger than that can cause errors (more details). : The DAO's main vault/agent address. It can be 0x0000000000000000000000000000000000000000
to set it up for conviction signaling (without money allocation).: The token address that is going to be allocated. The token must be in the vault/agent. It can 0x0000000000000000000000000000000000000000
to set it up for conviction signaling (without money allocation).- The rest of the parameters are:
decay = 0.9999599
, which sets up conviction halftime to 3 days.maxRatio = 0.2
, which sets the threshold formula to only allow proposals that request less than 20% of the funds.rho = 0.002
, which fine tunes the threshold formula.minThresholdStakePercentage = 0.2
, which sets the minimum percent of stake token active supply that is used for calculating the threshold
Once the app has been installed, we can create permissions for anybody to create proposals on conviction voting, and for conviction voting to transfer funds from the vault/agent:
aragon dao acl create <dao-addr> <conviction-voting-app> CREATE_PROPOSALS_ROLE 0xffffffffffffffffffffffffffffffffffffffff <voting-app>
aragon dao acl create <dao-addr> <vault-app> TRANSFER_ROLE <conviction-voting-app> <voting-app>
Background
The process of allocating funds in DAOs that are being used today feels very clunky, typically requiring a series of yes/no votes evaluated independently. These organizations also suffer from a number of challenges like 51% attacks, low participation, and overall inability to effectively prioritize and decide when there are many potential options all competing for consideration at once.
Conviction voting as proposed by Commons Stack and Block Science provides an interesting solution, that feels more organic and DAO-like than other methods we have seen proposed.
Our implementation of Conviction Voting as an Aragon application is intended to be used to collectively allocate funds from a shared treasury, or to signal priorities when used over proposals without money allocation.
Proposals can be submitted for consideration at any time and do not have an explicit expiration.
A user can vote for a single proposal at a time, when they do their token-weighted balance adds conviction to that proposal. In this way we can think of voting for a proposal a bit like the emission of a signal directed towards a specific proposal, when the signal is moved it takes time to fully arrive on the new proposal, and at same time the remnants of the signal can still be felt at the previous proposal for some time after the source of the signal has been redirected.
Proposals can be executed only if there is enough accumulated conviction. The threshold at which a proposal can be execute is dependent on the proportion of the funds requested relative to the available funds in the shared treasury. This relationship between the funds requested and available funds means that the threshold at which a proposal can be executed depends on the state of the system at any given time. As proposals pass and remove funds from the treasury, the remaining proposals will become harder to pass (because they now represent a larger proportion of the shared treasury), conversely, as new funds are added to the share treasury the threshold for passing existing proposals will decrease. This provides some natural self regulation to the spending rate of the organization relative to its income.
The time based accumulation forces voters to prioritize where they place their conviction and may encourage members to more effectively converge on a mutually acceptable compromise to most effectively leverage their influence on the DAOs fund allocations.
Structure
This app has the following structure:
root
├── app
├ ├── src
├ └── package.json
├── contracts
├ ├── ConvictionVoting.sol
├ └── Template.sol
├── migration
├── test
├── arapp.json
├── manifest.json
├── truffle.js
└── package.json
- app: Frontend folder. Completely encapsulated, has its own package.json and dependencies.
- src: Source files.
- package.json: Frontend npm configuration file.
- contracts: Smart Constracts folder.
ConvictionVoting.sol
: Aragon app contract.Template.sol
: Aragon Template to deploy a fully functional DAO.- migrations: Migrations folder.
- test: Tests folder.
- arapp.json: Aragon configuration file. Includes Aragon-specific metadata for your app.
- manifest.json: Aragon configuration file. Includes web-specific configurations.
- truffle.js: Truffle configuration file.
- package.json: Main npm configuration file.
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 #conviction-voting 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.
Contributors
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!