Sol.College

Structure lesson (licence does not allow quoting code)

EnigmaVote

A system that enables confidential voting on solana blockchain using FHE enabled by zkVM and identity Verification of the voter to avoid fake voting

Original
adirola/EnigmaVote
SuperStack fork
Blockchains/EnigmaVote @ d8b5e20
Stars
0
Last push (original)
2024-04-10
Languages
Rust, TypeScript, JavaScript, HTML, CSS, Shell
Detected stack
Anchorweb3.js
Categories
Wallets & IdentityGovernance & DAOs
Licence
GPL-3.0: code not quoted on Sol.College

Architecture

73 source files. By extension: .ts ×27, .rs ×27, .js ×12, .jsx ×7.

Top-level directorySource files
provingServiceBonsol52
anchorProject18
enigamSdk2
mpcNetwork1

On-chain programs: anchorProject/programs/voting-system

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
initializeInitializeanchorProject/programs/voting-system/src/lib.rs:13
vote_crunchyVoteCrunchyanchorProject/programs/voting-system/src/lib.rs:21
vote_smoothVoteSmoothanchorProject/programs/voting-system/src/lib.rs:26
publish_resultPublishResultanchorProject/programs/voting-system/src/lib.rs:32

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
provingServiceBonsol/channel/src/program.rsAccountInfo, seeds, invoke_signed, Pubkey, invoke, transfer
anchorProject/frontend/src/components/Main.jsxProgram, Connection, AnchorProvider, Transaction, useWallet, SystemProgram
anchorProject/frontend/src/App.jsConnection, PublicKey, Program, AnchorProvider, SystemProgram, Keypair
provingServiceBonsol/channel/src/assertions.rsAccountInfo, Pubkey, seeds
enigamSdk/src/FHETransactionBuilder.jssendTransaction, PublicKey, Connection, transfer
anchorProject/tests/voting-system.tsSystemProgram, Keypair, Program, AnchorProvider
provingServiceBonsol/channel/src/lib.rsPubkey
mpcNetwork/app.jsPublicKey, Connection, Keypair, getAccountInfo
provingServiceBonsol/channel/ts-client/tests/main.test.tssignTransaction, getLatestBlockhash, getAccountInfo
anchorProject/frontend/src/components/Intro.jsxWalletMultiButton, useWallet, Program
provingServiceBonsol/channel/src/entrypoint.rsAccountInfo, Pubkey
anchorProject/index.jsKeypair

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/enigmavote/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
anchorProjectnpm run start
anchorProjectnpm run build
anchorProjectnpm run lint
anchorProject/frontendnpm run start
anchorProject/frontendnpm run build
anchorProject/frontendnpm run test
enigamSdknpm run test
provingServiceBonsol/schemas-tsnpm run build
mpcNetworknpm run start
anchorProjectanchor build
anchorProjectanchor test
anchorProjectanchor run test

What you could build from it