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

gemforge

v2.13.1

Published

Command-line tool for building, deploying and upgrading Diamond Standard contracts on EVM chains.

Downloads

146

Readme

Gemforge

Build NPM module

Command-line tool for building, deploying and upgrading Diamond Standard contracts on EVM chains.

Why

The Diamond Standard (EIP-2535) is one of the best ways to build and deploy infinite sized, upgradeable contracts.

But utilizing the standard involves having to write a lot of boilerplate code, including but not limited to the core diamond proxy contract, interface code to enable easy access for dapps, deployment code which calculates what facets to add and remove in each upgrade, etc.

Gemforge to the rescue!

By automating almost all aspects of this boilerplate code whilst still remaining highly configurable, Gemforge lessens the workload and saves time when developing with Diamond Standard.

Gemforge is already used in production.

Features

  • Auto-generates Diamond proxy code.
  • Auto-generates deployment code for Foundry tests.
  • Auto-calculates facet deployment and upgrades accurately and efficiently.
  • Deploy multiple instances to a single chain.
  • Clean existing deployments.
  • Records diamond addresses to JSON file for history tracking.
  • Pre- and post- hooks for both build and deploy steps.
  • Generates Foundry and Hardhat scaffolding.
  • Highly configurable per project.
  • Fully documented

See who is using Gemforge.

Installation

Node.js 20+ is required to run Gemforge. We recommend using nvm to handle different Node versions.

We recommend installing gemforge globally:

  • pnpm: pnpm add --global gemforge
  • npm: npm install --global gemforge
  • yarn: yarn global add gemforge

Usage

You can use gemforge --help to see what commands are available:

Usage: gemforge [options] [command]

Options:
  -V, --version               output the version number
  -h, --help                  display help for command

Commands:
  init [options]              Initialize a gemforge config file for an existing project.
  scaffold [options]          Generate diamond smart contract project scaffolding.
  build [options]             Build a project.
  deploy [options] [network]  Deploy the diamond to a network.
  help [command]              display help for command

And usegemforge <command> --help to help for a specific command. E.g, for gemforge init --help:

Usage: gemforge deploy [options] [network]

Deploy the diamond to a network.

Arguments:
  network                network to deploy to (default: "local")

Options:
  -v, --verbose          verbose logging output
  -q, --quiet            disable logging output
  -f, --folder <folder>  folder to run gemforge in (default: ".")
  -c, --config <config>  gemforge config file to use (default: "gemforge.config.cjs")
  -n, --new              do a fresh deployment, ignoring any existing one
  -h, --help             display help for command

Full documentation is available at https://gemforge.xyz.

Development

Note: This section is only relevant for those wishing to work on the Gemforge tool itself. To use Gemforge with your project please read the official documentation.

Building

Building the tool:

> pnpm build

Watching for changes and re-building:

> pnpm dev

Testing

To run the tests, you will need Foundry and the Solidity compiler installed, see ci-docker-image.

Then run the following commands in 2 new terminal windows to start up local test nodes:

> pnpm run-foundry-testnet # terminal 1
> pnpm run-hardhat-testnet # terminal 2

Now you can run the tests in the original terminal:

> pnpm test

Troubleshooting tests

Note: If you get a Error: [object Object] error when running tests it's due to a Typescript syntax error in the test code somewhere.

Publishing

To publish a new release:

> pnpm release

Contributing

Issues and PRs are welcome. Please read the contributing guidelines.

License

MIT - see LICENSE.md