Aztec QuickstartSDK

Build the app

Building the contract is two distinct steps. The app wraps both in npm run build:contracts, but run them by hand once so you know what each does.

Compile the contract#

From the contracts workspace, compile the Noir source to a contract artifact, that includes both the bytecode and ABI.

bash
cd packages/contracts
aztec compile

Generate the TypeScript interface#

Now turn that compiled artifact into a typed PrivateVoting class the frontend and tests import — aztec codegen reads ./target and writes ./artifacts/PrivateVoting.ts:

bash
aztec codegen ./target -o artifacts

Take a moment to open artifacts/PrivateVoting.ts. Inside is a typed PrivateVotingContract class whose methods (cast_vote, get_tally, start_vote, …) mirror the functions in main.nr — the typed API the frontend and tests actually call.