Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stxforge

Smart contract scaffolding CLI for the Stacks ecosystem

License: MIT Stacks Clarity

Overview

stxforge is a developer-first CLI tool that scaffolds production-ready Clarity smart contracts for the Stacks blockchain. Generate tokens, NFTs, DAOs, and DeFi protocols in seconds — with best practices baked in from day one.

Whether you're a seasoned Stacks builder or just getting started with Clarity, stxforge removes boilerplate and lets you focus on what matters: shipping great products on Bitcoin L2.


Features

  • Contract Templates — SIP-010 fungible tokens, SIP-009 NFTs, multi-sig vaults, DAO frameworks, staking contracts
  • Interactive CLI — guided prompts to configure each contract to your exact specs
  • Test Scaffolding — auto-generates Clarinet test suites alongside every contract
  • Deployment Pipelines — built-in scripts for testnet and mainnet deployment via Clarinet
  • Plugin System — extend stxforge with community-built templates
  • Audit Checklists — inline comments flagging common Clarity security pitfalls

Tech Stack

Layer Technology
Smart Contracts Clarity (Stacks)
CLI Runtime Node.js / TypeScript
Testing Clarinet + Vitest
Deployment Stacks.js + Clarinet
Package Manager npm / pnpm

Prerequisites


Installation

npm install -g stxforge

Or with pnpm:

pnpm add -g stxforge

Quick Start

# Create a new Stacks project
stxforge init my-project

# Scaffold a SIP-010 fungible token
stxforge add token --name "MyToken" --symbol "MTK" --decimals 6

# Scaffold a SIP-009 NFT collection
stxforge add nft --name "MyCollection" --supply 10000

# Scaffold a DAO with governance token
stxforge add dao --name "MyDAO" --quorum 60

# Run local tests
cd my-project && clarinet test

Contract Templates

SIP-010 Fungible Token

;; Generated by stxforge
(impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)

(define-fungible-token my-token u1000000000000)

(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34))))
  (begin
    (asserts! (is-eq tx-sender sender) (err u401))
    (ft-transfer? my-token amount sender recipient)
  )
)

SIP-009 NFT

;; Generated by stxforge
(impl-trait 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait)

(define-non-fungible-token my-nft uint)

(define-public (mint (recipient principal))
  (let ((token-id (+ (var-get last-token-id) u1)))
    (begin
      (var-set last-token-id token-id)
      (nft-mint? my-nft token-id recipient)
    )
  )
)

Project Structure

my-project/
├── contracts/
│   ├── token.clar
│   ├── nft.clar
│   └── dao.clar
├── tests/
│   ├── token.test.ts
│   ├── nft.test.ts
│   └── dao.test.ts
├── scripts/
│   ├── deploy-testnet.ts
│   └── deploy-mainnet.ts
├── Clarinet.toml
└── package.json

Configuration

# stxforge.config.toml
[project]
name = "my-project"
network = "testnet"  # testnet | mainnet | devnet

[defaults]
author = "thewealthyplace"
license = "MIT"

[templates]
custom_path = "./my-templates"

Available Commands

Command Description
stxforge init <name> Bootstrap a new Stacks project
stxforge add token Add a SIP-010 fungible token
stxforge add nft Add a SIP-009 NFT contract
stxforge add dao Add a DAO + governance contract
stxforge add vault Add a multi-sig vault
stxforge add staking Add a staking/reward contract
stxforge deploy Deploy contracts to the configured network
stxforge audit Run security checklist on contracts
stxforge list List all available templates

Roadmap

  • Core CLI scaffolding engine
  • SIP-010 and SIP-009 templates
  • DAO + governance templates
  • DeFi AMM template
  • Mainnet one-click deployment
  • Community template registry
  • VS Code extension integration
  • AI-assisted contract generation

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a PR.

git clone https://github.com/thewealthyplace/stxforge
cd stxforge
pnpm install
pnpm dev

License

MIT © thewealthyplace


Resources

About

Smart contract scaffolding CLI for the Stacks ecosystem

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages