stylus-erc20
Generate ERC-20 token smart contracts with customizable features like burnable tokens, permit approvals, and flash minting using OpenZeppelin Contracts libraries.
Instructions
Make a fungible token per the ERC-20 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the contract | |
| burnable | No | Whether token holders will be able to destroy their tokens | |
| permit | No | Whether without paying gas, token holders will be able to allow third parties to transfer from their account. | |
| flashmint | No | Whether to include built-in flash loans to allow lending tokens without requiring collateral as long as they're returned in the same transaction. | |
| info | No | Metadata about the contract and author |
Implementation Reference
- Handler function that processes input parameters and generates Stylus ERC20 contract code using @openzeppelin/wizard-stylus.async ({ name, burnable, permit, flashmint, info }) => { const opts: ERC20Options = { name, burnable, permit, flashmint, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc20.print(opts)), }, ], }; },
- Zod schema for validating input parameters of the stylus-erc20 tool (name, burnable, permit, flashmint, info).export const erc20Schema = { name: z.string().describe(commonDescriptions.name), burnable: z.boolean().optional().describe(commonDescriptions.burnable), permit: z.boolean().optional().describe(stylusERC20Descriptions.permit), flashmint: z.boolean().optional().describe(stylusERC20Descriptions.flashmint), ...commonSchema, } as const satisfies z.ZodRawShape;
- packages/mcp/src/stylus/tools/erc20.ts:9-30 (registration)Direct registration of the 'stylus-erc20' tool on the MCP server using server.tool().return server.tool( 'stylus-erc20', makeDetailedPrompt(stylusPrompts.ERC20), erc20Schema, async ({ name, burnable, permit, flashmint, info }) => { const opts: ERC20Options = { name, burnable, permit, flashmint, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc20.print(opts)), }, ], }; }, );
- packages/mcp/src/server.ts:28-28 (registration)Top-level call to registerStylusTools which includes registration of stylus-erc20 among other Stylus tools.registerStylusTools(server);