Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

cairo-erc20

Generate ERC-20 token contracts for the Cairo language with customizable features like burnable tokens, pausable functionality, and voting capabilities.

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
nameYesThe name of the contract
symbolYesThe short symbol for the token
decimalsNoThe number of decimals to use for the contract. Defaults to 18.
burnableNoWhether token holders will be able to destroy their tokens
pausableNoWhether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.
premintNoThe number of tokens to premint for the deployer.
mintableNoWhether privileged accounts will be able to create more supply or emit more tokens
votesNoWhether to keep track of historical balances for voting in on-chain governance, with a way to delegate one's voting power to a trusted account.
appNameNoRequired when votes is enabled, for hashing and signing typed structured data. Name for domain separator implementing SNIP12Metadata trait. Prevents two applications from producing the same hash.
appVersionNoRequired when votes is enabled, for hashing and signing typed structured data. Version for domain separator implementing SNIP12Metadata trait. Prevents two versions of the same application from producing the same hash.
accessNoThe type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts.
upgradeableNoWhether the smart contract is upgradeable.
infoNoMetadata about the contract and author

Implementation Reference

  • The tool handler function that takes ERC20 options, constructs ERC20Options using the input parameters, generates the Cairo ERC20 contract code using the OpenZeppelin wizard's erc20.print method, formats it safely, and returns it as MCP text content.
    async ({ name, symbol, decimals, burnable, pausable, premint, mintable, votes, appName, appVersion, access, upgradeable, info, }) => { const opts: ERC20Options = { name, symbol, decimals, burnable, pausable, premint, mintable, votes, appName, appVersion, access, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintCairoCodeBlock(() => erc20.print(opts)), }, ], }; },
  • Zod schema defining and validating all input parameters for the cairo-erc20 tool, including name, symbol, decimals, extensions like burnable, pausable, etc., and common fields.
    export const erc20Schema = { name: z.string().describe(commonDescriptions.name), symbol: z.string().describe(commonDescriptions.symbol), decimals: z.string().optional().describe(cairoERC20Descriptions.decimals), burnable: z.boolean().optional().describe(commonDescriptions.burnable), pausable: z.boolean().optional().describe(commonDescriptions.pausable), premint: z.string().optional().describe(cairoERC20Descriptions.premint), mintable: z.boolean().optional().describe(commonDescriptions.mintable), votes: z.boolean().optional().describe(cairoERC20Descriptions.votes), appName: z.string().optional().describe(cairoCommonDescriptions.appName), appVersion: z.string().optional().describe(cairoCommonDescriptions.appVersion), ...commonSchema, } as const satisfies z.ZodRawShape;
  • Registration of the 'cairo-erc20' tool on the MCP server, including the tool name, detailed prompt from wizard-common, erc20Schema for input validation, and the handler function. This function is called from cairo/tools.ts during server setup.
    export function registerCairoERC20(server: McpServer): RegisteredTool { return server.tool( 'cairo-erc20', makeDetailedPrompt(cairoPrompts.ERC20), erc20Schema, async ({ name, symbol, decimals, burnable, pausable, premint, mintable, votes, appName, appVersion, access, upgradeable, info, }) => { const opts: ERC20Options = { name, symbol, decimals, burnable, pausable, premint, mintable, votes, appName, appVersion, access, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintCairoCodeBlock(() => 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