A decentralized application for locking ETH funds for a specified time period with early withdrawal penalties.
LockWallet.mp4
- Time-Locked ETH: Lock your ETH for a predetermined time period
- Customizable Durations: Choose how long to lock your funds
- Early Withdrawal: Option to withdraw early with a 5% penalty
- User Dashboard: Track all your locks and their status
- Secure Implementation: Built with security best practices
- Modern UI: Clean, responsive interface
The project is divided into two main components:
/blockchain: Smart contracts and deployment scripts/frontend: Next.js web application for interacting with the contracts
- Solidity
- OpenZeppelin libraries
- ethers.js for deployment
- Next.js 14 (React)
- Tailwind CSS
- ethers.js v6
- shadcn/ui components
- Node.js (v18+ recommended)
- npm or yarn
- MetaMask or other Ethereum wallet
- Sepolia testnet ETH for testing
-
Navigate to the blockchain directory:
cd blockchain -
Install dependencies:
npm install -
Set up your environment:
cp .env.example .envEdit the
.envfile with your provider URL and private key. -
Compile and deploy:
npm run compile npm run deploy
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install -
Set up environment variables:
cp .env.example .env.localConfigure as needed.
-
Start the development server:
npm run dev -
Open http://localhost:3000 to view the application
- Connect Your Wallet: Use the "Connect Wallet" button to connect your Ethereum wallet
- Create a Lock: Specify the amount of ETH and lock duration
- Monitor Your Locks: View all your active locks, status, and remaining time
- Withdraw Funds: When a lock expires, withdraw your funds without penalty
- Early Withdrawal: If needed, withdraw early with a 5% penalty
- Personal savings with self-imposed restrictions
- Team funds with scheduled release dates
- Timed escrow for transactions
- Forced HODL strategy for crypto investments
- Recurring payments and allowances
See the README.md files in the /blockchain and /frontend directories for more detailed setup instructions and configurations.
cd blockchain
npm test
cd frontend
npm test
The smart contract implements several security measures:
- ReentrancyGuard protection
- Owner-only emergency functions
- Event emissions for transparency
- Clean, auditable code