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

global-factory

v0.0.2

Published

Contract factory for deterministic addresses on any chain

Downloads

279

Readme

global-factory CircleCI

Transform an Ethers contract factory into a deterministic factory.

How does this work

This utility will create a deterministic create2 deployer contract on any evm chain. This is done using a transaction from an account with an unknown private key. As a result the deployer contract can always be created, DOS attacks are not possible.

Because the deployer contract uses create2 and is guaranteed to always have the same address, any contracts deployed from this contract will have the same address.

Internally uses zoltu/deterministic-deployment-proxy.

Usage

npm i global-factory

Then use it in a deploy script like this:

const GlobalFactory = require('global-factory')

// Get the normal factory
const _factory = await ethers.getContractFactory('TestContract')
// Turn it into a global factory, the signer on the factory will be used
const factory = await GlobalFactory(_factory)
// define a factory with a custom signer like so
const factoryWithCustomSigner = await GlobalFactory(_factory, customSigner)
// Then deploy as usual
const contract = await factory.deploy(arg1, arg2)

If the contract already exists no deployment will occur and the existing instance will be returned. In this case the property deployTransaction will be null.

If the global deployer contract does not exist it will be deployed.

License

MIT