Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-stablecoin

Generate ERC-20 compliant stablecoin smart contracts with customizable features like burnable tokens, pausable functions, and cross-chain bridging. Ideal for developers creating experimental stablecoins.

Instructions

Make a stablecoin token that uses the ERC-20 standard. Experimental, some features are not audited and are subject to change.

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.
custodianNoWhether authorized accounts can freeze and unfreeze accounts for regulatory or security purposes. This feature is experimental, not audited and is subject to change.
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
limitationsNoWhether to restrict certain users from transferring tokens, either via allowing or blocking them. This feature is experimental, not audited and is subject to change.
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
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

  • Handler function that constructs StablecoinOptions from input parameters and generates Solidity code using OpenZeppelin Wizard's stablecoin.print, wrapped in safePrintSolidityCodeBlock.
    async ({ name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, info, restrictions, freezable, }) => { const opts: StablecoinOptions = { name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, info, restrictions, freezable, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => stablecoin.print(opts)), }, ], }; },
  • Zod schema for stablecoin tool inputs, based on ERC20 schema (excluding upgradeable), with added restrictions and freezable options.
    const { upgradeable: _, ...erc20SchemaOmitUpgradeable } = erc20Schema; export const stablecoinSchema = { ...erc20SchemaOmitUpgradeable, restrictions: z .literal(false) .or(z.literal('allowlist')) .or(z.literal('blocklist')) .optional() .describe(solidityStablecoinDescriptions.restrictions), freezable: z.boolean().optional().describe(solidityStablecoinDescriptions.freezable), } as const satisfies z.ZodRawShape;
  • Registration of the 'solidity-stablecoin' tool on the MCP server, including name, detailed prompt from Wizard, stablecoinSchema, and the handler function.
    export function registerSolidityStablecoin(server: McpServer): RegisteredTool { return server.tool( 'solidity-stablecoin', makeDetailedPrompt(solidityPrompts.Stablecoin), stablecoinSchema, async ({ name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, info, restrictions, freezable, }) => { const opts: StablecoinOptions = { name, symbol, burnable, pausable, premint, premintChainId, mintable, callback, permit, votes, flashmint, crossChainBridging, access, info, restrictions, freezable, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => stablecoin.print(opts)), }, ], }; }, ); }
  • Top-level call to register all Solidity tools, including solidity-stablecoin via the aggregation in tools.ts.
    registerSolidityTools(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