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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ichaingov-smart-contract-generator

v1.0.1

Published

ichaingov smart contract generator — generates governance contracts from config.json

Downloads

271

Readme

ichaingov-contract-generator

Generates and deploys governance contracts for gateway-based interoperability systems from a single config.json file.


Overview

ichaingov-smart-contract-generator automates the creation of a complete on-chain governance framework designed for gateway interoperability systems like those described in the Secure Asset Transfer Protocol (SATP). It produces all the necessary Solidity contracts, configuration, and deployment scripts, allowing a DAO to manage protocol parameters and gateway registration.

The generated contracts use and extend OpenZeppelin's contracts, it implements multiple voting systems and an optional timelock.


Generated Contracts

The CLI creates the following smart contracts:

| Contract | Description | |----------|-------------| | Token | ERC20 token with vote delegation (ERC20Votes). Used for governance voting power. | | GovernanceTL | Main governor contract inheriting Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, and GovernorTimelockControl. Supports three voting systems: TokenBased, Quadratic, and WeightedReputation. | | Timelock | OpenZeppelin TimelockController that enforces a delay between proposal passing and execution. Optional — controlled by config.json. | | GatewayRegistry | Ownable contract storing on-chain identities of organizations and their gateways. | | PolicyRegistry | Simple key-value store for protocol parameters. Only the governor can modify it, ensuring all changes go through on-chain governance. |


Quick Start

npx ichaingov-smart-contract-generator

If no config.json is present in the current directory, a template will be copied automatically. Edit it to match your DAO's requirements and run the command again.

Configuration

All settings are read from a config.json file. Below is a complete example:

{
  "name": "MyDAO",
  "tokenomics": {
    "name": "MyToken",
    "symbol": "MTK",
    "supply": 1000000,
    "defaultMemberTokens": 1000
  },
  "organizations": [
    {
      "address": "0x...",
      "name": "Org A",
      "reputation": 0,
      "gateways": ["0x..."]
    }
  ],
  "governance": {
    "votingDelay": 1,
    "votingPeriod": 5,
    "proposalThreshold": 0,
    "quorumFraction": 0,
    "votingSystem": "token-based"
  },
  "timelock": {
    "enabled": true,
    "minDelay": 0
  },
  "protocolParameters": [
    { "key": "satp.version", "value": "v02" }
  ]
}
  • votingSystem accepts: token-based, quadratic, weighted-reputation.

Important Notes

  • EVM target: The generated Hardhat config uses evmVersion: "cancun". This is required because OpenZeppelin v5.6+ uses the mcopy opcode. If you have an existing config, ensure the same EVM version is set.

The thesis addresses governance challenges in gateway-based interoperability systems, proposing a decentralized governance framework for protocols like SATP. The smart contracts generated by this tool form the on-chain layer of that framework, while an external integration layer listens to DAO events to update gateway configurations automatically.

For more details on the architecture, voting systems, and the integration with SATP, refer to the full thesis document.