stylus-erc1155
Generate ERC-1155 smart contract source code with customizable features like burnable tokens and supply tracking for creating non-fungible tokens.
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 |
|---|---|---|---|
| name | Yes | The name of the contract | |
| burnable | No | Whether token holders will be able to destroy their tokens | |
| supply | No | Whether to keep track of total supply of tokens | |
| info | No | Metadata about the contract and author |
Implementation Reference
- Handler function that constructs ERC1155Options from inputs and generates Rust code using erc1155.print(opts), returning it as text content.async ({ name, burnable, supply, info }) => { const opts: ERC1155Options = { name, burnable, supply, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc1155.print(opts)), }, ], }; },
- Zod schema for 'stylus-erc1155' tool parameters: name (required), burnable/supply (optional booleans), and common info.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)Registers the 'stylus-erc1155' tool on McpServer with name, detailed prompt from stylusPrompts.ERC1155, erc1155Schema, and the handler function.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)), }, ], }; }, ); }