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

v0.1.4

Published

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

Downloads

501

Readme

ClawContract 🦞

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

License: MIT Node.js 20+ BNB Chain Hackathon


Overview

ClawContract turns natural language into production-ready, deployed, and verified smart contracts on BNB Chain. Describe what you want in plain English — ClawContract generates the Solidity code using AI, runs security analysis, deploys to BSC or opBNB, and verifies the source on BscScan — 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
  • Automatic verification — verify source code on BscScan and opBNBScan immediately after deployment
  • 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

Generate a contract

clawcontract generate "ERC-20 token called VibeToken with 1M supply"

Analyze a contract for vulnerabilities

clawcontract analyze ./contracts/VibeToken.sol

Deploy to a chain

clawcontract deploy ./contracts/VibeToken.sol --chain bsc-testnet

Verify on block explorer

clawcontract verify 0xYourContractAddress --chain bsc-testnet --file ./contracts/VibeToken.sol

Interact with a deployed contract

clawcontract interact 0xYourContractAddress name --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 interact 0xABC... balanceOf 0xDEF... --chain bsc-testnet

# State-changing call
clawcontract interact 0xABC... transfer 0xDEF... 1000 --chain bsc-testnet

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

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

List deployments

clawcontract list

List all stored deployment records. Shows address, contract name, chain, deployer, and deployment date.

# List all deployments
clawcontract list

# Filter by chain
clawcontract list --chain bsc-testnet

# Output as JSON (for scripting)
clawcontract list --json

Delete a deployment record

clawcontract delete <address>

Remove a deployment record from the local store. Shows deployment details and asks for confirmation before deleting. Orphaned ABI files are automatically cleaned up.

# Delete with confirmation prompt
clawcontract delete 0xYourContractAddress

# Skip confirmation
clawcontract delete 0xYourContractAddress --force

Full pipeline (generate → analyze → deploy → verify)

clawcontract full "staking contract for BNB with 10% APY" --chain bsc-testnet

Optional flags:

  • --skip-deploy — stop after analysis, do not deploy or verify (useful for review before deploying)
  • --skip-fix — do not auto-fix high-severity issues found during analysis
# Generate and analyze only — review before deploying
clawcontract full "staking contract for BNB with 10% APY" --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 + Claude LLM)
├── analyzer/    # Security analysis (Slither + regex fallback)
├── deployer/    # Compilation + deployment via Hardhat + ethers.js (saves metadata)
├── verifier/    # BscScan / opBNBScan source verification
├── config/      # Chain configurations and constants
└── openclaw/    # OpenClaw skill definition for chat integration

Pipeline Flow

The full command runs the entire pipeline end-to-end. If high-severity issues are found during analysis, the AI will automatically attempt to fix them (up to 3 attempts) before proceeding to deployment. Use --skip-deploy to stop after analysis, or --skip-fix to disable automatic fix attempts.

Natural Language
       ↓
  AI Generation ─── template matching + Claude LLM
       ↓
Security Analysis ── Slither / regex checks
       ↓              ↑
  AI Auto-Fix ────────┘  (up to 3 attempts if high-severity issues found)
       ↓
  Compilation ────── Hardhat + solc
       ↓
  Deployment ─────── ethers.js → BSC / opBNB
       ↓
  Verification ───── BscScan / opBNBScan API
       ↓
  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

Environment variables are configured via docker-compose.yml or set directly in your environment.

| Variable | Description | Required | |---|---|---| | CLAWCONTRACT_PRIVATE_KEY | Wallet private key for deployment (required for deploy/full) | Yes (for deploy) | | CLAWCONTRACT_OPENROUTER_API_KEY | OpenRouter API key for AI contract generation | Yes | | CLAWCONTRACT_OPENROUTER_MODEL | OpenRouter model (default: anthropic/claude-sonnet-4-20250514) | No | | CLAWCONTRACT_BSCSCAN_API_KEY | BscScan / opBNBScan API key for contract verification | 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