Skip to content

Commands

Brandon Brooks edited this page Jan 22, 2026 · 1 revision

Commands

ContractKit provides 8 commands for the complete smart contract development workflow.

/contractkit:new

Scaffold a new project from a template.

/contractkit:new <template> <name> [symbol]

Arguments:

  • template - One of: erc20, erc721, escrow, vault
  • name - Project/contract name (e.g., MyToken)
  • symbol - Token symbol, required for erc20/erc721 (e.g., MTK)

Examples:

/contractkit:new erc20 MyToken MTK
/contractkit:new erc721 MyNFT MNFT
/contractkit:new escrow PaymentEscrow
/contractkit:new vault TreasuryVault

Output: Creates a complete Foundry project with contracts, tests, scripts, and documentation.


/contractkit:test

Run the Foundry test suite.

/contractkit:test [options]

Options:

  • --verbose or -v - Show detailed test output
  • --match <pattern> - Run only tests matching pattern

Examples:

/contractkit:test
/contractkit:test --verbose
/contractkit:test --match testMint

/contractkit:local

Start a local Anvil development node.

/contractkit:local [options]

Options:

  • --port <number> - Port to run on (default: 8545)
  • --accounts <number> - Number of test accounts (default: 10)

Examples:

/contractkit:local
/contractkit:local --port 8546

Default Accounts: Anvil provides 10 accounts with 10,000 ETH each.


/contractkit:deploy

Deploy contracts to a network.

/contractkit:deploy [network]

Networks:

  • local (default) - Deploy to local Anvil node
  • sepolia - Deploy to Sepolia testnet (requires PRIVATE_KEY env var)

Examples:

/contractkit:deploy
/contractkit:deploy local
/contractkit:deploy sepolia

Environment Variables for Testnet:

export PRIVATE_KEY=0x...
export SEPOLIA_RPC_URL=https://...

/contractkit:call

Interact with deployed contracts.

/contractkit:call <address> <function> [args...]

Arguments:

  • address - Contract address
  • function - Function signature (e.g., name(), mint(address))
  • args - Function arguments

Examples:

# Read functions (no gas)
/contractkit:call 0x... name()
/contractkit:call 0x... balanceOf(address) 0xuser...

# Write functions (requires signer)
/contractkit:call 0x... mint(address,uint256) 0xuser... 1000

/contractkit:status

Check project and deployment status.

/contractkit:status

Shows:

  • Project type (detected from contracts)
  • Compilation status
  • Test results summary
  • Local node status
  • Recent deployments

/contractkit:explain

Get an explanation of contract code.

/contractkit:explain [file]

Arguments:

  • file - Specific file to explain (optional, defaults to main contract)

Examples:

/contractkit:explain
/contractkit:explain src/Token.sol

Explains:

  • Contract purpose and architecture
  • Key functions and their roles
  • Security features
  • Access control structure

/contractkit:audit-lite

Run a quick security review.

/contractkit:audit-lite [file]

Arguments:

  • file - Specific file to review (optional)

Checks:

  • Common vulnerability patterns
  • Access control issues
  • Reentrancy risks
  • Integer overflow potential
  • External call safety

Important: This is NOT a substitute for a professional security audit. Always get an independent audit before mainnet deployment.


Command Chaining

Typical development workflow:

# 1. Create project
/contractkit:new erc20 MyToken MTK

# 2. Run tests
/contractkit:test

# 3. Start local node
/contractkit:local

# 4. Deploy locally
/contractkit:deploy local

# 5. Interact with contract
/contractkit:call 0x... name()

# 6. Security review
/contractkit:audit-lite

Getting Help

For detailed help on any command:

/help contractkit

Clone this wiki locally