midnight-generate-contract
Generate Compact smart contracts from natural language requirements, specifying state variables, access control, and operations.
Instructions
🔮 AI-POWERED CONTRACT GENERATION
Generates Compact smart contracts from natural language requirements. Uses the client's LLM through MCP sampling to create contracts.
REQUIREMENTS FORMAT:
Describe what the contract should do
Specify state variables needed
Define access control requirements
List the operations/circuits needed
CONTRACT TYPES: • counter - Simple counter with increment/decrement • token - Token with transfers and balances • voting - Voting/governance mechanisms • custom - Free-form custom contract
EXAMPLE USAGE: "Create a token contract with private balances, mint/burn capabilities for admin, and transfer functionality between users"
⚠️ REQUIRES: Client with sampling capability (e.g., Claude Desktop)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requirements | Yes | Natural language description of the contract requirements | |
| contractType | No | Type of contract to generate | |
| baseExample | No | Example contract code to use as a base |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Generated Compact contract code | |
| explanation | Yes | Brief explanation of what the contract does | |
| warnings | Yes | Any warnings or notes about the generated code | |
| samplingAvailable | Yes | Whether sampling capability was available |