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

@lagunagames/abi-compiler

v0.2.4

Published

Laguna Games Diamond ABI tool for brownie and hardhat

Downloads

14

Readme

LG ABI Compiler

This tool combines the ABI data from a project's build directory into one combined ABI, for use with projects that use the EIP-2535 "Diamond" pattern, or other proxy architectures.

One or more project folders can be analyzed and processed at a time.

The abi_tool will only include files named *Facet.sol or files starting with Lib*. This will ensure only internal LG methods and events are exposed.


Installation:

npm install @lagunagames/abi-compiler --location=global

Note for Foundry:

Create a script for this plugin in package.json:

    "scripts": {
        "abi-compile": "abi-compiler --path ./ -v"
    },

Basic configuration

Your project structure should look like this:

j:~/best_dapp_ever/ $ tree
├── abiConfig.json
└── src
    ├── contracts
        ├── FacetA.sol
        └── FacetB.sol

Note for Foundry:

Project folders should contain a configuration file named abiConfig.json, use the [--config] flag to see additional information.

Example abiConfig.json schema:

    {
        "projectName": "projectName",
        "buildDirectory": "build",
        "abiOutputDirectory": "abis",
        "abiConfigurations": [
            {
                "configuration": "name_of_config",
                "minified": false,
                "functionsPrecedence": {
                    "functionName1":"contractName1",
                    "functionName2":"contractName2"
                },
                "eventsPrecedence": {
                    "eventName1":"contractName1",
                    "eventName2":"contractName2"
                },
                "selectorsPrecedence": {
                    "selector1":"contractName1",
                    "selector2":"contractName1",
                    "selector3":"contractName2",
                },
                "contractsToIgnore": [
                    "contractName1",
                    "contractName2"
                ],
                "eventsToIgnore": [
                    "eventName1",
                    "eventName2"
                ],
                "functionsToIgnore": [
                    "functionName1",
                    "functionName2"
                ],
                "selectorsToIgnore": [
                    "selector1"
                    "selector2"
                ],
                "eventsOnly": true,
                "selectorLookup": true
            }
        ]
    }

Usage:

abi-compiler --path PROJECT_DIRECTORY

abi-compiler --path PROJECT_DIRECTORY [--help] [--config]

abi-compiler --path PROJECT_DIRECTORY [--path ADDITIONAL_DIRECTORY] [--report] [--verbose]

NOTE: path defaults to current path, when no path is specified in CLI

abi-compiler --verbose

Arguments:

 -h, --help: Print this message
 -c, --config: Instructions for project configuration
 --path PATH: Path to a project directory to scan.
 -r, --report: Analyze and print the ABI data found in a project
 -d, --dry-run: Preview the ABI structure for the target project(s)
 -v, --verbose: Show maximum logging output
 -q, --quiet: Show minimal logging output
 --ignore-collisions: Do not remove duplicates from collisions
 --quiet-collisions: Do not show collision logging
 -o, --ordered: Order JSON files for easier diffing (slow)

Example

abi-compiler --config

abi-compiler --path ../example/path --verbose

abi-compiler --report

abi-compiler --dry-run

abi-compiler --ignore-collisions

abi-compiler --quiet-collisions

abi-compiler --ordered