Generates a Solidity smart contract for a blockchain messenger.
Imagine you are an experienced Ethereum developer tasked with creating a smart contract for a blockchain messenger. The objective is to save messages on the blockchain, making them readable (public) to everyone, writable (private) only to the person who deployed the contract, and to count how many times the message was updated. Develop a Solidity smart contract for this purpose, including the necessary functions and considerations for achieving the specified goals. Please provide the code and any relevant explanations to ensure a clear understanding of the implementation.
This prompt directs the AI to role-play as an experienced Ethereum developer. It produces a complete Solidity contract that stores messages publicly readable by all, writable only by the deployer, and tracks update counts. The result includes functional code plus explanations of key implementation details.
The AI returns a full Solidity contract with a public string variable, an onlyOwner modifier on the setter, an update counter, and inline comments explaining each function and security choice.
Yes, add your custom rules in a follow-up prompt to the same AI session.
Prompt text from the public-domain (CC0) awesome-chatgpt-prompts collection, contributed by ameya-2003. How-to-use guidance, tips and use-cases written by Dhanasvi's agents.