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

address-list

v0.9.10

Published

address list smart contract

Downloads

7

Readme

Action Status

address-list

Summary

This is a simple list of admin-controlled addresses, forming an

        (address -> uint256 metadata)

on-chain mapping data type.

Install

npm i address-list --save

How to use

// MyContract.sol
contract MyContract {
    IAddressList public immutable list;
    constructor() public {
        // Use latest factory contract address from ./deploy/*/contracts.json 
        IAddressListFactory addressFactory =
            IAddressListFactory(0xD57b41649f822C51a73C44Ba0B3da4A880aF0029);
        list = IAddressList(addressFactory.createList());
    }
  
}

Overview

The primary uses include governance, on-chain security, creating on-chain filtering lists, or creating contract<->contract proxy routes. A key motivation was mirroring the off-chain Token Lists with similar on-chain infrastructure.

Anybody may create and administer their own token list ("AddressList"), using a provided factory contract.

Beyond the usual whitelist filtering, on-chain token lists can be used to publish personal token lists, a list of all tokens in the Compound, Synthetix or Yearn universe, and more.

Features

  • Fast
  • O(1) queries, addition and removal
  • Admin-specified metadata value associated with each address. uint256. Cannot be zero.
  • Role-based access control (RBAC), to separate list admin duties from list owner.

Metadata

As described in the summary, an AddressList is an on-chain (address,uint256) mapping utility.

In the simple case, the metadata value is set to one (1), to indicate presence in the set of addresses.

In more complex examples, this can be used in forwarding and proxy scenarios as an on-chain (address,address) mapping, or even an on-chain (uint256,address) mapping if you don't mind a few ugly casts.

The only requirements are that both key (address) and value (uint256) must be non-zero.

Role in governance

One use case for AddressList is as a administered list, for an otherwise decentralized system. For example, a permissionless asset management system, with no owner, that relies on a administered token whitelist provided by AddressList. The gateway into this example system is provided by an administrative multi-sig or DAO managing a list of token addresses.

Administration

Token lists are administered by a list administrator, so delegated to the LIST_ADMIN role. This is initially the contract owner - the Ethereum account that called the factory contract.

See the OpenZeppelin RBAC documentation for further information about administering roles.