solidity-react-blockchain-apps-cursorrules-prompt- — Cursor rule
This Cursor rule guides Solidity contracts and React apps that connect to blockchain services. Use it when reviewing contract safety or Web3 frontend code.
.cursor/rules/solidity-react-blockchain-apps-cursorrules-prompt-.mdcWhat solidity-react-blockchain-apps-cursorrules-prompt- does
The rule gives Cursor a set of practices for Solidity contracts and React code that handles wallets, providers, and transactions. It asks for explicit function visibility, access control, and NatSpec documentation. Common building blocks such as ownership, multisig, and timelocks should use OpenZeppelin contracts.
For critical contract behavior, it recommends Slither, Mythril, and property-based tests. Gas work focuses on storage layout, function visibility, and unnecessary writes. The guidance also covers pull payments, event logs, defensive error handling, and typed Web3 frontend interactions.
The rule targets **/*, while alwaysApply is false, so it is not forced into every request. In Cursor, place the file at .cursor/rules/solidity-react-blockchain-apps-cursorrules-prompt-.mdc. Critical contract paths should have the listed security checks before relying on this guidance.
What it helps with
- review a Solidity contract for access-control issues
- inspect storage writes that raise gas usage
- document contract functions with NatSpec
- type wallet and transaction calls in a React frontend
- test critical contract behavior with Slither and Mythril
Example prompts for the agent
- Review this Solidity contract for function visibility, access control, and defensive error handling.
- Find unnecessary storage writes in this contract and suggest gas-focused changes.
- Check the React code that handles wallets and transactions for explicit types and unsafe calls.
How to install solidity-react-blockchain-apps-cursorrules-prompt-
Manually: put the files in place
.cursor/rules/solidity-react-blockchain-apps-cursorrules-prompt-.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/solidity-react-blockchain-apps-cursorrules-prompt-.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/solidity-react-blockchain-apps-cursorrules-prompt-.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/solidity-react-blockchain-apps-cursorrules-prompt-.mdManually: put the files in place
.clinerules/solidity-react-blockchain-apps-cursorrules-prompt-.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about solidity-react-blockchain-apps-cursorrules-prompt-
How do I install solidity-react-blockchain-apps-cursorrules-prompt- in Cursor?
Create the rule file at .cursor/rules/solidity-react-blockchain-apps-cursorrules-prompt-.mdc and add the rule content to it.
What does solidity-react-blockchain-apps-cursorrules-prompt- do?
It guides Cursor while building Solidity contracts and React Blockchain apps. The guidance covers contract security, OpenZeppelin primitives, gas review, and typed Web3 interactions.
How is this rule applied across a project?
Its file pattern is **/*, but alwaysApply is false. That means the rule matches the project files without being forced into every request.
Source text
solidity-react-blockchain-apps-cursorrules-prompt-.mdc · CC0-1.0
--- description: "Cursor rules for Solidity development with React Blockchain apps integration." globs: **/* alwaysApply: false --- Solidity React Blockchain Apps Guidelines - Prioritize secure Solidity smart contracts with explicit visibility, access control, and clear NatSpec documentation. - Use established security tooling such as Slither, Mythril, and property-based tests for critical contract behavior. - Prefer OpenZeppelin contracts for common primitives such as ownership, access control, multisig, and timelocks. - Optimize gas deliberately by reviewing storage layout, function visibility, and unnecessary writes. - Use pull-payment patterns, event logging, and defensive error handling for production-grade contracts. - Keep Web3 frontend code type-safe and explicit when interacting with wallets, providers, and transactions.
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules