π§ 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_erc20System selects
erc20_fixed_supply.soltemplate from the internal libraryTemplate 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:
{{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