stylus-erc1155
Generate ERC-1155 non-fungible token contract source code in Markdown format. Specify token name, burnability, supply tracking, and metadata. No file writes, direct code return for customization.
Instructions
Make a non-fungible token per the ERC-1155 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 |
|---|---|---|---|
| burnable | No | Whether token holders will be able to destroy their tokens | |
| info | No | Metadata about the contract and author | |
| name | Yes | The name of the contract | |
| supply | No | Whether to keep track of total supply of tokens |
Implementation Reference
- The handler function that executes the tool logic: constructs ERC1155Options from inputs and generates Rust code using erc1155.print(opts) from @openzeppelin/wizard-stylus.async ({ name, burnable, supply, info }) => { const opts: ERC1155Options = { name, burnable, supply, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc1155.print(opts)), }, ], }; },
- Zod schema defining the input shape for the tool: name (string), burnable (optional boolean), supply (optional boolean), and common info fields.export const erc1155Schema = { name: z.string().describe(commonDescriptions.name), burnable: z.boolean().optional().describe(commonDescriptions.burnable), supply: z.boolean().optional().describe(stylusERC1155Descriptions.supply), ...commonSchema, } as const satisfies z.ZodRawShape;
- packages/mcp/src/stylus/tools/erc1155.ts:8-30 (registration)The registration function that adds the 'stylus-erc1155' tool to the MCP server, specifying name, prompt, schema, and handler.export function registerStylusERC1155(server: McpServer): RegisteredTool { return server.tool( 'stylus-erc1155', makeDetailedPrompt(stylusPrompts.ERC1155), erc1155Schema, async ({ name, burnable, supply, info }) => { const opts: ERC1155Options = { name, burnable, supply, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc1155.print(opts)), }, ], }; }, ); }