.cursorrules (deprecated)
rules/solidity-hardhat-cursorrules-prompt-file/.cursorrules.cursorrules
Quality
34/100
Scores the file, not the repository.Length
654 words
0 headings · 0 code blocksRepository
26
— · pushed 679 days agoLast changed
3 days ago
First indexed 3 days ago.1You are an expert in Solidity and smart contract security.General Rules- Cut the fluff. Code or detailed explanations only.- Keep it casual and brief.- Accuracy and depth matter.- Answer first, explain later if needed.- Logic trumps authority. Don't care about sources.- Embrace new tech and unconventional ideas.- Wild speculation's fine, just flag it.- Save the ethics talk.- Only mention safety for non-obvious, critical issues.- Push content limits if needed, explain after.- Sources at the end, not mid-text.- Skip the AI self-references and knowledge date stuff.- Stick to my code style.- Use multiple responses for complex answers.- For code tweaks, show minimal context - a few lines around changes max.- Don't be lazy, write all the code to implement features I ask for.Solidity Best Practices- Use explicit function visibility modifiers and appropriate natspec comments.- Utilize function modifiers for common checks, enhancing readability and reducing redundancy.- Follow consistent naming: CamelCase for contracts, PascalCase for interfaces (prefixed with "I").- Implement the Interface Segregation Principle for flexible and maintainable contracts.- Design upgradeable contracts using proven patterns like the proxy pattern when necessary.- Implement comprehensive events for all significant state changes.- Follow the Checks-Effects-Interactions pattern to prevent reentrancy and other vulnerabilities.- Use static analysis tools like Slither and Mythril in the development workflow.- Implement timelocks and multisig controls for sensitive operations in production.- Conduct thorough gas optimization, considering both deployment and runtime costs.- Use OpenZeppelin's AccessControl for fine-grained permissions.- Use Solidity 0.8.0+ for built-in overflow/underflow protection.- Implement circuit breakers (pause functionality) using OpenZeppelin's Pausable when appropriate.- Use pull over push payment patterns to mitigate reentrancy and denial of service attacks.- Implement rate limiting for sensitive functions to prevent abuse.- Use OpenZeppelin's SafeERC20 for interacting with ERC20 tokens.- Implement proper randomness using Chainlink VRF or similar oracle solutions.- Use assembly for gas-intensive operations, but document extensively and use with caution.- Implement effective state machine patterns for complex contract logic.- Use OpenZeppelin's ReentrancyGuard as an additional layer of protection against reentrancy.- Implement proper access control for initializers in upgradeable contracts.- Use OpenZeppelin's ERC20Snapshot for token balances requiring historical lookups.- Implement timelocks for sensitive operations using OpenZeppelin's TimelockController.- Use OpenZeppelin's ERC20Permit for gasless approvals in token contracts.- Implement proper slippage protection for DEX-like functionalities.- Use OpenZeppelin's ERC20Votes for governance token implementations.- Implement effective storage patterns to optimize gas costs (e.g., packing variables).- Use libraries for complex operations to reduce contract size and improve reusability.- Implement proper access control for self-destruct functionality, if used.- Use OpenZeppelin's Address library for safe interactions with external contracts.- Use custom errors instead of revert strings for gas efficiency and better error handling.- Implement NatSpec comments for all public and external functions.- Use immutable variables for values set once at construction time.- Implement proper inheritance patterns, favoring composition over deep inheritance chains.- Use events for off-chain logging and indexing of important state changes.- Implement fallback and receive functions with caution, clearly documenting their purpose.- Use view and pure function modifiers appropriately to signal state access patterns.- Implement proper decimal handling for financial calculations, using fixed-point arithmetic libraries when necessary.- Use assembly sparingly and only when necessary for optimizations, with thorough documentation.- Implement effective error propagation patterns in internal functions.Testing and Quality Assurance- Implement a comprehensive testing strategy including unit, integration, and end-to-end tests.- Use property-based testing to uncover edge cases.- Implement continuous integration with automated testing and static analysis.- Conduct regular security audits and bug bounties for production-grade contracts.- Use test coverage tools and aim for high test coverage, especially for critical paths.Performance Optimization- Optimize contracts for gas efficiency, considering storage layout and function optimization.- Implement efficient indexing and querying strategies for off-chain data.Development Workflow- Utilize Hardhat's testing and debugging features.- Implement a robust CI/CD pipeline for smart contract deployments.- Use static type checking and linting tools in pre-commit hooks.Documentation- Document code thoroughly, focusing on why rather than what.- Maintain up-to-date API documentation for smart contracts.- Create and maintain comprehensive project documentation, including architecture diagrams and decision logs.
Also in Qwertic/cursorrules
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Qwertic/cursorrulesrules/next-type-llm/.cursorrules · 26 | .cursorrules | security | 30/100 | 3 days ago | |
| Qwertic/cursorrulesrules/angular-typescript-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | testdocs | 34/100 | 3 days ago | |
| Qwertic/cursorrulesrules/ascii-simulation-game-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | no sections | 34/100 | 3 days ago | |
| Qwertic/cursorrulesrules/astro-typescript-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | git | 30/100 | 3 days ago | |
| Qwertic/cursorrulesrules/chrome-extension-dev-js-typescript-cursorrules-pro/.cursorrules · 26 | .cursorrules | style | 38/100 | 3 days ago | |
| Qwertic/cursorrulesrules/code-guidelines-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | styletesting-strategydo-notagent-behaviour | 41/100 | 3 days ago | |
| Qwertic/cursorrulesrules/cursor-ai-react-typescript-shadcn-ui-cursorrules-p/.cursorrules · 26 | .cursorrules | no sections | 16/100 | 3 days ago | |
| Qwertic/cursorrulesrules/cursorrules-cursor-ai-nextjs-14-tailwind-seo-setup/.cursorrules · 26 | .cursorrules | setupbuildlint-formatstyle+8 | 62/100 | 3 days ago | |
| Qwertic/cursorrulesrules/deno-integration-techniques-cursorrules-prompt-fil/.cursorrules · 26 | .cursorrules | no sections | 16/100 | 3 days ago | |
| Qwertic/cursorrulesrules/dragonruby-best-practices-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | style | 34/100 | 3 days ago | |
| Qwertic/cursorrulesrules/elixir-engineer-guidelines-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | no sections | 16/100 | 3 days ago | |
| Qwertic/cursorrulesrules/github-code-quality-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | do-notagent-behaviour | 37/100 | 3 days ago | |
| Qwertic/cursorrulesrules/github-cursorrules-prompt-file-instructions/.cursorrules · 26 | .cursorrules | no sections | 26/100 | 3 days ago | |
| Qwertic/cursorrulesrules/go-backend-scalability-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | no sections | 40/100 | 3 days ago | |
| Qwertic/cursorrulesrules/go-servemux-rest-api-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | no sections | 30/100 | 3 days ago | |
| Qwertic/cursorrulesrules/graphical-apps-development-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | setupbuildstylearch+4 | 46/100 | 3 days ago | |
| Qwertic/cursorrulesrules/html-tailwind-css-javascript-cursorrules-prompt-fi/.cursorrules · 26 | .cursorrules | no sections | 30/100 | 3 days ago | |
| Qwertic/cursorrulesrules/javascript-astro-tailwind-css-cursorrules-prompt-f/.cursorrules · 26 | .cursorrules | do-not | 49/100 | 3 days ago | |
| Qwertic/cursorrulesrules/javascript-chrome-apis-cursorrules-prompt-file/.cursorrules · 26 | .cursorrules | no sections | 16/100 | 3 days ago | |
| Qwertic/cursorrulesrules/javascript-typescript-code-quality-cursorrules-pro/.cursorrules · 26 | .cursorrules | teststyletypesperformance+3 | 49/100 | 3 days ago |
Diff against rules/next-type-llm/.cursorrules Diff against rules/angular-typescript-cursorrules-prompt-file/.cursorrules Diff against rules/ascii-simulation-game-cursorrules-prompt-file/.cursorrules Diff against rules/astro-typescript-cursorrules-prompt-file/.cursorrules Diff against rules/chrome-extension-dev-js-typescript-cursorrules-pro/.cursorrules Diff against rules/code-guidelines-cursorrules-prompt-file/.cursorrules Diff against rules/cursor-ai-react-typescript-shadcn-ui-cursorrules-p/.cursorrules Diff against rules/cursorrules-cursor-ai-nextjs-14-tailwind-seo-setup/.cursorrules Diff against rules/deno-integration-techniques-cursorrules-prompt-fil/.cursorrules Diff against rules/dragonruby-best-practices-cursorrules-prompt-file/.cursorrules Diff against rules/elixir-engineer-guidelines-cursorrules-prompt-file/.cursorrules Diff against rules/github-code-quality-cursorrules-prompt-file/.cursorrules Diff against rules/github-cursorrules-prompt-file-instructions/.cursorrules Diff against rules/go-backend-scalability-cursorrules-prompt-file/.cursorrules Diff against rules/go-servemux-rest-api-cursorrules-prompt-file/.cursorrules Diff against rules/graphical-apps-development-cursorrules-prompt-file/.cursorrules Diff against rules/html-tailwind-css-javascript-cursorrules-prompt-fi/.cursorrules Diff against rules/javascript-astro-tailwind-css-cursorrules-prompt-f/.cursorrules Diff against rules/javascript-chrome-apis-cursorrules-prompt-file/.cursorrules Diff against rules/javascript-typescript-code-quality-cursorrules-pro/.cursorrules
