-
Notifications
You must be signed in to change notification settings - Fork 0
Commands
ContractKit provides 8 commands for the complete smart contract development workflow.
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 TreasuryVaultOutput: Creates a complete Foundry project with contracts, tests, scripts, and documentation.
Run the Foundry test suite.
/contractkit:test [options]Options:
-
--verboseor-v- Show detailed test output -
--match <pattern>- Run only tests matching pattern
Examples:
/contractkit:test
/contractkit:test --verbose
/contractkit:test --match testMintStart 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 8546Default Accounts: Anvil provides 10 accounts with 10,000 ETH each.
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 sepoliaEnvironment Variables for Testnet:
export PRIVATE_KEY=0x...
export SEPOLIA_RPC_URL=https://...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... 1000Check project and deployment status.
/contractkit:statusShows:
- Project type (detected from contracts)
- Compilation status
- Test results summary
- Local node status
- Recent deployments
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.solExplains:
- Contract purpose and architecture
- Key functions and their roles
- Security features
- Access control structure
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.
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-liteFor detailed help on any command:
/help contractkitContractKit
Reference
Help