Skip to main content
prompt GP ChatGPT

Solidity Smart Contract taste — ChatGPT prompt: what it does

The Solidity Smart Contract taste prompt for ChatGPT, Claude.ai, and Claude Code sets security standards for writing Solidity smart contracts. It helps protocol engineers implement best practices during development.

CC0-1.0 ★ 178,201 updated 2026-10-24

Open on GitHub

What Solidity Smart Contract taste does

The prompt guides the model during code generation or auditing by enforcing security principles like using custom errors instead of revert strings, pinning compiler versions, and checking msg.sender rather than tx.origin. It covers best practices for external calls, multisig management for privileged roles, and mitigating risks with upgradeable proxies.

The system focuses on replacing hand-rolled standards with audited OpenZeppelin contracts. It mandates fuzz testing in Foundry and the integration of static analyzers like Slither into CI pipelines to block insecure pull requests.

What it helps with

  • pin an exact Solidity compiler version
  • setup Foundry for testing
  • prevent vulnerabilities in external calls
  • secure privileged role management
  • bound loops over user-controlled arrays

Example prompts for the agent

  • Analyze this smart contract against Solidity Smart Contract taste standards.
  • Check if I am using SafeERC20 in this file following the security guidelines.
  • Suggest improvements for this contract based on the security prompt.

How to install Solidity Smart Contract taste

How to use

Paste the text at the start of a chat or into project instructions

Questions about Solidity Smart Contract taste

How to install Solidity Smart Contract taste in Claude Code?

Create a file at .claude/commands/prompts.csv.md in your project root and paste the prompt content into it.

What does Solidity Smart Contract taste do?

The prompt provides a checklist of security standards for Solidity development to help you write more secure and gas-efficient smart contracts.

What is required for Solidity Smart Contract taste?

You need standard development tools like Foundry for testing and Slither for static analysis to effectively implement the security requirements.

Source text

prompts.csv · CC0-1.0
# Solidity Smart Contract taste of a security-first protocol engineer
- Pin an exact recent compiler version with `pragma solidity 0.8.x;` instead of a floating caret range. Confidence: 0.90
- Build and test with Foundry, writing tests in Solidity, and keep Hardhat only where a plugin is truly needed. Confidence: 0.80
- Reuse audited OpenZeppelin contracts for tokens, access control and upgrades instead of hand-rolling standards. Confidence: 0.95
- Follow checks-effects-interactions in every function that makes external calls, and add a reentrancy guard where state is shared. Confidence: 0.95
- Use custom errors over revert strings for clearer failures and lower gas. Confidence: 0.85
- Emit an event for every state change that off-chain systems need to track, with indexed fields for common filters. Confidence: 0.85
- Prefer pull payments, where users withdraw funds, over pushing ETH to many addresses in a loop. Confidence: 0.90
- Never use `tx.origin` for authorization; check `msg.sender` against explicit roles. Confidence: 1.00
- Keep privileged roles behind a multisig and a timelock, and document every admin power in the README. Confidence: 0.90
- Avoid upgradeable proxies unless upgrades are a real requirement; when used, follow storage layout rules and test upgrades explicitly. Confidence: 0.80
- Use `SafeERC20` for token transfers so non-standard tokens that return no boolean do not break accounting. Confidence: 0.90
- Never trust a single spot price from an AMM pool; use time-weighted or decentralized oracles with staleness checks. Confidence: 0.90
- Bound every loop over user-controlled arrays to avoid gas-limit denial of service. Confidence: 0.90
- Write fuzz tests and stateful invariant tests for core accounting, not just example-based unit tests. Confidence: 0.90
- Run Slither and other static analyzers in CI, and treat new high-severity findings as merge blockers. Confidence: 0.85
- Mark functions `external` when they are not called internally, and make visibility explicit on every function and state variable. Confidence: 0.80
- Use `immutable` and `constant` for values fixed at deploy time to save gas and signal intent. Confidence: 0.85
- Document public functions with NatSpec comments describing parameters, return values and failure conditions. Confidence: 0.75
- Optimize gas only after correctness is proven, and never trade readability for micro-savings in security-critical paths. Confidence: 0.85
- Deploy with scripted, reproducible deployments, verify source on the block explorer, and record addresses per network in the repo. Confidence: 0.85
- Get an independent audit and run a bug bounty before holding meaningful user funds on mainnet. Confidence: 0.90

