PayChain is a decentralized payroll system that enables real-time salary payments using smart contracts. Employees receive payments automatically every 30 minutes based on their work hours, directly into their MetaMask wallet.
- Instant Salary Payments - Employees are paid every 30 minutes.
- Smart Contract Automation - Eliminates manual payroll processing.
- Crypto Payments - Salaries are paid in ETH or USDT.
- Transparent Records - All transactions are recorded on-chain.
- Easy Wallet Integration - Supports MetaMask.
- Blockchain: Ethereum (or Polygon for lower gas fees)
- Smart Contracts: Solidity (ERC-20 based salary system)
- Frontend: React.js + Web3.js
- Backend: Node.js + Express.js
- Database: Firebase / MongoDB (for employer-employee records)
- Wallet Integration: MetaMask, WalletConnect
git clone https://github.com/codeypas/paychain.git
cd paychainnpm installcd server
npm install
npm run devcd client
npm install
npm start- Install Hardhat:
npm install --save-dev hardhat
- Compile and Deploy:
npx hardhat compile npx hardhat run scripts/deploy.js --network goerli
After deploying your contract, retrieve the contract address:
cd paychain/truffle
truffle migrate --network developmentCheck the deployment output for the contract address.
truffle console --network development
let instance = await PayrollSystem.deployed()
instance.address- Open Ganache
- Navigate to "Contracts" tab
- Find
PayrollSystemcontract - Copy the displayed contract address
- Go to MetaMask Download
- Install the extension
- Create a new wallet
- Open MetaMask
- Click "Add Network"
- Fill in the following details:
- Network Name:
Ganache Local - New RPC URL:
http://127.0.0.1:8545 - Chain ID:
1337 - Currency Symbol:
ETH
- Network Name:
- Click "Save"
- Copy the private key of an account from Ganache
- In MetaMask, select Import Account
- Paste the private key and click "Import"
cd paychain/server
npm run devcd paychain/client
npm start- Navigate to
http://localhost:3000 - Click "Connect MetaMask"
- Use employer functions to add employees and deposit salary funds
- Ensure Ganache is running
- Verify MetaMask network settings
- Reset MetaMask (Settings > Advanced > Reset Account)
- Verify contract address in frontend/backend
- Ensure contract is deployed to Ganache
- Ensure sufficient ETH balance
- Use the correct account for operations
By following these steps, you can successfully set up and test PayChain locally before deploying to a testnet or mainnet.
Feel free to contribute by forking the repo and submitting a pull request. 🚀
MIT License
"Innovation distinguishes between a leader and a follower." – Steve Jobs