Jbusma one-click-crypto .cursorrules file for JavaScript

// ONE CLICK CHECKOUT CRYPTO - THE 10 COMMANDMENTS

1. THOU SHALT DELETE MORE THAN ADD
   - Every deleted line is worth 100 points
   - Every added line costs 10 points
   - Strive for minimal, efficient code

2. THOU SHALT OPTIMIZE FOR GAS ABOVE ALL
   - Every transaction must be gas-optimized
   - Use minimal storage slots
   - Batch operations when possible

3. THOU SHALT KEEP IT SINGLE-TRANSACTION
   - One tx for token transfer + shipping info
   - One tx for account creation (sponsored)
   - One tx for token swaps if needed

4. THOU SHALT NOT TRUST EXTERNAL CALLS
   - Validate all inputs rigorously
   - Follow CEI pattern strictly
   - Guard against reentrancy

5. THOU SHALT TEST COMPREHENSIVELY
   - Every function must have unit tests
   - Every flow must have integration tests
   - Every edge case must be covered

6. THOU SHALT SPONSOR WISELY
   - Paymaster must validate operations carefully
   - Monitor and limit gas sponsorship
   - Protect against economic attacks

7. THOU SHALT USE LATEST STANDARDS
   - No deprecated ethers.js calls
   - Follow EIP-4337 strictly
   - Use current security best practices

8. THOU SHALT KEEP CONTRACTS FOCUSED
   - Account.sol handles only essential wallet logic
   - ProxyFactory.sol only manages deployments
   - Paymaster.sol only handles gas sponsorship

9. THOU SHALT EMIT CLEAR EVENTS
   - Log all important state changes
   - Include indexed parameters for efficiency
   - Make events easily trackable off-chain

10. THOU SHALT DOCUMENT PRECISELY
    - Every function must have NatSpec
    - Every parameter must be explained
    - Every architectural decision must be justified

// ESSENTIAL COMMANDS

TEST:
- Run all tests: npx hardhat test
- Run integration tests: npx hardhat test test/integration/*.js
- Run specific test: npx hardhat test test/path/to/test.js

DEPLOY:
- Local deployment: npx hardhat deploy
- Testnet deployment: npx hardhat deploy --network goerli
- Production deployment: npx hardhat deploy --network mainnet
- Redeploy contracts: npx hardhat redeploy
- Clean deployments: npx hardhat clean-deployments

DEVELOPMENT:
- Start local node: npx hardhat node
- Restart node (clean): npx hardhat restart-node
- Compile contracts: npx hardhat compile
golang
javascript
rest-api
rust
solidity

First Time Repository

JavaScript

Languages:

JavaScript: 29.3KB
Solidity: 12.2KB
Created: 12/30/2024
Updated: 1/8/2025

All Repositories (1)