TeenFiAllowance
TeenFiAllowance POC
Overview
TeenFiAllowance is a proof-of-concept (POC) decentralized application (dApp) that enables parents to manage weekly allowances for teens using blockchain technology. Built on the Sepolia testnet, it supports two ERC-20 tokens: a custom TST token and PayPal USD (PYUSD). Parents can configure allowances, set spending caps, and transfer tokens, while teens can spend their allowance within approved categories (e.g., Education, Entertainment). For testing, spent tokens are transferred back to the parent.
This repository contains simplified code without demo-specific styling (e.g., Bootstrap) used in the live demo at www.skytiger.tech/TeenFiAllowance/, which includes a styled interface for presentation purposes.
This project was developed for the MetaMask Delegation Toolkit (DTK) Dev Cook-Off, showcasing blockchain-based financial education for teens, with a user-friendly interface. The live demo is non-working, as the Infura API key has been removed for security reasons. To run the dApp, users must provide their own Infura API key and set up SSL locally, as the frontend requires SSL (HTTPS) to run locally due to MetaMask Flask’s security requirements.
Features
- Parent Features:
- Registers a parent’s wallet and links it to a teen’s wallet to have delegation authority.
- Configure weekly allowance and spending cap.
- Transfer TST or PYUSD tokens to the teen.
- Teen Features:
- View allowance balance and token balance.
- Spend allowance in approved categories (Education, Entertainment, Savings, Food).
- Blockchain Integration:
- Uses Sepolia testnet for secure, low-cost transactions.
- Interacts with TeenFiAllowance smart contract and ERC-20 tokens.
- Responsive UI:
- Built with Bootstrap 5 and custom CSS.
Tech Stack
Frontend
- HTML5, CSS3, JavaScript (ES6)
- Bootstrap 5
- Viem (2.21.25)
- MetaMask Flask
- Minimal CSS
- lite-server
- mkcert
Blockchain
- Solidity
- Sepolia Testnet (chain ID:
0xaa36a7) - Infura RPC:
https://sepolia.infura.io/v3/68be52d1c6a64ef3b9d7ae3401415bd4 - Hardhat/Foundry
- ERC-20 tokens
Deployment
- Hosting on SkyTiger.Tech
- Contracts deployed on Sepolia, verified on Etherscan
Contract Details
TeenFiAllowance Contract
- Address:
0x4a631b162D58756C2568F03744d63037Bd4348d9 - Functions:
addParent(address parent, address teen)configureAllowance(address teen, address token, uint256 weeklyAmount, uint256 spendingCap, bytes delegationTerms)spendAllowance(address parent, uint256 amount, uint8 category)teenBalances(address)
- Verified on Sepolia Etherscan
TST Token (Custom ERC‑20)
- Address:
0x1230591e26044F0AA562c24b4d7Fd002b227E69c - Decimals: 18
- Verified on Sepolia Etherscan
PYUSD Token (PayPal USD)
- Address:
0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9(pending confirmation) - Decimals: 18
- Verified on Sepolia Etherscan
Setup Instructions
Prerequisites
- MetaMask Flask
- Sepolia ETH
- Node.js
- Git
- mkcert
- Infura Account
Installation
- Clone the repository:
git clone https://github.com/your-repo/TeenFiAllowance.git cd TeenFiAllowance - Install dependencies:
npm install lite-server --save-dev - Set up Infura API key and update RPC URLs.
- Generate SSL certificates using mkcert.
- Configure
lite-serverwithbs-config.js. - Deploy contracts if needed.
- Run the frontend:
npx lite-server --config=bs-config.js
Usage
- Visit
https://localhost:3000 - Configure parent–teen relationship.
- Select token page (TST or PYUSD).
- Parent configures allowance and transfers tokens.
- Teen views balance and spends allowance.
- Verify transactions on Etherscan.
Testing
- Parent Wallet:
0x86110B44E8580905749Eea2A972D15704A914cE5 - Teen Wallet:
0x3674473C7BDAf922f68a0232509049aBD37Da7A9
Contributing
- Fork the repository.
- Create a feature branch.
- Commit and push changes.
- Open a pull request.
License
MIT License. See LICENSE for details.
Contact
- Email: info@skytiger.tech
- X: @SkyTigerTech
- Instagram: soratora2024