Payroll Genius is a decentralized app (dApp) that streamlines employment contract signatures and salary payments, enabling SMEs to earn yield on their funds while providing employees access to global loans through DeFi. Designed to simplify payroll processes, it leverages Stellar blockchain's DeFi solutions for seamless integration.
-> DEMO To play around, you need to mint test tokens from Soroswap.Finance
- Docker (tested with Docker version 27.1.2)
- Browser with Freighter Wallet
- Get Accounts on Stellar Laboratory or Freighter!
- Have a pinata account
- Mint test tokens on Soroswap.Finance
-
Setup secrets
cp .env.example .env
fill the variables:
JWT= PINATA_API_SECRET= PINATA_API_KEY=
-
Get the required Docker containers up! This helps us be sure that we all run the same software!
bash run.sh
-
Test and Compile the PayrollVault Smart Contract
cd /workspace/contracts cp .env.example .env # for private keys make build make test
-
Fill the /contracts/.env file with the deployers private key
-
Deploy the PayrollVault Smart Contract
cd /workspace/contracts yarn yarn deploy testnet # can also be mainnet if you have some XLM for gas!
-
Run the ReactJS frontend
cd /workshop/ yarn yarn dev
This will start the development server. The dapp will be available on localhost:3000
.
Payroll Genius solves multiple challenges with a single solution.
First, it offers an easy-to-use tool for employers and employees to digitally sign traditional (PDF) employment contracts, with the agreements stored in a decentralized and verifiable way. The employment process includes setting the salary, payment frequency (weekly, monthly, annually), and the number of guaranteed pay periods in case the employee is terminated. Businesses are only allowed to employ workers if they have sufficient funds to cover at least the guaranteed pay periods.
Next, businesses can load their Payroll Vault with incoming revenue from new sales. These funds are used to pay employee salaries. When not actively distributing payments, the funds generate yield by being invested in the preferred DeFi protocols, such as lending through Blend.Capital and reinvesting BLND token rewards via the DeFindex protocol.
At the end of each pay period (weekly, monthly, or yearly, depending on the contract), businesses can process salary payments for all employees in a single transaction, significantly reducing bureaucratic complexity.
During the entire employment period, employees have the certainty that they will be paid according to the terms of their signed contract. This provides them with the ability to secure loans backed by their future salary payments. Lenders can globally access to this market, earning yield on their funds.
We believe this design is highly compliant, as businesses are solely involved in receiving payments, investing funds, and paying salaries. The lending and accounting processes remain straightforward for lenders.
Our project utilizes a combination of Stellar's Soroban smart contracts, ReactJS, IPFS, @soroban-react NPM library, MD5 hashing, and SEP24/SEP6 for on/off ramps. Below is a breakdown:
We use ReactJS with the @soroban-react to handle message signing with Stellar wallets like Freighter. The employment contract signing process involves:
- ReactJS Frontend: Employers and employees interaction
- Soroban Smart Contracts: Our protocol consists on one main PayrollVault Smart Contract that registers the employer-employee relationship and binds the employment agreement upon acceptance, including an MD5 hash of the PDF contract.
- IPFS (Pinata): The PDF contract is uploaded to IPFS for decentralized storage, but access to the link remains private between the employer and employee in a link that will be shared by the employer to the employee.
- Hashing & Verification: The MD5 hash ensures the integrity of the contract. The employer shares a private link with the document to the employee, who can verify the hash and sign the contract using their Stellar wallet. The private link includes the md5 hash + the ipfs URL.
We use Soroban smart contracts to manage the business’s payroll funds:
- DeFi Integration: When a business deposits new funds (from sales or other income), Soroban smart contracts allocate the funds to yield-generating DeFi strategies. Upon salary payments, the funds are withdrawn from these DeFi strategies to pay employees.
- Automatic Transactions: Each time a business adds funds or makes a payroll payment, a sub-contract transaction is executed through Soroban, automating the process.
Payroll payments are processed through:
- ReactJS Frontend: We use the
@soroban-react
NPM library for managing Stellar wallet interactions. - On/Off-Ramps (SEP-24/SEP-6): Although not yet implemented, we plan to use Stellar's SEPs for fiat on-ramps (POS income to the business vault) and off-ramps (to transfer salaries from employer’s vault to bank accounts). However, this cannot be done right now because the standar that connects Smart Contracts with Anchors is under discussion.
The lending process is entirely powered by Soroban smart contracts, allowing employees to access loans backed by their future salary payments. Lenders can globally access this market, earning yield on their investments.
- Develop and secure the core Payroll Vault smart contracts on Soroban.
- Implement decentralized storage of employment contracts using IPFS.
- Integrate MD5 hashing for contract integrity verification.
- UX research for frontend.
-
Enable employers to set salary parameters, payment frequency, and guaranteed pay periods.
-
Automate bulk payroll processing through Soroban smart contracts.
-
Integrate DeFi protocols like DeFindex for idle payroll funds.
-
Automate investment
- Develop BI and analytics tools for employers to monitor investments and payroll expenses.
-
Implement safeguards to ensure businesses have sufficient funds for guaranteed pay periods.
-
Develop compliance modules adhering to financial regulations.
-
Implement a lending system allowing employees to secure loans against future salary payments.
-
Create a global marketplace for lenders to invest in employee-backed loans.
- Develop risk assessment tools leveraging employment contract data for lenders.
- Provide employees with dashboards to manage loan applications and repayments.
-
Target and onboard startups and companies using USDC and strong stablecoins.
-
Expand to countries with high stablecoin adoption.
-
Connect with accounting tools like Kwickbit for seamless financial reporting.
-
Integrate with HR tools to synchronize employee data.
-
SEP Implementation: Prepare for future on/off-ramp integration once standards are finalized.
- Utilize AI to convert traditional PDF contracts into smart contracts between peers.
- Introduce a fee system and subscription tiers offering premium features.
- Expand support to multiple stablecoins and fiat currencies.
-
Cross-Border Payroll
-
Enable cross-border payroll capabilities to simplify international payments.
-
Compliance with cross-border regulation.