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

@1-dao-protocol/juice-delegates-registry

v1.0.2

Published

## Summary Provide an easy to access function linking Juicebox protocol pay and redemption delegate with their respective deployer address. This registry use create and create2 to, based on a deployer address and a nonce, generate a deterministic address

Downloads

6

Readme

Juice Delegates Registry

Summary

Provide an easy to access function linking Juicebox protocol pay and redemption delegate with their respective deployer address. This registry use create and create2 to, based on a deployer address and a nonce, generate a deterministic address for a delegate. This address is then used as a key to store the deployer address (after sanity check).

Design

Flow

After deploying a delegate, any addresses can call registry.addDelegate(address deployer, uint256 nonce) to add it. The registry will compute the corresponding delegate address, check if it is a valid delegate and add it. Alternatively, addDelegateCreate2(address _deployer, bytes32 _salt, bytes calldata _bytecode) can be used to add delegate deployed from a contract, using create2.

The frontend might retrieve the correct nonce, for both contract and eoa, using ethers provider.getTransactionCount(address) or web3js web3.eth.getTransactionCount just before the delegate deployment (if adding a delegate at a later time, manual nonce counting might be needed). Create2 salt is based on the delegate deployer own internal logic while the deployment bytecode can be retrieved in the deployment transaction (off-chain) or via abi.encodePacked(type(delegateContract).creationCode, abi.encode(constructorArguments)) (on-chain)

Contracts/interface

  • JBDelegatesRegistry: the registry
  • IJBDelegatesRegistry; the registry interface

Usage

Anyone can deploy this registry using the provided forge script. To run this repo, you'll need Foundry and NodeJS installed.

First install the dependencies with:

  • yarn install && git submodule update --init --force --recursive

You should then be able to run the tests using:

  • forge test

Deploy a new registry using:

  • forge script Deploy (and the correct arguments, based on the chain and key you want to use - see the Foundry docs).

Use-case

This registry allows frontend to easily and trustlessly query the deployer behind a given delegate. This might then used to assume a delegate as "safe" or not, based on front-end opinion.

Risks & trade-off

A nasty delegate has a mint privilege access. It is therefore a key responsability to front-end providing informations to project owners and users on unintended/potentially adversarial behaviour, especially for unknow delegates.