© f · CC0-1.0 · f/prompts.chat

Similar prompts

All prompts for Security →
smart-contract-auditor davila7 smart-contract-auditor audits EVM and Solidity smart contracts for exploits, logic flaws, and economic attack vectors. Useful for pre-deployment reviews and vulnerability reports. CX Codex 701installs analyzing-ethereum-smart-contract-vulnerabilities mahipal analyzing-ethereum-smart-contract-vulnerabilities runs static and symbolic analysis on Solidity smart contracts using Slither and Mythril. Catches reentrancy, integer overflows, and access flaws before deployment. CX Codex +1 398installs solidity-foundry-cursorrules-prompt-file PatrickJS solidity-foundry-cursorrules-prompt-file directs Cursor to generate secure Solidity smart contracts and implement property-based tests using the Foundry toolkit. CX Codex +1 ★ 41,178repo stars smart-contract-specialist davila7 The smart-contract-specialist subagent for Claude Code advises on proxy patterns, upgradeable storage, and module boundaries; implementation goes to blockchain-developer, audits to smart-contract-auditor. CX Codex 708installs secure-workflow-guide trailofbits secure-workflow-guide guides smart contracts through Trail of Bits' 5-step security audit on check-in or before deployment. It runs static analysis, generates visual charts, and prepares fuzzing tests. CX Codex +1 8,000installs solidity-security Seth Hobson The solidity-security skill helps write and audit Solidity contracts against common vulnerabilities. Use it for DeFi work, security checks, and audit preparation. CX Codex +1 15,382installs

From the same set218

The whole set →
Tailwind CSS taste Tailwind CSS taste is a prompt for ChatGPT, Claude.ai, and Claude Code that sets utility-first styling rules, design tokens, and bans arbitrary pixel sizes in Tailwind CSS code. GP ChatGPT ★ 178,201repo stars Vite Frontend Tooling taste The Vite Frontend Tooling taste ChatGPT prompt sets preferences for building frontend projects with Vite. It covers app setup, type checks, tests, and release builds. GP ChatGPT ★ 178,201repo stars Linux Server Hardening taste Linux Server Hardening taste — a prompt for ChatGPT provides an operations engineering ruleset for hardening Linux servers. It guides base image setup, SSH access policies, and automated configuration via Ansible or cloud-init. GP ChatGPT ★ 178,201repo stars Database Schema Design taste The Database Schema Design taste ChatGPT prompt sets rules for designing relational database schemas. It covers keys, constraints, indexes, and data storage. GP ChatGPT ★ 178,201repo stars Pandas Data Analysis taste The Pandas Data Analysis taste prompt for ChatGPT and Claude.ai offers a set of best practices for working with the Pandas library. It helps apply principles of reproducible data analysis. GP ChatGPT ★ 178,201repo stars Kafka Streaming taste Kafka Streaming taste is a prompt for ChatGPT, Claude.ai, and Claude Code that defines Kafka streaming architecture and design rules. GP ChatGPT ★ 178,201repo stars Helm Chart taste The Helm Chart taste ChatGPT prompt sets criteria for designing Helm charts. It helps review templates, security settings, and chart tests before release. GP ChatGPT ★ 178,201repo stars Prisma ORM taste Prisma ORM taste — a prompt for ChatGPT and Claude Code establishes pragmatic guidelines for database workflows with Prisma ORM. Directs model schema design, migrations, and query patterns. GP ChatGPT ★ 178,201repo stars

Project sponsors

Companies that keep this analytics open