Skip to content

cypherpulse/eKura-Smart-Contracts

Repository files navigation

eKura Smart Contract

Overview

eKura is a decentralized platform for managing university elections, built on Ethereum using Solidity and Foundry. It provides secure, transparent, and auditable election processes for student council, university and organizations.

Features

  • Election Factory: Deploy and manage multiple elections for different organizations.
  • Role-Based Access: Platform admin and organization admins with granular permissions.
  • Candidate Management: Flexible candidate lists per election.
  • Event Logging: Emits events for key actions (election creation, admin management).
  • Upgradeable Architecture: Uses OpenZeppelin contracts for future proofing.

Repository Structure

.env
.gitignore
foundry.toml
README.md
cache/
lib/
script/
src/
test/
  • src/: Core smart contracts (ElectionFactory.sol, VoteStorage.sol)
  • script/: Deployment and configuration scripts
  • test/: Unit and integration tests (Foundry framework)
  • lib/: External dependencies (OpenZeppelin, forge-std)

Getting Started

Prerequisites

  • Foundry
  • Node.js (for OpenZeppelin dependencies)
  • An Ethereum node or testnet (e.g., Anvil)

Installation

Clone the repository and install dependencies:

git clone <repo-url>
cd eKura-Smart-Contracts
forge install

Configuration

Set up environment variables in .env for deployment keys and network settings.

Deployment

Use the provided scripts in script/ for deployment:

forge script script/DeployElectionFactory.s.sol --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast

Running Tests

Unit and integration tests are in test/unit/ and test/integration/:

forge test

Contract Architecture

ElectionFactory

  • Manages organizations and their elections.
  • Only platform admin can add/remove organization admins.
  • Organization admins can create elections for their organizations.

See ElectionFactory for implementation details.

VoteStorage

  • Handles vote recording and tallying.
  • Ensures vote integrity and privacy.

See VoteStorage.

Events

  • ElectionCreated: Emitted when a new election is created.
  • OrgAdminAdded: Emitted when an organization admin is added.

Extending & Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

  • Fork the repo and create a feature branch.
  • Write tests for new features.
  • Submit a pull request with a clear description.

License

This project is licensed under MIT and Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.


This documentation will be updated as the project evolves. For questions or suggestions, open an issue or contact the maintainers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published