Skip to main content
create-inco-app is the fastest way to start building on Inco. It scaffolds a confidential project — a monorepo with Solidity contracts and a Next.js frontend, or just the contracts, or just the frontend — pre-wired with the Inco SDK, your contract framework, and a wallet provider.

Basic usage

npx create-inco-app@latest
You’ll be prompted for:
What is your project named?            my-app
What would you like to scaffold?       Full monorepo / Contracts only / Frontend only
Which chain would you like to use?     EVM / SVM
Which contract framework?              Hardhat / Foundry      (skipped for frontend-only)
Which wallet provider?                 RainbowKit / Privy / Dynamic / Reown / Para  (skipped for contracts-only)

Scaffold modes

Choose what to generate with --template (or the second prompt). Contracts-only and frontend-only are scaffolded at the project root (no monorepo wrapper).
Contracts and frontend in one workspace.
npx create-inco-app@latest my-app --chain evm --framework hardhat --wallet rainbowkit --yes
my-app/
├── contracts/        # Solidity (Hardhat or Foundry) — ConfidentialERC20 + ConfidentialLottery
├── frontend/         # Next.js app (wallet provider + Inco SDK wired up)
└── package.json      # workspace root (npm run dev, contracts:compile, ...)

Reference

npx create-inco-app@latest [project-name] [options]
OptionDescription
-t, --template <type>Scaffold type: monorepo (default), contracts, frontend
-c, --chain <chain>Chain type: evm, svm
-f, --framework <fw>Contract framework: hardhat, foundry (EVM), anchor (SVM)
-w, --wallet <provider>Wallet provider: rainbowkit, privy, dynamic, reown, para
-y, --yesSkip prompts, use defaults
--gitInitialize a git repository
--installInstall dependencies after scaffolding
--use-npm / --use-pnpm / --use-yarn / --use-bunChoose the package manager
-h, --helpShow all options
-v, --versionPrint the version

Networks

The project targets Base Sepolia by default and supports Base Mainnet. The frontend selects the network from a single env var — no code changes needed:
frontend/.env
# "testnet" (Base Sepolia, default) or "mainnet" (Base Mainnet)
NEXT_PUBLIC_NETWORK=testnet
lib/network.ts reads it and returns the matching Inco Lightning client (Lightning.baseSepoliaTestnet() or Lightning.baseMainnet()).

After setup (monorepo)

  1. Install dependencies:
    cd my-app && npm install
    
  2. Set up frontend env vars:
    cp frontend/.env.example frontend/.env
    # set NEXT_PUBLIC_NETWORK, your wallet key(s), and NEXT_PUBLIC_CONFLOTTERY_ADDRESS after deploy
    
  3. Compile and test the contracts:
    npm run contracts:compile
    npm run contracts:test
    
  4. (Optional) Deploy — copy contracts/.env.sample to contracts/.env and fill in the key for your target network, then:
    # local Inco node (anvil + covalidator) — run in a separate terminal
    npm run contracts:node
    # deploy
    npm run contracts:deploy:local      # or :deploy:testnet / :deploy:mainnet
    
    contracts/.env keys, per target network:
    contracts/.env
    PRIVATE_KEY_ANVIL=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80  # local default
    PRIVATE_KEY_BASE_SEPOLIA=<your-testnet-key>
    PRIVATE_KEY_BASE=<your-mainnet-key>
    
  5. Start the frontend (set NEXT_PUBLIC_CONFLOTTERY_ADDRESS to your deployed address first):
    npm run dev
    
    Open http://localhost:3000.

Workspace scripts (monorepo)

ScriptDescription
npm run devStart the frontend dev server
npm run buildBuild the frontend
npm run contracts:compileCompile the contracts
npm run contracts:testRun the contract tests
npm run contracts:nodeStart the local Inco node (anvil + covalidator)
npm run contracts:deploy:localDeploy the lottery to the local node
npm run contracts:deploy:testnetDeploy the lottery to Base Sepolia
npm run contracts:deploy:mainnetDeploy the lottery to Base Mainnet
deploy:token:local / :testnet / :mainnet variants deploy only the ConfidentialERC20 token. Each deploy reads its key from contracts/.env by target chain (PRIVATE_KEY_ANVIL / PRIVATE_KEY_BASE_SEPOLIA / PRIVATE_KEY_BASE).

Inco SDK integration

The frontend talks to Inco through @inco/lightning-js. The network-aware client comes from lib/network.ts:
lib/network.ts
import { Lightning } from "@inco/lightning-js/lite";

// NEXT_PUBLIC_NETWORK: "testnet" (Base Sepolia, default) or "mainnet" (Base Mainnet)
export async function getIncoLightning() {
  return process.env.NEXT_PUBLIC_NETWORK === "mainnet"
    ? Lightning.baseMainnet()
    : Lightning.baseSepoliaTestnet();
}
Encrypt a value before sending it on-chain, then decrypt results with attestation:
import { getIncoLightning } from "@/lib/network";
import { handleTypes } from "@inco/lightning-js";
import { parseEther } from "viem";

const zap = await getIncoLightning();

// Encrypt an amount for the contract
const ciphertext = await zap.encrypt(parseEther(amount), {
  accountAddress: address,
  dappAddress: contractAddress,
  handleType: handleTypes.euint256,
});

// The Inco executor fee is read from the network and passed as msg.value
const fee = await publicClient.readContract({
  address: zap.executorAddress,
  abi: getFeeAbi,
  functionName: "getFee",
});

writeContract({ address: contractAddress, abi, functionName: "encryptedMint", args: [ciphertext], value: fee });

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

Choose your wallet provider

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

RainbowKit

Multi-wallet connector (recommended)
privy

Privy

Embedded wallets & social login
dynamic

Dynamic

Multi-chain wallet orchestration
reown

Reown

WalletConnect-powered connections
para

Para

Embedded + external wallet support