stylus-erc721
Generate ERC-721 compliant non-fungible token contracts with customizable features like burnability and on-chain enumeration. Returns formatted source code in Markdown, ready for immediate use.
Instructions
Make a non-fungible token per the ERC-721 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 | |
| enumerable | No | Whether to allow on-chain enumeration of all tokens or those owned by an account. Increases gas cost of transfers. | |
| info | No | Metadata about the contract and author | |
| name | Yes | The name of the contract |
Implementation Reference
- Handler function that constructs ERC721Options from input and generates the Stylus (Rust) contract code using OpenZeppelin's erc721.print()async ({ name, burnable, enumerable, info }) => { const opts: ERC721Options = { name, burnable, enumerable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc721.print(opts)), }, ], }; },
- Zod schema defining the input parameters for the stylus-erc721 tool (name, burnable, enumerable, info)export const erc721Schema = { name: z.string().describe(commonDescriptions.name), burnable: z.boolean().optional().describe(commonDescriptions.burnable), enumerable: z.boolean().optional().describe(stylusERC721Descriptions.enumerable), ...commonSchema, } as const satisfies z.ZodRawShape;
- packages/mcp/src/stylus/tools/erc721.ts:8-30 (registration)Function that registers the 'stylus-erc721' tool on the MCP server, providing name, prompt, schema, and handlerexport function registerStylusERC721(server: McpServer): RegisteredTool { return server.tool( 'stylus-erc721', makeDetailedPrompt(stylusPrompts.ERC721), erc721Schema, async ({ name, burnable, enumerable, info }) => { const opts: ERC721Options = { name, burnable, enumerable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc721.print(opts)), }, ], }; }, ); }
- packages/mcp/src/stylus/tools.ts:13-17 (registration)Mapping of Stylus tool kinds to their registration functions, including ERC721return { ERC20: () => registerStylusERC20(server), ERC721: () => registerStylusERC721(server), ERC1155: () => registerStylusERC1155(server), };
- packages/mcp/src/server.ts:28-28 (registration)Top-level call to register all Stylus tools, which includes stylus-erc721 via the chain.registerStylusTools(server);