Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

stylus-erc20

Generate ERC-20 compliant smart contract source code with customizable features like burnable tokens, flash loans, and permit functionality, formatted in Markdown. No disk writes are performed.

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
NameRequiredDescriptionDefault
burnableNoWhether token holders will be able to destroy their tokens
flashmintNoWhether to include built-in flash loans to allow lending tokens without requiring collateral as long as they're returned in the same transaction.
infoNoMetadata about the contract and author
nameYesThe name of the contract
permitNoWhether without paying gas, token holders will be able to allow third parties to transfer from their account.

Implementation Reference

  • The handler function that executes the 'stylus-erc20' tool. It constructs ERC20Options from inputs and generates Rust code for the Stylus ERC20 contract using erc20.print().
    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 input validation of the 'stylus-erc20' tool parameters (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;
  • Registration of the 'stylus-erc20' tool on the MCP server, specifying name, prompt, schema, and handler function.
    export function registerStylusERC20(server: McpServer): RegisteredTool { 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)), }, ], }; }, ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OpenZeppelin/contracts-wizard'

If you have feedback or need assistance with the MCP directory API, please join our Discord server