Inspiration

I was inspired by the gap between when people earn money and when they can access it. Many workers are paid monthly, but expenses such as transport, food, rent, and emergencies happen every day. I wanted to explore whether blockchain could make earned wages available continuously instead of forcing workers to wait until payday.

What it does

SecPay is a real-time wage-streaming dApp built on Base. Employers create and fund a payroll pool, add employees by wallet address, and assign each employee a monthly salary. Once a pay period starts, employees accrue their salary every second. They can connect their wallet, see their live earned balance increase, and withdraw the amount they have already earned directly to their wallet at any time.

How we built it

I built SecPay with Solidity, Foundry, Next.js, TypeScript, wagmi, viem, RainbowKit, and Tailwind CSS. The smart contracts use a lazy-accrual model. Instead of sending an expensive blockchain transaction every second, the contract stores each employee’s salary rate and calculates the earned balance when it is viewed or withdrawn. I deployed a MockUSDC token and the SecPayPool contract to Base Sepolia for testing. The frontend connects users’ wallets, separates employer and employee flows, displays live balance growth locally, and supports funding, starting, pausing, resuming, and withdrawing from streams. I used Codex and GPT-5.6 to accelerate implementation: structuring the project, writing and reviewing contract logic, generating tests, connecting the frontend to the deployed contracts, debugging setup issues, and improving the documentation.

Challenges we ran into

One of the biggest challenges was making “per-second payments” practical on-chain. Sending a transaction every second would be far too expensive, so I used timestamp-based lazy accrual instead. I also had to handle salary precision and rounding, so that small division remainders are not lost. Other challenges included pausing streams correctly, ensuring employees can still withdraw money already earned after removal, protecting payroll funds from surplus withdrawals, configuring wallet connections, and deploying the frontend correctly.

Accomplishments that we're proud of

I am proud that SecPay is more than a static interface. It includes deployed Base Sepolia contracts, a test token faucet, employer and employee dashboards, live balance animation, and a complete payroll flow. I am also proud of the security-focused design: SafeERC20 transfers, reentrancy protection, employer-only administration, reserved employee funds, pause handling, and test coverage for core payroll scenarios.

What we learned

I learned that the best blockchain solution is not always the most literal one. Real-time wages do not require real-time transactions; they require a trustworthy way to calculate what someone has earned. I also learned the importance of precision in payment contracts, keeping wallet flows simple for users, and separating testnet demo infrastructure from production financial systems. Codex and GPT-5.6 also showed me how AI can speed up development while I still make the key product and security decisions.

What's next for SecPay Next, I would like to integrate real USDC on Base mainnet, add multiple pay periods and automated payroll scheduling, improve employee withdrawal history, and add employer analytics. Before any real-world rollout, SecPay would need a professional smart-contract audit, legal and compliance review, stronger identity or employer verification, and partnerships with employers and worker communities.

Built With

Share this project:

Updates