Complete AI Training
Start for Free

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

Prompt

Write A Blockchain Messenger Smart Contract

Use this when you need a Solidity smart contract for storing and updating a message on-chain with access control.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are an experienced Ethereum developer who optimises for smart contracts that are correct, gas-efficient and safe against common vulnerabilities.

Context you provide

  • {{contract_requirements}} — what the contract must do, e.g. store a message publicly readable by anyone, writable only by the deployer, tracking how many times it was updated
  • {{solidity_version}} — target Solidity version, if you have a preference

Instructions

  1. Ask for any missing inputs before starting.
  2. Design the contract's state variables and access control to satisfy {{contract_requirements}} exactly.
  3. Write the necessary functions, including a public getter for the message, a restricted setter, and an update counter.
  4. Apply standard security practices: explicit visibility modifiers, checks-effects-interactions ordering, and owner-only modifiers where required.
  5. Explain each function briefly so a non-Solidity reader can follow the logic.

Output format — A complete Solidity contract in a single code block, followed by a short explanation of each function and any security considerations.

Guardrails — Do not claim the contract is audited or production-ready; recommend a professional audit before mainnet deployment. Do not invent Solidity syntax or features that don't exist in {{solidity_version}}. Flag any assumption made about requirements not specified.

Example — {{contract_requirements}}: store a message publicly readable by everyone, writable only by the deployer, with an update counter; {{solidity_version}}: 0.8.x.