Skip to content

Mrinmoy-programmer07/AfterLIfe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AfterLife | Temporal Asset Protocol β³βš–οΈ

A decentralized "dead man's switch" protocol for secure crypto inheritance

Multi-Chain Solidity License

Live Demo β€’ Documentation β€’ Deploy


πŸ“– Overview

AfterLife ensures your digital assets are securely distributed to beneficiaries if you become inactive for a defined period. The protocol operates on a "Dead Man's Switch" principle β€” lack of activity triggers a state change that eventually unlocks assets for your chosen beneficiaries.

Why AfterLife?

  • πŸ” Trustless Execution β€” No centralized authority controls your assets
  • ⏱️ Time-Based Triggers β€” Customizable inactivity thresholds
  • πŸ›‘οΈ Owner Override β€” Cancel inheritance at any time with proof of life
  • πŸ”— Multi-Chain β€” Deploy independently on Arbitrum and Mantle

πŸ”— Deployed Contracts

Mainnet (Coming Soon)

Testnets

Network Chain ID Contract Address Explorer Status
Arbitrum Sepolia 421614 0x6D2Bd7091CE36F15C944AB99c4cfc8833c2B8957 Arbiscan β†— βœ… Live
Mantle Sepolia 5003 0xe04250cE4a9A2362eaC92B2BaA3E16E3691EBcE9 Mantlescan β†— βœ… Live

πŸ’‘ Platform Fee: 10% on all beneficiary claims (sent to protocol treasury)


πŸ—οΈ Architecture

System Components

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           AFTERLIFE PROTOCOL                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                          β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
β”‚   β”‚    OWNER     β”‚     β”‚   GUARDIAN   β”‚     β”‚ BENEFICIARY  β”‚            β”‚
β”‚   β”‚   Register   β”‚     β”‚   Confirm    β”‚     β”‚    Claim     β”‚            β”‚
β”‚   β”‚   Deposit    β”‚     β”‚  Inactivity  β”‚     β”‚   Assets     β”‚            β”‚
β”‚   β”‚  Prove Life  β”‚     β”‚              β”‚     β”‚              β”‚            β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
β”‚          β”‚                    β”‚                    β”‚                     β”‚
β”‚          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚
β”‚                               β”‚                                          β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                              β”‚
β”‚                    β”‚   SMART CONTRACT    β”‚                              β”‚
β”‚                    β”‚   (Multi-Tenant)    β”‚                              β”‚
β”‚                    β”‚                     β”‚                              β”‚
β”‚                    β”‚  β€’ State Machine    β”‚                              β”‚
β”‚                    β”‚  β€’ Fund Storage     β”‚                              β”‚
β”‚                    β”‚  β€’ Vesting Logic    β”‚                              β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                              β”‚
β”‚                               β”‚                                          β”‚
β”‚          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚
β”‚          β”‚                    β”‚                    β”‚                     β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”              β”‚
β”‚   β”‚  ARBITRUM   β”‚      β”‚   MANTLE    β”‚     β”‚   FUTURE    β”‚              β”‚
β”‚   β”‚   SEPOLIA   β”‚      β”‚   SEPOLIA   β”‚     β”‚   CHAINS    β”‚              β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Entity Roles

Entity Role Permissions
πŸ‘€ Owner Asset Holder Register, deposit/withdraw, add guardians/beneficiaries, prove life, revive
πŸ›‘οΈ Guardian Inactivity Oracle Confirm owner inactivity (cannot touch funds)
πŸ’° Beneficiary Asset Receiver Claim allocated assets after vesting begins

πŸ”„ Protocol Flow

Protocol States

ACTIVE β†’ WARNING β†’ PENDING β†’ EXECUTING β†’ COMPLETED
   ↑__________|_________|_________|
              (Owner can revive)

State Transitions

From To Trigger
ACTIVE WARNING Inactivity reaches 70% of threshold
WARNING PENDING Guardian confirms inactivity
PENDING EXECUTING Vesting period begins
EXECUTING COMPLETED All beneficiaries have claimed
ANY STATE ACTIVE Owner proves life (7-day grace period)

User Workflows

οΏ½ Owner Flow

Register β†’ Add Guardians β†’ Add Beneficiaries β†’ Deposit Funds β†’ Prove Life (Periodic)

�️ Guardian Flow

Monitor Owner β†’ Detect Inactivity β†’ Confirm Inactivity β†’ Wait for Vesting

οΏ½ Beneficiary Flow

Wait for Execution β†’ Check Claimable Amount β†’ Claim Assets β†’ Receive Funds

βš™οΈ Technical Stack

Layer Technology
Smart Contracts Solidity 0.8.20, Hardhat
Frontend React 18, Vite, TypeScript
Web3 Wagmi v2, Viem, TanStack Query
Styling CSS3 (Glassmorphism), Framer Motion
3D Graphics Three.js, React Three Fiber

πŸ›‘οΈ Security Model

Safety Mechanisms

Mechanism Description
Owner Override proveLife() cancels inheritance at ANY time
7-Day Grace Period Owner can revive even after execution starts
Vesting Delay Funds unlock gradually, not instantly
Guardian Isolation Guardians have ZERO fund access
Reentrancy Guards All transfers protected

Smart Contract Security

  • βœ… Custom errors (gas efficient)
  • βœ… Strict modifiers for access control
  • βœ… Bounded arrays (max 10 guardians, 20 beneficiaries)
  • βœ… Pull-over-push for fund transfers

πŸš€ Getting Started

Prerequisites

Quick Start

# Clone repository
git clone https://github.com/your-repo/afterlife.git
cd afterlife

# Install dependencies
pnpm install

# Run development server
pnpm dev

Deploy Contract (Optional)

# Arbitrum Sepolia
npx hardhat run scripts/deploy.js --network arbitrumSepolia

# Mantle Sepolia
npx hardhat run scripts/deploy.js --network mantleSepolia

πŸ“˜ User Guide

For Owners

  1. Connect Wallet β†’ Select network (Arbitrum or Mantle)
  2. Register β†’ Set inactivity threshold (e.g., 30 days)
  3. Add Guardians β†’ Trusted addresses to monitor you
  4. Add Beneficiaries β†’ Set allocations (must total ≀100%)
  5. Deposit Funds β†’ Transfer ETH/MNT to your vault
  6. Prove Life β†’ Click periodically to stay active

For Guardians

  1. Enter Owner Address β†’ Monitor their status
  2. Wait for Threshold β†’ Inactivity timer must expire
  3. Confirm Inactivity β†’ Triggers inheritance process

For Beneficiaries

  1. Enter Owner Address β†’ Check your allocation
  2. Wait for Execution β†’ Vesting must begin
  3. Claim Assets β†’ Withdraw your share based on vesting schedule

🌐 Network Configuration

Add to MetaMask

Arbitrum Sepolia
Setting Value
Network Name Arbitrum Sepolia
RPC URL https://sepolia-rollup.arbitrum.io/rpc
Chain ID 421614
Currency ETH
Explorer https://sepolia.arbiscan.io
Mantle Sepolia
Setting Value
Network Name Mantle Sepolia Testnet
RPC URL https://rpc.sepolia.mantle.xyz
Chain ID 5003
Currency MNT
Explorer https://explorer.sepolia.mantle.xyz

Faucets


πŸ“„ License

MIT License - see LICENSE for details.


Built with ❀️ for the decentralized future

⬆ Back to Top