ScalePay is a decentralized application (dApp) built on the BNB Chain to streamline attendance tracking, leave management, and payroll processing. It ensures transparency and fairness by leveraging blockchain technology, providing a secure and decentralized solution for managing workforce operations.
This project is developed exclusively for submission to the BNB Hack 2024 Q4: The Ultimate Battle of Hacker Heroes
hackathon, hosted on DoraHacks.
Traditional employee attendance and payroll systems are prone to inefficiencies and inaccuracies due to their centralized nature. Employers often struggle with:
- Tracking attendance accurately without manual intervention.
- Managing leave requests and payouts transparently.
- Ensuring timely salary distribution.
On the other hand, employees lack a clear view of their attendance, fines, bonuses, and salary details, which can lead to mistrust and dissatisfaction.
ScalePay solves these challenges by:
- Decentralizing Workforce Management: Attendance, leave records, and payroll data are stored on the BNB Chain, ensuring immutability and transparency.
- Automating Processes: Smart contracts handle attendance tracking, leave approvals, salary calculations, and payouts.
- Improving Visibility: Both employers and employees can interact with the system in real-time via a user-friendly Next.js-based frontend.
- Attendance Management:
- View and manage attendance records.
- Automatically mark absent if employees fail to log out.
- Leave Management:
- Approve or reject leave applications.
- Employee Management:
- Add or remove employees by linking their wallet addresses.
- Payroll Management:
- Apply bonuses or fines to employees.
- Process salary payouts either manually or automatically.
- Office Configuration:
- Set office rules such as working hours, buffer time, paid leave limits, and payout schedules.
- Attendance Tracking:
- Log in and log out to mark attendance.
- Leave Requests:
- Submit leave applications.
- Payroll Information:
- View salary details, including bonuses, fines, and leaves.
- BNB Chain: Decentralized and immutable ledger for attendance and payroll data.
- Language: Solidity
- Deployment and testing via Remix.
- Framework: Next.js
- Wallet Integration: ThirdWeb
- Install Remix or access it via the web at Remix IDE.
- Have a wallet (e.g., MetaMask) with test BNB for deploying the contract on the BNB Chain Testnet.
-
Clone the Repository:
git clone https://github.com/pratham1015/ScalePay.git cd ScalePay
-
Compile the Smart Contract:
- Navigate to the
contracts
folder. - Open the contract in Remix IDE and compile it.
- Navigate to the
-
Deploy the Contract:
- Select the Injected Provider (MetaMask) in Remix.
- Deploy the contract on the BNB Chain Testnet.
- Note the contract address after deployment.
-
Install Dependencies:
cd frontend bun install
-
Update the Contract Address:
- Open the file
frontend/contracts/contracts.ts
. - Replace the
ScalePayFactoryContractAddress
with the deployed contract address:export const ScalePayFactoryContractAddress = "<deployed-contract-address>";
- Open the file
-
Build and Run the Frontend:
bun dev
-
Access the Application:
- Open your browser and navigate to
http://localhost:3000
.
- Open your browser and navigate to
- Set Office Rules: Configure working hours, buffer time, and paid leave limits from the dashboard.
- Manage Attendance: View attendance records and flagged entries for anomalies.
- Review Leaves: Approve or reject employee leave applications.
- Process Payroll: Apply bonuses or fines, and process payouts.
- Log Attendance: Use the dashboard to log in and log out daily.
- Apply for Leave: Submit leave requests via the leave management section.
- View Payroll Details: Track salary details, including bonuses, fines, and attendance adjustments.
-
Run Unit Tests:
Navigate to thecontracts
directory and run:forge test
-
Check Frontend Integration:
- Run the frontend application.
- Connect MetaMask to the BNB Testnet.
- Interact with the deployed contract via the frontend to test functionalities.
This project was developed exclusively for the BNB Hack 2024 Q4: The Ultimate Battle of Hacker Heroes
hackathon, hosted on DoraHacks.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
- Commit your changes:
git commit -m "Description of changes"
- Push your branch and open a pull request.