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

deterministic-proxy-deployment

v1.0.4

Published

An Ethereum proxy contract that can be used for deploying contracts to a deterministic address on any chain.

Downloads

2

Readme

Deterministic Deployment Proxy

This is a proxy contract that can be deployed to any chain at the same address, and can then in turn deploy any contract at a deterministic location using CREATE2. To use, first deploy the contract using the one-time-account transaction specified in output/deployment.json (or grab last known good from bottom of readme), then submit a transaction to the address specified in output/deployment.json (or grab last known good from bottom of readme). The data should be the 32 byte 'salt' followed by your init code.

Usage

npm install
npm run build
./scripts/test.sh

Details

See scripts/test.sh (commented). Change JSON_RPC environment variable to the chain of your choice (requires an unlocked wallet with ETH). Notice that the script works against any chain! If the chain already has the deployer contract deployed to it, then you can just comment out the deployment steps (line 20 and 23) and everything else will still function as normal. If you have already deployed your contract with it to the chain you are pointing at, the script will fail because your contract already exists at its address.

Explanation

This repository contains a simple contract that can deploy other contracts with a deterministic address on any chain using CREATE2. The CREATE2 call will deploy a contract (like CREATE opcode) but instead of the address being keccak256(rlp([deployer_address, nonce])) it instead uses the hash of the contract's bytecode and a salt. This means that a given deployer address will deploy the same code to the same address no matter when or where they issue the deployment. The deployer is deployed with a one-time-use-account, so no matter what chain the deployer is on, its address will always be the same. This means the only variables in determining the address of your contract are its bytecode hash and the provided salt.

Between the use of CREATE2 opcode and the one-time-use-account for the deployer, we can ensure that a given contract will exist at the exact same address on every chain, but without having to use the same gas pricing or limits every time.


Latest Outputs

Note: as of last readme update; don't trust these to be latest!

It is known to have been deployed to: Ropsten test-net

Proxy Address

0x4e59b44847b379578588920ca78fbf26c0b4956c

Deployment Transaction

0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222

Deployment Signer Address

0x3fab184622dc19b6109349b94811493bf2a45362

Deployment Gas Price

100 nanoeth (gwei)

Deployment Gas Limit

100000

Note: The actual gas used is 68131, but that can change if the cost of opcodes changes. To avoid having to move the proxy to a different address, we opted to give excess gas. Given the gas price, this may result in notable expenses, but since this only needs to be deployed once per chain that is acceptable.