npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@1hive/oracle-token-balance

v2.1.0

Published

ACL Oracle enforcing token ownership

Downloads

27

Readme

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:

  • SET_TOKEN_ROLE: This allows for changing the token address that the Token Oracle tracks.
  • SET_MIN_BALANCE_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.