Smart contracts for VESTAr's organizer gating, clone-based election deployment, open/private voting, and paid settlement on Status Network.
Frontend Β· Backend Β· Demo Video Β· Project Description
| Repository | How it connects to this contracts repo |
|---|---|
vestar-contracts |
Core onchain runtime for election creation, voting, reveal, and settlement |
vestar-frontend |
Host flows, voting UI, and verification portal built on top of these contracts |
vestar-backend |
Indexed read APIs, private vote preparation, and automated key reveal workers |
English
This repository contains the onchain core of VESTAr. It is responsible for deciding who can create elections, how votes are accepted, how private voting is revealed, and how paid voting revenue is settled. The design is modular, but the top-level experience is simple: registries gate creation, the factory deploys election clones, and each election handles its own lifecycle.
νκ΅μ΄
μ΄ μ μ₯μλ VESTArμ μ¨μ²΄μΈ ν΅μ¬ λ‘μ§μ λ΄κ³ μμ΅λλ€. λκ° ν¬νλ₯Ό μμ±ν μ μλμ§, ν¬νκ° μ΄λ€ λ°©μμΌλ‘ μ μΆλλμ§, λΉκ³΅κ° ν¬νκ° μΈμ 곡κ°λλμ§, μ λ£ ν¬ν μμ΅μ΄ μ΄λ»κ² μ μ°λλμ§λ₯Ό μ΄ μ μ₯μκ° κ²°μ ν©λλ€. ꡬ쑰λ λͺ¨λνμ΄μ§λ§ νλ¦μ λ¨μν©λλ€. λ μ§μ€νΈλ¦¬κ° μμ± μ격μ νλ¨νκ³ , ν©ν λ¦¬κ° election cloneμ λ°°ν¬νλ©°, κ° election μΈμ€ν΄μ€κ° μμ μ μλͺ
μ£ΌκΈ°λ₯Ό μ§μ κ΄λ¦¬νλ λ°©μμ
λλ€.
English
- Organizer verification and creation gating through onchain registries.
- Clone-based election deployment for consistent runtime behavior.
- Support for both open voting and private encrypted voting.
- Commitment-verified private key reveal for verifiable private results.
- Paid voting settlement with an ERC20-based revenue split.
νκ΅μ΄
- μ¨μ²΄μΈ λ μ§μ€νΈλ¦¬λ₯Ό ν΅ν μ£Όμ΅μ κ²μ¦κ³Ό μμ± μ격 κ΄λ¦¬ ꡬ쑰μ λλ€.
- μΌκ΄λ λμμ μν clone κΈ°λ° election λ°°ν¬ κ΅¬μ‘°μ λλ€.
- κ³΅κ° ν¬νμ λΉκ³΅κ° μνΈν ν¬νλ₯Ό λͺ¨λ μ§μν©λλ€.
- λΉκ³΅κ° κ²°κ³Ό κ²μ¦μ μν commitment-verified key reveal ꡬ쑰μ λλ€.
- ERC20 κΈ°λ° μμ΅ λΆλ°°λ₯Ό ν¬ν¨ν μ λ£ ν¬ν μ μ° κ΅¬μ‘°μ λλ€.
English
At a high level, VESTAr contracts are organized around three layers: registries, factory, and election instances. Registries provide organizer and karma context, the factory enforces creation rules and deploys clones, and each deployed election handles voting, reveal, finalization, and settlement.
νκ΅μ΄
ν° νλ¦μμ VESTAr 컨νΈλνΈλ λ μ§μ€νΈλ¦¬, ν©ν 리, election μΈμ€ν΄μ€μ μΈ μΈ΅μΌλ‘ ꡬμ±λμ΄ μμ΅λλ€. λ μ§μ€νΈλ¦¬λ μ£Όμ΅μμ μΉ΄λ₯΄λ§ μ 보λ₯Ό μ 곡νκ³ , ν©ν 리λ μμ± κ·μΉμ κ²μ¦ν λ€ cloneμ λ°°ν¬νλ©°, μ€μ election μΈμ€ν΄μ€λ ν¬ν, 곡κ°, μ΅μ’
νμ , μ μ°μ λ΄λΉν©λλ€.
flowchart LR
Admin[Admin / Organizer] --> OrgReg[OrganizerRegistry]
Status[Status Karma] --> KarmaReg[KarmaRegistry]
OrgReg --> Factory[ElectionFactory]
KarmaReg --> Factory
Factory --> Election[VESTArElection clone]
Voter[Voter] --> Election
Worker[Backend worker / indexer] --> Election
Token[MockUSDT / ERC20] --> Election
| Contract | Role |
|---|---|
VESTArOrganizerRegistry |
Stores organizer profile data and verification state |
VESTArKarmaRegistry |
Reads Status Karma and KarmaTiers for eligibility checks |
VESTArElectionFactory |
Validates organizer eligibility and deploys election clones |
VESTArElection |
Per-election runtime covering lifecycle, voting, reveal, and settlement |
MockUSDT |
6-decimal ERC20 used for paid vote flows on testnet |
English
If you want implementation-level detail, the internal contract map is documented in src/vestar/README.md.
νκ΅μ΄
ꡬν λ¨μμ λ μμΈν κ΅¬μ‘°κ° νμνλ©΄ src/vestar/README.mdμμ λ΄λΆ ν΄λμ λͺ¨λ ꡬμ±μ νμΈν μ μμ΅λλ€.
English
Open and private elections share the same broad lifecycle, but private elections add a reveal step before finalization. That reveal step is what allows temporary privacy during voting and verifiability afterward.
νκ΅μ΄
κ³΅κ° ν¬νμ λΉκ³΅κ° ν¬νλ ν° μλͺ
μ£ΌκΈ°λ₯Ό 곡μ νμ§λ§, λΉκ³΅κ° ν¬νλ μ΅μ’
νμ μ μ key reveal λ¨κ³κ° ν λ² λ λ€μ΄κ°λλ€. μ΄ λ¨κ³ λλΆμ μ§ν μ€μλ νλΌμ΄λ²μλ₯Ό μ μ§νκ³ , μ’
λ£ νμλ κ²°κ³Όλ₯Ό λ€μ κ²μ¦ν μ μμ΅λλ€.
flowchart LR
Scheduled --> Active --> Closed
Closed --> Finalized
Closed --> KeyRevealPending
KeyRevealPending --> KeyRevealed --> Finalized
Finalized --> Settled
English
startAt < endAtandresultRevealAt >= endAtare validated onchain.FREEelections require zero cost, whilePAIDelections require a token and a positive price.PRIVATEelections require a public key, a commitment hash, andkeySchemeVersion == 1.ONE_PER_INTERVALrequires a positive reset interval.UNLIMITED_PAIDis single-choice only and currently enforcescostPerBallot == 66_000.finalizeResults(...)requires the correct terminal state before execution.
νκ΅μ΄
startAt < endAt,resultRevealAt >= endAtκ·μΉμ μ¨μ²΄μΈμμ κ²μ¦ν©λλ€.FREEelectionμ λΉμ©μ΄ 0μ΄μ΄μΌ νκ³ ,PAIDelectionμ ν ν° μ£Όμμ μμ κ°κ²©μ΄ νμν©λλ€.PRIVATEelectionμ 곡κ°ν€, μ»€λ° ν΄μ,keySchemeVersion == 1μ‘°κ±΄μ΄ νμν©λλ€.ONE_PER_INTERVALμ μμ reset intervalμ΄ νμν©λλ€.UNLIMITED_PAIDλ λ¨μΌ μ νλ§ νμ©νλ©° νμ¬costPerBallot == 66_000μ κ°μ ν©λλ€.finalizeResults(...)λ μ¬λ°λ₯Έ μ’ λ£ μνμ λλ¬ν λ€μλ§ μ€νν μ μμ΅λλ€.
contracts/
ββ abi/ # ABI handoff artifacts and deployment address snapshots
ββ script/ # Foundry deployment and sync scripts
ββ src/
β ββ config/ # Network-specific constants
β ββ interfaces/ # Public interfaces
β ββ mocks/ # MockUSDT and test helpers
β ββ vestar/ # Registries, factory, and election runtime
ββ test/ # Foundry test suite
ββ foundry.toml
forge buildforge testforge script script/DeployVESTArStack.s.sol:DeployVESTArStackScript \
--rpc-url status_hoodi \
--broadcast \
--gas-price 0 \
--priority-gas-price 0forge script script/DeployMockUSDT.s.sol:DeployMockUSDTScript \
--rpc-url status_hoodi \
--broadcast \
--gas-price 0 \
--priority-gas-price 0./script/SyncStatusArtifacts.sh| Item | Value |
|---|---|
| Network | Status Network Hoodi Testnet |
| Chain ID | 374 |
| RPC | https://public.hoodi.rpc.status.network |
| EVM Version | paris |
| Solidity | 0.8.24 |
| Status Karma | 0x0700be6f329cc48c38144f71c898b72795db6c1b |
| Status KarmaTiers | 0xb8039632e089dcefa6bbb1590948926b2463b691 |
| Multicall3 | 0xcA11bde05977b3631167028862bE2a173976CA11 |
English
The current Foundry profile uses Solidity 0.8.24, evm_version = "paris", and optimizer settings tuned for deployment size. This matters because the assembled election runtime can become large without those defaults.
νκ΅μ΄
νμ¬ Foundry μ€μ μ Solidity 0.8.24, evm_version = "paris", optimizer νμ±νλ₯Ό κΈ°μ€μΌλ‘ λ§μΆ°μ Έ μμ΅λλ€. μ΄λ election λ°νμμ΄ μ¬λ¬ κΈ°λ₯μ μ‘°ν©νλ ꡬ쑰μ΄κΈ° λλ¬Έμ, μ΄ κΈ°λ³Έκ°μ΄ λ§μ§ μμΌλ©΄ λ°°ν¬ ν¬κΈ° μ νμ 걸릴 μ μκΈ° λλ¬Έμ
λλ€.
English
If gasless deployment is temporarily unavailable on Status Hoodi, deployment may require explicit gas settings instead of the expected zero-gas flow.
νκ΅μ΄
Status Hoodiμμ κ°μ€λ¦¬μ€ λ°°ν¬κ° μΌμμ μΌλ‘ λμνμ§ μλ κ²½μ°μλ, κΈ°λνλ zero-gas νλ¦ λμ λͺ
μμ μΈ gas μ€μ μΌλ‘ λ°°ν¬ν΄μΌ ν μ μμ΅λλ€.



