# Greenfield prompts (Sepolia confidential apps)

Copy **one** of the prompts below into a **new Cursor chat** after opening your project folder. Install skills from this repo into **`.cursor/skills`** (run `scripts/install-cursor-skills.ps1` or `.sh`) so **`@.cursor`** / agent context can resolve **`skills/*`**.

---

## Prompt A — ERC-7984 shield / unshield / transfer (tabbed UI)

Use this for a minimal **Vite + React + TypeScript** Sepolia dApp: deploy underlying + wrapper, then shield, unshield, decrypt balance, and confidential transfer.

### Paste into Cursor

```
Build a Sepolia React app using zama-react-zama-sdk patterns: deploy underlying + wrapper per skills, then shield and unshield via that wrapper, decrypt and display balance, and send confidential transfers, with both contract addresses coming only from the user’s deploy output / .env (never hardcoded example addresses).

Use @.cursor skills from this repo. Use a clear, accessible React UI: readable typography, contrast, and responsive layout.

Layout: a horizontal tab bar with exactly these tabs in order — Shield | Unshield | Decrypt | Confidential send — each tab’s content in a focused panel with visible loading and error states for wallet / relayer flows.
```

### Skills to follow (reference)

| Order | Skill | Role |
|-------|--------|------|
| 1 | `zama-hardhat-fhevm-contracts` | `MockUSDC.excerpt.sol`, `ConfidentialTokenWrapper.wrapper.excerpt.sol`; deploy **underlying first**, then **wrapper** |
| 2 | `zama-fhevm-hardhat-workflow` | `compile`, Sepolia deploy, `.env` for `PRIVATE_KEY` / RPC only |
| 3 | `zama-react-zama-sdk` | `ZamaProvider`, `RelayerWeb`, `ViemSigner`, hooks (`useShield`, `useUnshield`, `useConfidentialBalance`, `useConfidentialTransfer`, …), COOP/COEP |
| 4 | `zama-erc7984-confidential-tokens` | Wrap / unwrap / transfer mental model; env addresses only |
| 5 | `zama-relayer-integration-hub` | Browser vs Node; Sepolia `RelayerWeb` |

**Hub:** `zama-fhevm-developer-hub` — *One prompt → full confidential ERC-7984 dApp*.

### Env (no hardcoded `0x` in source)

- `VITE_SEPOLIA_UNDERLYING_ADDRESS` — deployed MockUSDC (or chosen underlying)
- `VITE_SEPOLIA_CONFIDENTIAL_TOKEN_ADDRESS` — deployed ERC-7984 wrapper
- `VITE_SEPOLIA_RPC_URL` — public Sepolia RPC as needed

---

## Prompt B — FHE voting (encrypted tallies + public decrypt)

Use this for a **SimpleVoting-style** flow: encrypted votes + proofs, `FHE` tallies in Solidity, post-end **public decrypt** to reveal results.

### Paste into Cursor

```
Build a Sepolia FHE voting dApp: voters submit encrypted votes (encrypted inputs + proofs), the contract updates encrypted tallies in Solidity, and after the poll ends you reveal the result using the project’s public-decrypt flow. Follow the SimpleVoting-style patterns in .cursor/skills (input proofs, FHE ops, ACL, public decryption). Frontend: Vite + React, RelayerWeb and @zama-fhe/sdk with ViemSigner (React SDK optional). Contract address only from deploy or .env, never hardcoded.

Use @.cursor skills from this repo. Use a clear, accessible UI suitable for a voting flow (readable labels, status after vote, errors surfaced in plain language).
```

### Skills to follow (reference)

| Order | Skill | Role |
|-------|--------|------|
| 1 | `zama-fhevm-input-proofs` | `FHE.fromExternal`, proofs for votes |
| 2 | `zama-fhevm-solidity-operations` | `FHE.select`, tallies |
| 3 | `zama-fhevm-access-control` | `FHE.allowThis`, `FHE.allow` for creator / decrypt path |
| 4 | `zama-fhevm-public-decryption` | `makePubliclyDecryptable`, `checkSignatures`, callback |
| 5 | `zama-hardhat-fhevm-contracts` / `zama-fhevm-hardhat-workflow` | Hardhat, deploy voting contract |
| 6 | `zama-relayer-integration-hub` + SDK skills | Encrypt votes client-side; relayer for public decrypt where applicable |
| 7 | `zama-openzeppelin-confidential-contracts` | `SimpleVoting.contract.excerpt.sol` pattern |

**Example excerpt in repo:** `skills/zama-openzeppelin-confidential-contracts/examples/SimpleVoting.contract.excerpt.sol`, `skills/zama-fhevm-public-decryption/examples/SimpleVoting-reveal.excerpt.sol`.

### Env (no hardcoded voting contract)

- e.g. `VITE_SEPOLIA_VOTING_ADDRESS` — only after user deploys; document in README.

---

## Shared rules for both prompts

1. **Never** commit **private keys**; use **`.env`** / **`.env.example`** only.
2. **Never** paste example third-party **`0x`** deployment addresses into app source — only values from the user’s deploy or env.
3. Re-run **`scripts/install-cursor-skills.ps1`** after changing **`skills/`** so **`.cursor/skills`** stays in sync.
