Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-erc20

Generate ERC-20 compliant fungible token contracts with customizable features like burnable tokens, minting, pausing, and cross-chain bridging. Returns formatted Solidity code in Markdown for easy integration.

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
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. Managed enables a central contract to define a policy that allows certain callers to access certain functions.
burnableNoWhether token holders will be able to destroy their tokens
callbackNoWhether to include support for code execution after transfers and approvals on recipient contracts in a single transaction.
crossChainBridgingNoWhether to allow authorized bridge contracts to mint and burn tokens for cross-chain transfers. Options are to use custom bridges on any chain, or the SuperchainERC20 standard with the predeployed SuperchainTokenBridge. The SuperchainERC20 feature is only available on chains in the Superchain, and requires deploying your contract to the same address on every chain in the Superchain.
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
mintableNoWhether privileged accounts will be able to create more supply or emit more tokens
nameYesThe name of the contract
pausableNoWhether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.
permitNoWhether without paying gas, token holders will be able to allow third parties to transfer from their account.
premintNoThe number of tokens to premint for the deployer.
premintChainIdNoThe chain ID of the network on which to premint tokens.
symbolYesThe short symbol for the token
upgradeableNoWhether the smart contract is upgradeable. Transparent uses more complex proxy with higher overhead, requires less changes in your contract. Can also be used with beacons. UUPS uses simpler proxy with less overhead, requires including extra code in your contract. Allows flexibility for authorizing upgrades.
votesNoWhether to keep track of historical balances for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps.

Implementation Reference

  • The asynchronous handler function that receives the tool parameters, maps them to ERC20Options, generates the Solidity contract code using OpenZeppelin Wizard's erc20.print(), and returns it as a text content response.
    async ({ name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, upgradeable, info, }) => { const opts: ERC20Options = { name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => erc20.print(opts)), }, ], }; },
  • Zod schema defining the input parameters and validation for the solidity-erc20 tool, including options like name, symbol, burnable, pausable, etc.
    export const erc20Schema = { name: z.string().describe(commonDescriptions.name), symbol: z.string().describe(commonDescriptions.symbol), burnable: z.boolean().optional().describe(commonDescriptions.burnable), pausable: z.boolean().optional().describe(commonDescriptions.pausable), premint: z.string().optional().describe(solidityERC20Descriptions.premint), premintChainId: z.string().optional().describe(solidityERC20Descriptions.premintChainId), mintable: z.boolean().optional().describe(commonDescriptions.mintable), callback: z.boolean().optional().describe(solidityERC20Descriptions.callback), permit: z.boolean().optional().describe(solidityERC20Descriptions.permit), votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(solidityERC20Descriptions.votes), flashmint: z.boolean().optional().describe(solidityERC20Descriptions.flashmint), crossChainBridging: z .literal('custom') .or(z.literal('superchain')) .optional() .describe(solidityERC20Descriptions.crossChainBridging), namespacePrefix: z.string().optional().describe(solidityCommonDescriptions.namespacePrefix), ...commonSchema, } as const satisfies z.ZodRawShape;
  • Registration function for the solidity-erc20 tool, called by the tools registry, which registers it on the MCP server with name, detailed prompt, schema, and handler.
    export function registerSolidityERC20(server: McpServer): RegisteredTool { return server.tool( 'solidity-erc20', makeDetailedPrompt(solidityPrompts.ERC20), erc20Schema, async ({ name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, upgradeable, info, }) => { const opts: ERC20Options = { name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => erc20.print(opts)), }, ], }; }, ); }
  • Top-level call to register all Solidity tools, including solidity-erc20 via the chain registerSolidityTools -> registerSolidityERC20.
    registerSolidityTools(server);
  • Entry in the Solidity tools registry object that maps 'ERC20' to the registration function for solidity-erc20.
    ERC20: () => registerSolidityERC20(server),

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