$npx -y skills add Uniswap/uniswap-ai --skill deployerDeploy CCA (Continuous Clearing Auction) smart contracts using the Factory pattern. Use when user says "deploy auction", "deploy cca", "factory deployment", or wants to deploy a configured auction.
| 1 | # CCA Deployment |
| 2 | |
| 3 | Deploy Continuous Clearing Auction (CCA) smart contracts using the `ContinuousClearingAuctionFactory` with CREATE2 for consistent addresses across chains. |
| 4 | |
| 5 | > **Runtime Compatibility:** This skill uses `AskUserQuestion` for interactive prompts. If `AskUserQuestion` is not available in your runtime, collect the same parameters through natural language conversation instead. |
| 6 | |
| 7 | ## Instructions for Claude Code |
| 8 | |
| 9 | When the user invokes this skill, guide them through the CCA deployment process with appropriate safety warnings and validation. |
| 10 | |
| 11 | ### Pre-Deployment Requirements |
| 12 | |
| 13 | Before proceeding with deployment, you MUST: |
| 14 | |
| 15 | 1. **Show educational disclaimer** and get user acknowledgment |
| 16 | 2. **Validate configuration file** if provided |
| 17 | 3. **Verify factory address** for the target network |
| 18 | 4. **Confirm deployment parameters** with user |
| 19 | |
| 20 | ### Deployment Workflow |
| 21 | |
| 22 | 1. **Show Educational Disclaimer** (REQUIRED) |
| 23 | 2. **Load or Request Configuration** |
| 24 | 3. **Validate Configuration** |
| 25 | 4. **Display Deployment Plan** |
| 26 | 5. **Get User Confirmation** |
| 27 | 6. **Provide Deployment Commands** |
| 28 | 7. **Post-Deployment Steps** |
| 29 | |
| 30 | --- |
| 31 | |
| 32 | ## ⚠️ Educational Use Disclaimer |
| 33 | |
| 34 | **IMPORTANT: Before proceeding with deployment, you must acknowledge:** |
| 35 | |
| 36 | This tool and all deployment instructions are provided **for educational purposes only**. AI-generated deployment commands may contain errors or security vulnerabilities. |
| 37 | |
| 38 | **You must:** |
| 39 | |
| 40 | 1. ✅ **Review all configurations carefully** before deploying |
| 41 | 2. ✅ **Verify all parameters** (addresses, pricing, schedules) are correct |
| 42 | 3. ✅ **Test on testnets first** before deploying to mainnet |
| 43 | 4. ✅ **Audit your contracts** before deploying with real funds |
| 44 | |
| 45 | **Use AskUserQuestion to confirm the user acknowledges these warnings before proceeding with deployment steps.** |
| 46 | |
| 47 | ### Input Validation Rules |
| 48 | |
| 49 | Before interpolating ANY user-provided value into forge/cast commands or deployment scripts: |
| 50 | |
| 51 | - **Ethereum addresses**: MUST match `^0x[a-fA-F0-9]{40}$` — reject otherwise |
| 52 | - **Chain IDs**: MUST be from the supported chains list (1, 130, 143, 1301, 8453, 42161, 11155111) |
| 53 | - **Numeric values** (supply, prices, blocks, chain IDs): MUST be non-negative and match `^[0-9]+\.?[0-9]*$` |
| 54 | - **REJECT** any input containing shell metacharacters: `;`, `|`, `&`, `$`, `` ` ``, `(`, `)`, `>`, `<`, `\`, `'`, `"`, newlines |
| 55 | - **Never** pass raw user input directly to shell commands without validation |
| 56 | |
| 57 | ### ⚠️ Permission Safety |
| 58 | |
| 59 | **Do NOT auto-approve `Bash(forge:*)` or `Bash(cast:*)` in your Claude Code settings.** Always require per-invocation approval for commands that spend gas or broadcast transactions. The PreToolUse hooks in `.claude/hooks/` provide programmatic validation as a safety net, but user approval per command is the primary control. |
| 60 | |
| 61 | --- |
| 62 | |
| 63 | ## 🔐 Private Key Security |
| 64 | |
| 65 | **CRITICAL: Handling private keys safely is essential for secure deployments.** |
| 66 | |
| 67 | ### ⚠️ Never Do These |
| 68 | |
| 69 | - ❌ **Never** store private keys in git repositories or config files |
| 70 | - ❌ **Never** paste private keys directly in command line (visible in shell history) |
| 71 | - ❌ **Never** share private keys or store them in shared environments |
| 72 | - ❌ **Never** use mainnet private keys on untrusted computers |
| 73 | - ❌ **Never** use `--private-key` flag (blocked by PreToolUse hook) |
| 74 | |
| 75 | ### ✅ Recommended Practices |
| 76 | |
| 77 | #### Option 1: Hardware Wallets (Most Secure) |
| 78 | |
| 79 | Use Ledger or Trezor hardware wallets with the `--ledger` flag: |
| 80 | |
| 81 | ```bash |
| 82 | forge script script/Example.s.sol:ExampleScript \ |
| 83 | --rpc-url $RPC_URL \ |
| 84 | --broadcast \ |
| 85 | --ledger |
| 86 | ``` |
| 87 | |
| 88 | #### Option 2: Encrypted Keystore |
| 89 | |
| 90 | Create an encrypted keystore with `cast wallet import`: |
| 91 | |
| 92 | ```bash |
| 93 | # Import private key to encrypted keystore (one-time setup) |
| 94 | cast wallet import deployer --interactive |
| 95 | |
| 96 | # Use keystore for deployment |
| 97 | forge script script/Example.s.sol:ExampleScript \ |
| 98 | --rpc-url $RPC_URL \ |
| 99 | --broadcast \ |
| 100 | --account deployer \ |
| 101 | --sender $DEPLOYER_ADDRESS |
| 102 | ``` |
| 103 | |
| 104 | #### Option 3: Environment Variables (For Testing Only) |
| 105 | |
| 106 | If using environment variables, ensure they are: |
| 107 | |
| 108 | - Set in a secure `.env` file (never committed to git) |
| 109 | - Loaded via `source .env` or `dotenv` |
| 110 | - Only used on trusted, secure computers |
| 111 | - Use testnet keys for development |
| 112 | |
| 113 | **Example:** |
| 114 | |
| 115 | ```bash |
| 116 | # .env file (add to .gitignore) |
| 117 | PRIVATE_KEY=0x... |
| 118 | RPC_URL=https://... |
| 119 | |
| 120 | # Load environment |
| 121 | source .env |
| 122 | |
| 123 | # Deploy (use encrypted keystore instead of --private-key) |
| 124 | cast wallet import deployer --interactive |
| 125 | forge script ... --account deployer --sender $DEPLOYER_ADDRESS |
| 126 | ``` |
| 127 | |
| 128 | ### Testnet First |
| 129 | |
| 130 | **Always test on testnets before mainnet:** |
| 131 | |
| 132 | - Sepolia (testnet): Get free ETH from faucets |
| 133 | - Base Sepolia: Free ETH for testing on B |