@1hive/oracle-token-balance 中文文档教程

发布于 3年前 浏览 23 更新于 3年前

Token Oracle

Token Oracle 应用程序是一个 ACL Oracle。 ACL Oracle 是插入 Aragon 的访问控制列表 (ACL) 以执行更复杂的权限评估的小型辅助函数。 在 Dandelion Orgs 的上下文中,Token Oracle 用于检查一个地址是否持有 Dandelion Org 令牌,因此是否是该组织的成员。 这是通过在 Token Oracle 中设置最低要求余额来完成的。 然后,当一个帐户提交对 Aragon 应用程序功能执行操作的意图时,其 ROLE 受此 Oracle 保护,ACL 将与 Oracle 检查该帐户是否具有所需的最小令牌余额。 Token Oracle 将返回一个布尔值,可用于批准或拒绝意图。

Security review status: Contracts frozen for audit as of commit a9ae2edf9d7654b5a5b8135f49d081dc229c4d30

此 repo 中的代码未经审计。

How does it work?

Token Oracle 应用程序使用 ERC-20 令牌的地址和最低余额进行初始化。 它具有这两个参数的设置器。 然后其他应用程序可以通过 ACL“查询”Token Oracle 以确定帐户是否至少具有 Token Oracle 正在跟踪的令牌的最小余额。

Initialization

Token Oracle 使用 address _tokenuint256 _minBalance 参数进行初始化。

  • The address _token parameter is the address of the token that Token Oracle is to track.
  • The uint256 _minBalance is the minimum balance of address _token that an account needs to hold.

Roles

Token Oracle 应用程序应实现以下角色:

  • SETTOKENROLE: This allows for changing the token address that the Token Oracle tracks.
  • SETMINBALANCE_ROLE: This allows for changing the threshold at which the Token Oracle returns a true or false boolean.

Interface

Token Oracle 没有接口。 它意味着作为 Aragon 应用程序的后端帮助函数来执行更复杂的权限评估。

How to run Token Oracle locally

Token Oracle 与其他 Aragon 应用程序协同工作。 虽然我们没有将此功能作为独立演示进行探索,但Dandelion Org 模板 使用令牌 Oracle,它可以运行本地。

Deploying to an Aragon DAO

TBD

Contributing

我们欢迎社区贡献!

请查看我们的未解决的问题以开始使用。

如果您发现可能影响安全的事情,请立即通知我们。 联系我们的最快方式是通过我们的team Keybase chat 中的#dev 频道。 只要打个招呼,你发现了一个潜在的安全漏洞,我们就会私信给你讨论细节。

Token Oracle

The Token Oracle app is an ACL Oracle. ACL Oracles are small helper functions that plug in to Aragon's access control list (ACL) to do more sophisticated permission evaluation. In the context of Dandelion Orgs, the Token Oracle is used to check if an address holds Dandelion Org tokens and is thus a member of the organization. This is done by setting a minimum required balance in the Token Oracle. Then when an account submits the intent to perform an action on an Aragon app function whose ROLE is protected behind this Oracle, the ACL will check with the Oracle if the account has the minimum balance of tokens required. The Token Oracle will return a boolean which can be used to either approve or reject the intent.

???? Security review status: Contracts frozen for audit as of commit a9ae2edf9d7654b5a5b8135f49d081dc229c4d30

The code in this repo has not been audited.

How does it work?

The Token Oracle app is initialized with the address of an ERC-20 token and a minimum balance. It has setters for both of these parameters. Other applications can then "query" through the ACL, the Token Oracle to determine if an account has at least the minimum balance of the token that the Token Oracle is tracking.

Initialization

The Token Oracle is initialized with address _token and uint256 _minBalance parameters.

  • The address _token parameter is the address of the token that Token Oracle is to track.
  • The uint256 _minBalance is the minimum balance of address _token that an account needs to hold.

Roles

The Token Oracle app should implement the following roles:

  • SETTOKENROLE: This allows for changing the token address that the Token Oracle tracks.
  • SETMINBALANCE_ROLE: This allows for changing the threshold at which the Token Oracle returns a true or false boolean.

Interface

The Token Oracle does not have an interface. It is meant as a back-end helper function for Aragon applications to perform more sophisticated permissions evaluation.

How to run Token Oracle locally

The Token Oracle works in tandem with other Aragon applications. While we do not explore this functionality as a stand alone demo, the Dandelion Org template uses the Token Oracle and it can be run locally.

Deploying to an Aragon DAO

TBD

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.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文