Skip to main content
The create-inco-app CLI allows you to create a new full-stack confidential dApp with a Next.js frontend, Solidity smart contracts, and the Inco SDK. It is the easiest way to get started building on Inco.

Basic usage

npx create-inco-app@latest
On installation, you’ll see the following prompts:
What is your project named? my-app
Which chain would you like to use? EVM
Which contract framework would you like to use? Foundry / Hardhat
Which wallet provider would you like to use? RainbowKit / Privy / Dynamic / Reown / Para
After the prompts, create-inco-app will create a folder with your project name and install the required dependencies.

Reference

npx create-inco-app@latest [project-name] [options]
The following options are available:
OptionDescription
-h or --helpShow all available options
-v or --versionOutput the version number
-f or --framework <value>Contract framework (foundry or hardhat)
-w or --wallet <value>Wallet provider (rainbowkit, privy, dynamic, reown, para)
-c or --chain <value>Chain type (evm)
-y or --yesSkip prompts, use defaults
--installAuto-install dependencies after scaffolding
--gitInitialize a git repository
--use-npmExplicitly tell the CLI to bootstrap using npm
--use-pnpmExplicitly tell the CLI to bootstrap using pnpm
--use-yarnExplicitly tell the CLI to bootstrap using Yarn
--use-bunExplicitly tell the CLI to bootstrap using Bun

Project Structure

The scaffolded project is a monorepo with two workspaces:
my-app/
├── contracts/          # Solidity contracts (Foundry or Hardhat)
│   ├── src/            # Contract source files
│   ├── test/           # Contract tests
│   └── docker-compose.yml  # Local node + covalidator
└── frontend/           # Next.js app (pre-configured for Base Sepolia)
    ├── components/
    │   ├── Providers.tsx    # Wallet provider setup
    │   └── ConfLottery.tsx  # Example dApp component
    └── hooks/
        └── useConfLottery.ts  # Inco SDK integration
The frontend is pre-configured for Base Sepolia (chain ID 84532). All wallet providers point to Base Sepolia by default — no chain configuration changes are needed.

Examples

With default options

npx create-inco-app@latest

With Foundry and RainbowKit

npx create-inco-app@latest my-app --framework foundry --wallet rainbowkit --chain evm --yes

With Hardhat and Para

npx create-inco-app@latest my-app --framework hardhat --wallet para --chain evm --yes

Test Contracts

No Docker needed — uses IncoTest mocked infrastructure.
cd my-app && npm install
cd contracts && forge test -vvv

Deploy to Base Sepolia

The frontend is pre-configured for Base Sepolia (chain ID 84532) and only works against Base Sepolia — local nodes are for contract testing only. Set up your environment variables in contracts/.env:
PRIVATE_KEY_BASE_SEPOLIA=<your-private-key>
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
Make sure your account has Base Sepolia testnet ETH for gas fees.
cd contracts
forge script script/DeployConfLottery.s.sol --rpc-url $BASE_SEPOLIA_RPC_URL --broadcast
Note the deployed contract address from the output, then configure and run the frontend:
cd frontend
cp .env.example .env.local
# Set NEXT_PUBLIC_CONFLOTTERY_ADDRESS=<deployed address>
# Set wallet-specific env vars (see wallet provider pages)
npm run dev
Open http://localhost:3000 to see your dApp.

Inco SDK Integration

The scaffolded app uses @inco/js for encryption and decryption. Here’s the core pattern:
import { Lightning } from "@inco/js/lite";
import { handleTypes } from "@inco/js";

// Initialize Inco
const zap = await Lightning.latest("testnet", 84532);

// Encrypt a value before sending on-chain
const ciphertext = await zap.encrypt(parseEther("100"), {
  accountAddress: address,
  dappAddress: contractAddress,
  handleType: handleTypes.euint256,
});

// Call your contract with the encrypted value
writeContract({
  address: contractAddress,
  abi: contractAbi,
  functionName: "deposit",
  args: [ciphertext],
  value: await getIncoFee(), // Inco executor fee
});

// Decrypt with attestation (e.g., check if user is winner)
const result = await zap.attestedDecrypt(walletClient, [encryptedHandle]);
const plaintext = result[0].plaintext.value;
See Encrypting Values and Attested Decrypt for full details.

Choose Your Wallet Provider

Each wallet provider has its own setup. Select one to see the provider configuration and how it integrates with Inco:

Quick Reference

CommandDescription
docker compose up -dStart local node (from contracts/)
docker compose downStop local node
forge buildCompile (Foundry)
forge test -vvvTest (Foundry)
npx hardhat compileCompile (Hardhat)
npx hardhat test --network anvilTest (Hardhat)
npm run devStart frontend (from frontend/)