Docs/Hyperagent/Guides/Contract Generation

Contract Generation

Learn how to write effective prompts and use templates to generate high-quality smart contracts.

Writing Effective Prompts

Good prompts lead to better contract generation:

Be Specific

Instead of "Create a token", use "Create an ERC20 token with transfer, approve, and balance functions"

Include Requirements

Specify access control, events, and special features

Mention Standards

Reference ERC standards (ERC20, ERC721, etc.) when applicable

Using Templates

Specify contract type to use relevant templates:

Terminal
curl -X POST http://localhost:8000/api/v1/contracts/generate \
  -H "Content-Type: application/json" \
  -d '{
    "nlp_description": "Create an ERC20 token with minting and burning",
    "contract_type": "token"
  }'