Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-rwa

Generate ERC-20 compliant real-world asset tokens with customizable features like burnable, pausable, and cross-chain bridging. Returns source code in a Markdown block without writing to disk.

Instructions

Make a real-world asset 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

  • The tool handler that constructs StablecoinOptions from input parameters and generates the Solidity code for a Real World Asset using OpenZeppelin's realWorldAsset.print() function.
    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(() => realWorldAsset.print(opts)), }, ], }; },
  • Zod schema definition for the RWA tool inputs. rwaSchema aliases stablecoinSchema, which extends ERC20 options with RWA-specific restrictions and freezable features.
    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; export const rwaSchema = stablecoinSchema;
  • Registers the 'solidity-rwa' MCP tool on the server, providing the tool name, detailed prompt from solidityPrompts.RWA, rwaSchema for input validation, and the handler function.
    export function registerSolidityRWA(server: McpServer) { return server.tool( 'solidity-rwa', makeDetailedPrompt(solidityPrompts.RWA), rwaSchema, 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(() => realWorldAsset.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