Trustless, on-chain time-locked payment scheduler built on the ARC Network. Users can deposit USDC or EURC and schedule future transfer instructions using standard Web3 wallets like MetaMask. The PayWhen Backend Relayer automatically triggers and executes the transaction on-chain once the deadline is reached, paying the gas fee.
[ 1. Schedule Order ] ───► [ 2. Lock Funds ] ───► [ 3. Auto Execute ] ───► [ 4. Settle / Pay ]
User specifies amount Tokens stored in Backend triggers Tokens sent to
& target executeTime smart contract executeOrder() designated receiver
- 🔒 Secure Deposit: The user calls
scheduleOrder(), paying a standard network gas fee to lock their USDC safely in the smart contract (there are zero protocol commission fees). For flexibility, the user retains ownership to cancel and refund their funds within a 24-hour cancellation window. Consequently, orders scheduled to execute in less than 24 hours are locked immediately and cannot be cancelled. After 24 hours, the order is locked permanently to guarantee payment to the receiver. - 🕒 Automated Execution & Sync: The backend runs a lightweight polling loop. Once
block.timestamp >= executeAt, it broadcastsexecuteOrder(orderId)using a relayer wallet, paying the gas fee on behalf of the user. Thus, the execution step is completely free of charge for the sender and receiver. Additionally, all scheduled orders are synchronized in the backend database, enabling users to track and manage their active transfers seamlessly across any device or wallet connection. - 🚫 Double-spending Protection: Because tokens are held in escrow within the contract, there is zero risk of the user spending the funds before the execution date.
payday/
├── contracts/
│ └── TimeLockedScheduler.sol # On-chain Escrow & Automation contract
├── backend/
│ ├── server.js # Express app & Automatic Poller loop
│ └── package.json # Backend dependencies (Ethers, Express)
├── frontend/
│ └── index.html # Sleek Dashboard & Countdown UI
└── README.md # Documentation
Compile and deploy TimeLockedScheduler.sol to ARC Testnet using your deployer wallet. Configure the deployed address in the backend config.
Create .env file under backend/:
PORT=3002
ARC_RPC_URL=https://rpc.testnet.arc.network
ADMIN_PRIVATE_KEY=your_relayer_private_key
SCHEDULER_ADDRESS=deployed_scheduler_contract_addressRun NPM commands:
cd backend
npm install
npm startServe the frontend/index.html file using any static file server or open it directly in your browser. Connect MetaMask to ARC Network and start scheduling transfers!