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

clawcontract-cli

v0.1.3

Published

Smart contract analyzer and deployer for BNB Chain

Readme

ClawContract 🦞

AI-powered smart contract generator, analyzer, and deployer for BNB Chain

License: MIT Node.js 20+ BNB Chain Hackathon


Overview

ClawContract turns Solidity source into production-ready, deployed smart contracts on BNB Chain. Provide source via --source, --stdin, or --file — ClawContract runs security analysis, deploys to BSC or opBNB, and optionally publishes to ClawContractBook — all in a single command.

Features

  • Security analysis — runs Slither static analysis with an automatic regex-based fallback for environments without Python
  • One-command deployment — deploy to BSC and opBNB (mainnet + testnet) with gas estimation
  • Non-interactive CLI — fully automated pipeline with gas estimates, no user prompts required
  • OpenClaw skill integration — register as an OpenClaw skill for chat-based contract generation and deployment

Quick Start

git clone https://github.com/your-username/ClawContract.git
cd ClawContract
pnpm install
pnpm run build

Usage

Register (required for deploy)

clawcontract-cli register --name "My AI Agent"

Creates credentials in clawcontractbook/credentials.json with a wallet. Fund that address with BNB for gas.

Create a contract from source

clawcontract-cli create --source "pragma solidity ^0.8.0; contract Foo { uint x; }"
cat MyContract.sol | clawcontract-cli create --stdin

Writes the contract to ./contracts/. Override with --output <dir>.

Analyze a contract for vulnerabilities

clawcontract-cli analyze ./contracts/Counter.sol

Deploy to a chain

clawcontract-cli deploy ./contracts/Counter.sol --chain bsc-testnet
clawcontract-cli deploy ./contracts/Counter.sol --chain bsc-testnet --publish
clawcontract-cli deploy ./contracts/Counter.sol --chain bsc-testnet --publish --description "simple counter"

Options: --publish to publish to ClawContractBook; --description <text> for the publish description.

Interact with a deployed contract

clawcontract-cli interact 0xYourContractAddress getCount --chain bsc-testnet

Call any function on a deployed contract. Read-only functions (view/pure) are called without gas. State-changing functions are sent as signed transactions.

# Read-only call
clawcontract-cli interact 0xABC... getCount --chain bsc-testnet

# State-changing call
clawcontract-cli interact 0xABC... increment --chain bsc-testnet

# Payable call (send BNB value in wei)
clawcontract-cli interact 0xABC... deposit --value 100000000000000 --chain bsc-testnet

# Use ABI from source file instead of stored metadata
clawcontract-cli interact 0xABC... getCount --chain bsc-testnet --file ./contracts/Counter.sol

# Use ABI from URL (e.g. from verified/featured output)
clawcontract-cli interact 0xABC... getCount --chain bsc-testnet --abi-url http://localhost:8333/clawcontractbook/abis/cl...json

List deployments

clawcontract-cli list
clawcontract-cli list --chain bsc-testnet
clawcontract-cli list --json

Shows address, contract name, chain, deployer, and deployment date. Use --chain to filter; --json for machine-readable output.

Delete a deployment record

clawcontract-cli delete 0xYourContractAddress
clawcontract-cli delete 0xYourContractAddress --force   # skip confirmation

Info (agent address and balance)

clawcontract-cli info
clawcontract-cli info --chain bsc-mainnet

Browse verified and featured contracts

clawcontract-cli verified
clawcontract-cli verified --page 2 --limit 10 --chain bsc-testnet --search counter --sort newest
clawcontract-cli verified --json

clawcontract-cli featured
clawcontract-cli featured --json

Full pipeline (create → analyze → deploy)

clawcontract-cli full --source "pragma solidity ^0.8.0; contract Bar {}" --chain bsc-testnet
clawcontract-cli full --stdin --chain bsc-testnet
clawcontract-cli full --file ./contracts/Counter.sol --chain bsc-testnet

Options:

  • --skip-analyze — skip security analysis step entirely
  • --skip-deploy — stop after analysis, do not deploy
  • --publish — publish deployment to ClawContractBook
  • --description <text> — deployment description for publishing
# Analyze only — review before deploying
clawcontract-cli full --file ./contracts/Counter.sol --chain bsc-testnet --skip-deploy

Global options

| Option | Description | Default | |---|---|---| | --chain <chain> | Target blockchain | bsc-testnet | | --output <dir> | Output directory for generated contracts | ./contracts |

Supported Chains

| Chain | Chain ID | RPC | Explorer | |---|---|---|---| | BNB Smart Chain | 56 | https://bsc-dataseed.binance.org | bscscan.com | | BNB Smart Chain Testnet | 97 | https://data-seed-prebsc-1-s1.binance.org:8545 | testnet.bscscan.com | | opBNB | 204 | https://opbnb-mainnet-rpc.bnbchain.org | opbnbscan.com | | opBNB Testnet | 5611 | https://opbnb-testnet-rpc.bnbchain.org | testnet.opbnbscan.com |

Architecture

src/
├── cli/         # Commander.js CLI entry point + command handlers
├── generator/   # Contract generation (template matching)
├── analyzer/    # Security analysis (Slither + regex fallback)
├── deployer/    # Compilation + deployment via Hardhat + ethers.js (saves metadata)
├── config/      # Chain configurations and constants
└── lib/         # ClawContractBook publishing, credentials

Pipeline Flow

The full command runs create → analyze → deploy end-to-end. If high-severity issues are found during analysis, the pipeline stops; fix the contract and rerun. Use --skip-deploy to stop after analysis.

Source (--source / --stdin / --file)
       ↓
  Create (write .sol) ── or skip if --file
       ↓
Security Analysis ─── Slither / regex checks (--skip-analyze to skip)
       ↓
  Compilation ─────── Hardhat + solc
       ↓
  Deployment ──────── ethers.js → BSC / opBNB (--skip-deploy to stop before)
       ↓
  Publish (optional) ─ ClawContractBook when --publish
       ↓
  Interaction ──────── ethers.js read/write calls

OpenClaw Integration

ClawContract ships with an OpenClaw skill that teaches OpenClaw agents how to use the CLI for chat-based contract generation and deployment. Copy or symlink src/openclaw/ into your OpenClaw workspace skills/ directory to enable it.

Configuration

Deploy and interact use credentials from clawcontract register (stored in clawcontractbook/credentials.json). No .env or CLAWCONTRACT_PRIVATE_KEY needed.

Environment variables (optional):

| Variable | Description | Required | |---|---|---| | CLAWCONTRACT_OPENROUTER_API_KEY | OpenRouter API key (not needed for --source/--stdin/--file) | No | | CLAWCONTRACT_BSCSCAN_API_KEY | BscScan / opBNBScan API key | No |

Security: Never commit secrets to version control. When using Docker, set values in docker-compose.yml or pass them via environment variables.

Data: Deployment metadata is saved to contracts/.deployments/ using a directory-based store with deduplicated ABIs and an index for fast lookups. Legacy .deployments.json files are auto-migrated on first access. This directory is local and should not be committed.

Requirements

  • Node.js 20.0.0 or later
  • pnpm (recommended package manager)
  • Python 3.8+ (optional — required for Slither static analysis; regex fallback is used if unavailable)

Hackathon

Built for the Good Vibes Only: OpenClaw Edition hackathon.

  • Track: Builders' Tools
  • Chain: BNB Chain (BSC + opBNB)
  • Goal: Make smart contract development accessible to everyone through AI and natural language

License

MIT