Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

cairo-vesting

Generate smart contracts for managing gradual ERC-20 token release to beneficiaries using predefined vesting schedules.

Instructions

Make a vesting smart contract that manages the gradual release of ERC-20 tokens to a designated beneficiary based on a predefined vesting schedule.

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
startDateYesThe timestamp marking the beginning of the vesting period. In HTML input datetime-local format
durationYesThe total duration of the vesting period. In readable date time format matching /^(\d+(?:\.\d+)?) +(second|minute|hour|day|week|month|year)s?$/
cliffDurationYesThe duration of the cliff period. Must be less than or equal to the total duration. In readable date time format matching /^(\d+(?:\.\d+)?) +(second|minute|hour|day|week|month|year)s?$/
scheduleYesA vesting schedule implementation, tokens can either be vested gradually following a linear curve or with custom vesting schedule that requires the implementation of the VestingSchedule trait.
infoNoMetadata about the contract and author

Implementation Reference

  • The handler function that implements the core logic of the 'cairo-vesting' tool. It receives vesting parameters, constructs VestingOptions, and generates the Cairo contract code using the external vesting.print function wrapped in safePrintCairoCodeBlock.
    async ({ name, startDate, duration, cliffDuration, schedule, info }) => { const opts: VestingOptions = { name, startDate, duration, cliffDuration, schedule, info, }; return { content: [ { type: 'text', text: safePrintCairoCodeBlock(() => vesting.print(opts)), }, ], }; },
  • Zod schema defining the input shape and descriptions for the 'cairo-vesting' tool parameters.
    export const vestingSchema = { name: z.string().describe(commonDescriptions.name), startDate: z.string().describe(cairoVestingDescriptions.startDate), duration: z.string().describe(cairoVestingDescriptions.duration), cliffDuration: z.string().describe(cairoVestingDescriptions.cliffDuration), schedule: z.enum(['linear', 'custom']).describe(cairoVestingDescriptions.schedule), info: commonSchema.info, } as const satisfies z.ZodRawShape;
  • Registration function for the 'cairo-vesting' tool on the MCP server, specifying the tool name, prompt, schema, and handler.
    export function registerCairoVesting(server: McpServer): RegisteredTool { return server.tool( 'cairo-vesting', makeDetailedPrompt(cairoPrompts.Vesting), vestingSchema, async ({ name, startDate, duration, cliffDuration, schedule, info }) => { const opts: VestingOptions = { name, startDate, duration, cliffDuration, schedule, info, }; return { content: [ { type: 'text', text: safePrintCairoCodeBlock(() => vesting.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