🧠 How Template Injection Works

When a user provides a prompt like:

β€œCreate a token called EcoCoin with symbol ECO and supply 5 million.”

The Template Engine follows these steps:


1. Select Appropriate Template

  • Intent is detected: deploy_erc20

  • System selects erc20_fixed_supply.sol template from the internal library

  • Template is chosen based on:

    • Contract type (ERC-20, NFT, etc.)

    • Token properties (mintable, burnable, capped)


2. Inject User Parameters

The engine replaces predefined placeholder variables within the Solidity boilerplate with values extracted from the user’s natural language input.

Example Mapping:

Placeholder
Replaced With

{{TOKEN_NAME}}

EcoCoin

{{TOKEN_SYMBOL}}

ECO

{{INITIAL_SUPPLY}}

5000000 (in full units, later multiplied by 10^18)


3. Output Raw Solidity Code

After injection, the final contract is compiled into complete Solidity source code, which is then:

  • Passed to the Solidity compiler (solc-js)

  • Parsed into:

    • Bytecode (for EVM deployment)

    • ABI (for post-deployment interaction)

  • Logged for preview or auditing

Last updated