What problem does it solve? Testing FHE-encrypted contracts is error-prone: mock environments diverge from production gas costs, decrypt flows require correct on-chain/off-chain pairing, and forgotten ACL permissions cause silent failures. This Skill guides you through writing correct tests for confidential CoFHE code. ## Core Features & Use Cases - Dual Framework Support: Choose between Foundry mocks (cofhe-mock-contracts) for fast Solidity unit tests or the Hardhat plugin (@cofhe/hardhat-plugin) for end-to-end SDK flows. - Decrypt Flow Testing: Test the full encrypt → submit → decryptForTx/decryptForView → on-chain verify round-trip with correct permit pairing. - Hard Rules Enforcement: Avoid common pitfalls like unseeded randomness, missing allowThis calls, untested FHE.select branches, and mock-vs-prod gas divergence. - Use Case: You wrote a confidential token contract using FHE.sol and need .t.sol unit tests plus a Hardhat E2E test that encrypts inputs, triggers settlement, and verifies decrypted results on-chain. ## Quick Start Write Foundry and Hardhat tests for my confidential contract that imports FHE.sol, covering encrypted inputs and the decrypt settlement flow.