A decentralized tender management system built on Ethereum, enabling transparent and secure government procurement processes through smart contracts.
Althara Contracts provides a blockchain-based solution for government tender management, ensuring transparency, immutability, and trust in the procurement process. The system consists of two main contracts:
- TenderContract: Manages tender creation and lifecycle
- BidSubmissionContract: Handles bid submissions and evaluations
- Government Role: Can create tenders, accept/reject bids, and mark tenders as complete
- Admin Role: Can update service fees, platform wallet, and manage roles
- Pauser Role: Can pause/unpause contracts for emergency situations
- Create tenders with descriptions, budgets, and IPFS-based requirements
- Track tender lifecycle from creation to completion
- Link bids to specific tenders
- Service fee collection for tender creation
- Submit bids with pricing, descriptions, and IPFS-based proposals
- Automatic validation against tender requirements
- Bid status tracking (Pending, Accepted, Rejected)
- Service fee collection for bid submissions
- Pausable contracts for emergency situations
- Comprehensive access control
- Input validation and error handling
- Secure fee collection and refund mechanisms
The main contract for managing government tenders.
Key Functions:
createTender(): Create a new tender with description, budget, and requirementsgetTenderDetails(): Retrieve tender informationmarkTenderComplete(): Mark a tender as completedaddBid(): Link a bid to a tender (called by BidSubmissionContract)
Events:
TenderCreated: Emitted when a new tender is createdTenderCompleted: Emitted when a tender is marked as completeBidAdded: Emitted when a bid is linked to a tender
Handles the bid submission and evaluation process.
Key Functions:
submitBid(): Submit a bid for a specific tenderacceptBid(): Accept a submitted bid (government only)rejectBid(): Reject a submitted bid (government only)getBidDetails(): Retrieve bid informationgetTenderBids(): Get all bids for a specific tender
Events:
BidSubmitted: Emitted when a new bid is submittedBidAccepted: Emitted when a bid is acceptedBidRejected: Emitted when a bid is rejected
┌─────────────────┐ ┌─────────────────────┐
│ Government │ │ Vendors │
│ (Government │ │ (Bid Submitters) │
│ Role) │ │ │
└─────────┬───────┘ └─────────┬───────────┘
│ │
▼ ▼
┌─────────────────────────────────────────────┐
│ TenderContract │
│ • Create Tenders │
│ • Manage Tender Lifecycle │
│ • Link Bids to Tenders │
└─────────────────┬───────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ BidSubmissionContract │
│ • Submit Bids │
│ • Accept/Reject Bids │
│ • Track Bid Status │
└─────────────────────────────────────────────┘
- Node.js (v18 or higher)
- npm or yarn
- Git
- Clone the repository:
git clone https://github.com/Althara-Labs/althara-contracts.git
cd althara-contracts- Install dependencies:
npm install- Create a
.envfile in the root directory:
PRIVATE_KEY=your_private_key_here
ALCHEMY_API_KEY=your_alchemy_api_key_here
SEPOLIA_RPC_URL=your_sepolia_rpc_url_herenpx hardhat compileRun all tests:
npm testRun Solidity tests:
npm run test:solidityThe project uses Hardhat Ignition for deployment. Deployment modules are located in the ignition/modules/ directory.
After deployment, contract addresses will be available in:
ignition/deployments/chain-{chainId}/deployed_addresses.json
- Tender Creation: 0.01 ETH
- Bid Submission: 0.005 ETH
These fees are collected by the platform wallet and can be updated by the admin role.
- All privileged functions are protected by role-based access control
- Only authorized addresses can perform administrative actions
- Emergency pause functionality available
- Comprehensive validation for all inputs
- Custom error messages for better debugging
- Protection against invalid tender/bid IDs
- Secure fee collection with automatic refunds for excess payments
- Configurable service fees
- Platform wallet can be updated by admin
contracts/
├── TenderContract.sol # Main tender management contract
├── BidSubmissionContract.sol # Bid submission and evaluation contract
└── interfaces/
└── ITenderContract.sol # Interface for TenderContract
test/
├── TenderContract.t.sol # Solidity tests for TenderContract
└── BidSubmissionContract.t.sol # Solidity tests for BidSubmissionContract
ignition/
└── modules/
├── TenderContract.ts # Deployment module for TenderContract
└── BidSubmissionContract.ts # Deployment module for BidSubmissionContract
- Create your contract in the
contracts/directory - Add corresponding tests in the
test/directory - Create deployment module in
ignition/modules/ - Update this README with new functionality
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request