Get LockedIn to Financial Discipline - A platform for automated bill payment management with time-locked funds.
Built with Scaffold Stellar.
LockedIn helps users maintain financial discipline by locking funds in time-based cycles and automatically paying bills on their due dates. Users deposit USDC into billing cycles, add their recurring or one-time bills, and let the keeper service handle payments automatically preventing missed payments and overdrafts.
-
Time-Locked Billing Cycles - Lock funds for 1-12 months with automatic surplus returns
-
Automated Bill Payments - Keeper service pays bills on their due dates
-
Recurring Bills - Set up monthly recurring payments with recurrence calendars
-
Monthly Adjustment Limits - Prevents excessive bill modifications
-
Over-Allocation Protection - Ensures bills don't exceed available funds
-
Batch Operations - Add or cancel multiple bills in a single transaction
-
Two-Step Admin Transfer - Secure admin role management
-
Security First - CEI pattern, reentrancy guards, double-payment prevention
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface β
β (React + TypeScript + Vite) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TypeScript Contract Bindings β
β (Auto-generated from WASM spec) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LockedIn Smart Contract β
β (Rust/Soroban) β
β β’ Create billing cycles β’ Manage bills β
β β’ Payment processing β’ Admin functions β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Keeper Service β
β (Node.js cron + TypeScript) β
β Automated bill payment processing β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Rust
- Node.js (v22 or higher)
- Stellar CLI
- Scaffold Stellar CLI
# Clone the repository
git clone https://github.com/Mackenzie-OO7/lockedin.git
cd lockedin/
# Build the contract
cargo build --target wasm32v1-none --release
# (Testnet) Deploy the contract to the Stellar Testnet
stellar contract deploy --wasm target/wasm32v1-none/release/lockedin.wasm --source testnet-user --network testnet -- --admin <YOUR_WALLET_ADDRESS> \
--usdc_token <USDC_TOKEN_ADDRESS>
# Update environments.toml with your newly deployed contract address
# Install dependencies
npm install
# Start the development server
npm run dev
-
Create Cycle - Lock funds for 1-12 months with customizable duration
-
End Cycle - Close cycle and return surplus funds after end date
-
Get Cycle Info - View cycle details, allocated amounts, and remaining balance
-
Add Bills - Single or batch bill creation with validation
-
Cancel Bill Occurrence - Skip one occurrence of recurring bills
-
Cancel Bill Permanently - Delete bill and all future occurrences
-
Day 1-28 Restriction - Ensures recurring bills work in all months (including February)
-
Recurrence Calendar - Precise control over which months bills recur
-
Reentrancy Protection - Global lock prevents concurrent execution
-
CEI Pattern - Checks-Effects-Interactions pattern in all payment functions
-
Double-Payment Prevention - Last paid date tracking for recurring bills
-
Over-Allocation Validation - Prevents bills from exceeding available funds
-
Monthly Adjustment Limit - One bill modification per cycle per month
-
User Payment - Pay bills that are due (enforces due date)
-
Admin Payment - Admin can pay any bill anytime (for keeper automation and dispute resolution)
-
Keeper Auto-End - Permissionless cycle ending for expired cycles
The keeper service automates bill payments by running scheduled checks for due bills.
cd keeper
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your admin secret key
# ADMIN_SECRET_KEY=YOUR_SECRET_KEY_HERE
# Run in scheduled mode (daily at 12:00 PM UTC)
npm start
# Or test immediately
npm start -- --now
See keeper/README.md for detailed configuration options.
lockedin/
βββ contracts/lockedin/ # Soroban smart contract (Rust)
β βββ src/
β β βββ lib.rs # Main contract implementation
β β βββ types.rs # Data structures
β β βββ error.rs # Error types
β β βββ events.rs # Contract events
β β βββ test.rs # Contract tests (26 totally)
β βββ Cargo.toml
βββ keeper/ # Automated payment service
β βββ src/
β β βββ index.ts # Cron scheduler
β β βββ payment.ts # Payment logic
β βββ package.json
βββ packages/lockedin/ # Auto-generated TypeScript bindings
βββ src/ # React frontend
β βββ pages/
β β βββ Dashboard.tsx # Main UI
β βββ hooks/
β β βββ useWallet.ts # Wallet integration
β βββ contracts/util.ts # Contract utilities
βββ environments.toml # Network configurations
cd contracts/lockedin
cargo test
MIT License - see LICENSE file for details
-
Built with Scaffold Stellar
-
Security patterns inspired by OpenZeppelin
Built with β€οΈ on Stellar