stellar-stablecoin
Generate a Stellar-compatible stablecoin smart contract using OpenZeppelin's Fungible Token Standard. Configure token properties like minting, pausing, and access controls to create a customized stablecoin implementation.
Instructions
Make a stablecoin that uses Fungible Token Standard, compatible with SEP-41.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the contract | |
| symbol | Yes | The short symbol for the token | |
| burnable | No | Whether token holders will be able to destroy their tokens | |
| pausable | No | Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response. | |
| premint | No | The number of tokens to premint for the deployer. | |
| mintable | No | Whether privileged accounts will be able to create more supply or emit more tokens | |
| access | No | The 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. | |
| upgradeable | No | Whether the contract can be upgraded. | |
| info | No | Metadata about the contract and author | |
| limitations | No | Whether to restrict certain users from transferring tokens, either via allowing or blocking them. |
Implementation Reference
- The handler function for the 'stellar-stablecoin' tool. It takes input parameters, constructs StablecoinOptions, calls stablecoin.print(opts) from '@openzeppelin/wizard-stellar' to generate Rust code, and formats it safely for output.async ({ name, symbol, burnable, pausable, premint, mintable, upgradeable, access, limitations, info }) => { const opts: StablecoinOptions = { name, symbol, burnable, pausable, premint, mintable, upgradeable, access, limitations, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => stablecoin.print(opts)), }, ], }; },
- Zod schema for validating inputs to the 'stellar-stablecoin' tool, extending fungibleSchema with 'limitations' option specific to stablecoins.export const stablecoinSchema = { ...fungibleSchema, limitations: z .literal(false) .or(z.literal('allowlist')) .or(z.literal('blocklist')) .optional() .describe(stellarStablecoinDescriptions.limitations), } as const satisfies z.ZodRawShape;
- packages/mcp/src/stellar/tools/stablecoin.ts:8-36 (registration)Registers the 'stellar-stablecoin' tool on the MCP server, providing the tool name, prompt, schema, and handler function.export function registerStellarStablecoin(server: McpServer): RegisteredTool { return server.tool( 'stellar-stablecoin', makeDetailedPrompt(stellarPrompts.Stablecoin), stablecoinSchema, async ({ name, symbol, burnable, pausable, premint, mintable, upgradeable, access, limitations, info }) => { const opts: StablecoinOptions = { name, symbol, burnable, pausable, premint, mintable, upgradeable, access, limitations, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => stablecoin.print(opts)), }, ], }; }, ); }
- packages/mcp/src/stellar/tools.ts:20-24 (registration)Top-level registration function for all Stellar tools, including 'stellar-stablecoin' via registerStellarStablecoin.export function registerStellarTools(server: McpServer) { Object.values(getRegisterFunctions(server)).forEach(registerTool => { registerTool(server); }); }
- packages/mcp/src/server.ts:27-29 (registration)Calls registerStellarTools during MCP server initialization, thereby registering the 'stellar-stablecoin' tool.registerStellarTools(server); registerStylusTools(server); registerUniswapHooksTools(server);