Project: VoteChain Contracts
Version: 0.1.1
Audit type: External security audit
Date prepared: 2026-04-25
| File | Description |
|---|---|
contracts/governance/src/lib.rs |
All public entry points: initialize, create_proposal, cast_vote, finalise, execute, cancel, update_quorum, get_proposal, has_voted, proposal_count, get_version |
contracts/governance/src/storage.rs |
Storage read/write helpers for proposals, admin, token, vote records, version |
contracts/governance/src/types.rs |
ContractError, ProposalStatus, Vote, Proposal, DataKey |
contracts/governance/src/events.rs |
On-chain event emission |
| File | Description |
|---|---|
contracts/token/src/lib.rs |
initialize, balance, transfer, approve, transfer_from, mint, burn, total_supply, get_version |
contracts/token/src/storage.rs |
Balance, allowance, total supply, admin, version storage helpers |
contracts/token/src/types.rs |
ContractError, TokenDataKey |
| File | Description |
|---|---|
Cargo.toml |
Workspace dependency pinning |
contracts/governance/Cargo.toml |
Governance crate dependencies |
contracts/token/Cargo.toml |
Token crate dependencies |
.github/workflows/ci.yml |
Build, test, and lint pipeline |
.github/workflows/audit.yml |
Automated cargo audit dependency scan |
contracts/governance/src/test.rsandtest_helpers.rs— test code onlycontracts/governance/src/prop_tests.rs— property tests onlycontracts/token/src/test.rs— test code onlyscripts/— deployment scripts (shell, not contract logic)docs/— documentation onlyconfig/— environment configuration- Third-party crates (
soroban-sdk,stellar-xdr, etc.)
-
Access control — verify
require_authis called on all state-mutating functions with the correct signer, and that admin-only functions correctly reject non-admin callers. -
Vote integrity — verify the double-vote guard (
has_voted/mark_voted) cannot be bypassed, and that vote weight is correctly read from the token contract. -
Arithmetic safety — verify
checked_addincast_votecorrectly handles overflow and that no other arithmetic can overflow or underflow. -
Proposal lifecycle — verify that state transitions are exhaustive and that terminal states (Passed, Rejected, Executed, Cancelled) cannot be re-entered.
-
Initialisation guard — verify
is_initializedprevents re-initialisation and that the guard fires before any auth check. -
Storage key collisions — verify
DataKeyandTokenDataKeyvariants cannot collide across proposals or voters. -
Cross-contract trust — verify the governance contract's reliance on the token contract's
balancereturn value and assess the impact of a malicious or buggy token contract. -
Event correctness — verify emitted events accurately reflect state transitions and cannot be spoofed.
Auditors should check out the tagged release:
git checkout v0.1.1All findings should reference file paths and line numbers relative to this tag.
| Component | Version |
|---|---|
| Rust | 1.85+ (stable) |
| Soroban SDK | 22.0.0 |
| Target | wasm32-unknown-unknown |
| Stellar Protocol | 22 |
| Role | Contact |
|---|---|
| Lead maintainer | security@votechain.dev |
| Security disclosures | See SECURITY.md |