import React, { useState, useEffect } from 'react';
import './ChainlinkDemo.css';
// Mock data for demonstration purposes
const mockTokenData = {
networkStats: {
totalTokens: 1000000,
circulatingSupply: 350000,
reservedPool: 650000,
tokenPrice: 2.75,
marketCap: 962500,
stakeholders: 1250,
chargingHubs: 36,
totalTransactions: 15782
},
userWallet: {
balance: 45,
stakingRewards: 3.2,
acquisitionHistory: [
{ date: "Apr 1, 2025", amount: 15, source: "Monthly Subscription", price: 2.65 },
{ date: "Mar 1, 2025", amount: 15, source: "Monthly Subscription", price: 2.58 },
{ date: "Feb 1, 2025", amount: 15, source: "Monthly Subscription", price: 2.42 }
],
transactionHistory: [
{ date: "Mar 15, 2025", type: "Staking", amount: 20, status: "Active" },
{ date: "Mar 10, 2025", type: "Charging Credit", amount: 5, status: "Completed" },
{ date: "Feb 22, 2025", type: "Governance Vote", amount: 0, status: "Completed" }
]
},
assetOwnership: {
totalOwnership: 0.0045, // percentage of network
hubs: [
{ id: 101, name: "Springfield Downtown", ownership: 0.0012, status: "Operational", monthlyRevenue: 0.32 },
{ id: 102, name: "Champaign-Urbana Hub", ownership: 0.0018, status: "Construction", monthlyRevenue: 0 },
{ id: 103, name: "Bloomington-Normal", ownership: 0.0015, status: "Planning", monthlyRevenue: 0 }
],
projectedReturns: [
{ year: 2025, quarter: 2, returns: 0.45 },
{ year: 2025, quarter: 3, returns: 0.68 },
{ year: 2025, quarter: 4, returns: 0.92 },
{ year: 2026, quarter: 1, returns: 1.25 }
]
},
tokenomics: {
distribution: [
{ category: "Subscriber Rewards", percentage: 35, color: "#00E0FF" },
{ category: "Infrastructure Development", percentage: 25, color: "#35F2DB" },
{ category: "Operations", percentage: 15, color: "#FFC107" },
{ category: "Community Governance", percentage: 10, color: "#FF5555" },
{ category: "Partnerships", percentage: 10, color: "#9C27B0" },
{ category: "Reserve", percentage: 5, color: "#607D8B" }
],
utilityFunctions: [
{ function: "Charging Credits", description: "Redeem tokens for charging credits at The Link hubs" },
{ function: "Subscription Discounts", description: "Apply tokens toward Unity Fleet subscription fees" },
{ function: "Governance Rights", description: "Vote on network expansion and feature development" },
{ function: "Revenue Sharing", description: "Earn a portion of network revenue based on token holdings" },
{ function: "Asset Ownership", description: "Tokens represent fractional ownership in physical infrastructure" }
],
valueDrivers: [
{ driver: "Network Expansion", impact: "High", description: "Each new charging hub increases token utility and demand" },
{ driver: "EV Adoption Rate", impact: "High", description: "Accelerating EV adoption drives charging demand and token usage" },
{ driver: "Subscription Growth", impact: "Medium", description: "New subscribers receive tokens, increasing distribution and usage" },
{ driver: "Energy Efficiency", impact: "Medium", description: "Optimized energy usage improves hub profitability and token value" },
{ driver: "Governance Decisions", impact: "Low", description: "Community governance ensures alignment with token holder interests" }
]
},
marketData: {
priceHistory: [
{ month: "Jan", price: 2.25 },
{ month: "Feb", price: 2.42 },
{ month: "Mar", price: 2.58 },
{ month: "Apr", price: 2.75 }
],
volumeHistory: [
{ month: "Jan", volume: 15000 },
{ month: "Feb", volume: 22500 },
{ month: "Mar", volume: 28000 },
{ month: "Apr", volume: 35000 }
],
projections: [
{ quarter: "Q2 2025", lowEstimate: 2.85, highEstimate: 3.25 },
{ quarter: "Q3 2025", lowEstimate: 3.10, highEstimate: 3.75 },
{ quarter: "Q4 2025", lowEstimate: 3.50, highEstimate: 4.50 },
{ quarter: "Q1 2026", lowEstimate: 4.00, highEstimate: 5.25 }
]
}
};
function ChainlinkDemo() {
const [activeTab, setActiveTab] = useState('overview');
const [loading, setLoading] = useState(true);
const [selectedAsset, setSelectedAsset] = useState(null);
const [tokenAction, setTokenAction] = useState(null);
const [tokenAmount, setTokenAmount] = useState(1);
const [showConfirmation, setShowConfirmation] = useState(false);
const [animateTokenFlow, setAnimateTokenFlow] = useState(false);
useEffect(() => {
// Simulate loading
const timer = setTimeout(() => {
setLoading(false);
}, 1500);
return () => clearTimeout(timer);
}, []);
const handleAssetSelect = (asset) => {
setSelectedAsset(asset);
};
const handleTokenActionSelect = (action) => {
setTokenAction(action);
setShowConfirmation(false);
};
const handleTokenAmountChange = (amount) => {
setTokenAmount(Math.max(1, Math.min(mockTokenData.userWallet.balance, amount)));
};
const handleActionConfirm = () => {
setShowConfirmation(true);
};
const handleTokenFlowDemo = () => {
setAnimateTokenFlow(true);
setTimeout(() => {
setAnimateTokenFlow(false);
}, 5000);
};
// Helper function to render the network overview
const renderOverview = () => {
const { networkStats, tokenomics } = mockTokenData;
return (
Token Supply & Distribution
{networkStats.totalTokens.toLocaleString()}
Total Tokens
Circulating Supply
{networkStats.circulatingSupply.toLocaleString()} tokens
Reserved Pool
{networkStats.reservedPool.toLocaleString()} tokens
Network Metrics
💰
${networkStats.tokenPrice.toFixed(2)}
Token Price
📊
${networkStats.marketCap.toLocaleString()}
Market Cap
👥
{networkStats.stakeholders.toLocaleString()}
Stakeholders
🔌
{networkStats.chargingHubs}
Charging Hubs
Token Distribution
{tokenomics.distribution.map((segment, index) => {
const previousSegments = tokenomics.distribution
.slice(0, index)
.reduce((sum, item) => sum + item.percentage, 0);
return (
);
})}
{tokenomics.distribution.map((segment, index) => (
{segment.category}
{segment.percentage}%
))}
Token Utility Functions
{tokenomics.utilityFunctions.map((utility, index) => (
))}
Value Drivers
Driver
Impact
Description
{tokenomics.valueDrivers.map((driver, index) => (
{driver.driver}
{driver.impact}
{driver.description}
))}
);
};
// Helper function to render the wallet tab
const renderWallet = () => {
const { userWallet } = mockTokenData;
return (
⬡
{userWallet.balance}
Available Tokens
${(userWallet.balance * mockTokenData.networkStats.tokenPrice).toFixed(2)}
Monthly Rewards
{userWallet.stakingRewards} tokens
${(userWallet.stakingRewards * mockTokenData.networkStats.tokenPrice).toFixed(2)}
Staked Amount
20 tokens
${(20 * mockTokenData.networkStats.tokenPrice).toFixed(2)}
Manage Staking
Token Actions
handleTokenActionSelect('redeem')}
>
Redeem for Credits
handleTokenActionSelect('stake')}
>
Stake Tokens
handleTokenActionSelect('vote')}
>
Governance Vote
{tokenAction && (
{tokenAction === 'redeem' ? 'Redeem Tokens for Credits' :
tokenAction === 'stake' ? 'Stake Tokens for Rewards' :
'Use Tokens for Governance Vote'}
{tokenAction === 'redeem' && (
Charging Credits:
{tokenAmount * 10} credits
)}
{tokenAction === 'stake' && (
Monthly Rewards:
{(tokenAmount * 0.085 / 12).toFixed(2)} tokens
)}
{tokenAction === 'vote' && (
Voting Power:
{tokenAmount} votes
)}
Token Value:
${(tokenAmount * mockTokenData.networkStats.tokenPrice).toFixed(2)}
Confirm {tokenAction === 'redeem' ? 'Redemption' : tokenAction === 'stake' ? 'Staking' : 'Vote'}
)}
Transaction History
setSelectedAsset(null)}
>
All Transactions
handleAssetSelect('acquisition')}
>
Token Acquisition
handleAssetSelect('usage')}
>
Token Usage
{!selectedAsset && (
<>
{userWallet.acquisitionHistory.map((transaction, index) => (
{transaction.date}
{transaction.source}
+{transaction.amount} tokens
Completed
))}
{userWallet.transactionHistory.map((transaction, index) => (
{transaction.date}
{transaction.type}
{transaction.amount > 0 ? `-${transaction.amount} tokens` : 'N/A'}
{transaction.status}
))}
>
)}
{selectedAsset === 'acquisition' && (
<>
{userWallet.acquisitionHistory.map((transaction, index) => (
{transaction.date}
{transaction.source}
+{transaction.amount} tokens
Completed
))}
>
)}
{selectedAsset === 'usage' && (
<>
{userWallet.transactionHistory.map((transaction, index) => (
{transaction.date}
{transaction.type}
{transaction.amount > 0 ? `-${transaction.amount} tokens` : 'N/A'}
{transaction.status}
))}
>
)}
);
};
// Helper function to render the asset ownership tab
const renderAssetOwnership = () => {
const { assetOwnership } = mockTokenData;
return (
Your Network Ownership
{(assetOwnership.totalOwnership * 100).toFixed(4)}%
of The Link Network
Token Holdings
{mockTokenData.userWallet.balance} tokens
Network Value
${(mockTokenData.networkStats.marketCap).toLocaleString()}
Your Share Value
${(mockTokenData.networkStats.marketCap * assetOwnership.totalOwnership).toFixed(2)}
Projected Returns
{assetOwnership.projectedReturns.map((quarter, index) => (
{`Q${quarter.quarter} ${quarter.year}`}
${quarter.returns.toFixed(2)}
))}
Projected returns based on current token holdings and network growth forecasts.
Your Infrastructure Holdings
{assetOwnership.hubs.map((hub, index) => (
Ownership Stake
{(hub.ownership * 100).toFixed(4)}%
Monthly Revenue
{hub.monthlyRevenue > 0 ? `$${hub.monthlyRevenue.toFixed(2)}` : 'Pending'}
Token Allocation
{Math.round(mockTokenData.userWallet.balance * (hub.ownership / assetOwnership.totalOwnership))} tokens
View Details
))}
Network Growth Opportunities
🏙️
Urban Hub Expansion
New charging hubs planned for Chicago metro area in Q3 2025.
Min. Investment
50 tokens
Express Interest
🛣️
I-55 Corridor
Strategic corridor deployment connecting Chicago to St. Louis.
Min. Investment
25 tokens
Express Interest
🔋
Battery Storage Upgrade
Technology upgrade for existing hubs to increase capacity.
Min. Investment
10 tokens
Express Interest
);
};
// Helper function to render the market data tab
const renderMarketData = () => {
const { marketData } = mockTokenData;
return (
Token Price
${mockTokenData.networkStats.tokenPrice.toFixed(2)}
+6.6% (30d)
{marketData.priceHistory.map((month, index) => (
))}
{marketData.priceHistory.map((month, index) => (
{month.month}
))}
Trading Volume
{marketData.volumeHistory.map((month, index) => (
{month.month}
{month.volume.toLocaleString()}
))}
Price Projections
{marketData.projections.map((quarter, index) => (
{quarter.quarter}
${quarter.highEstimate.toFixed(2)}
${quarter.lowEstimate.toFixed(2)}
))}
Projections based on network growth, EV adoption rates, and infrastructure expansion plans.
Actual results may vary.
Market Insights
Illinois EV adoption projected to reach 7.8% by end of 2025
State incentives for charging infrastructure increasing by 25%
Phase 2 expansion adding 8 new charging hubs in Q3 2025
Corporate fleet partnerships expected to drive token demand
Regulatory changes in tokenized asset classification
Competition from other charging networks
Supply chain constraints for charging equipment
Potential delays in infrastructure deployment timeline
Token governance system launching in Q3 2025
Secondary market for token trading in development
Enhanced staking rewards program planned for Q4 2025
Cross-network partnerships with other mobility tokens
);
};
// Helper function to render the token flow visualization
const renderTokenFlow = () => {
return (
Token Flow Visualization
👤
Subscribers
1,250 users
⬡
Token Network
1M tokens
🔌
Charging Hubs
36 locations
💰
Revenue Pool
$125K monthly
Infrastructure Investment
Animate Token Flow
How ChainLink Tokens Work
1
Token Distribution
Unity Fleet subscribers earn ChainLink tokens monthly as part of their subscription.
These tokens represent fractional ownership in The Link charging infrastructure.
2
Token Utility
Tokens can be redeemed for charging credits, applied to subscription discounts,
or held as an investment in the growing charging network.
3
Infrastructure Expansion
Token value is backed by physical charging infrastructure. As the network grows,
token holders benefit from increased utility and potential value appreciation.
4
Revenue Sharing
Charging revenue is distributed to token holders proportional to their ownership stake,
creating a sustainable economic model that aligns all stakeholders.
Benefits of Tokenization
🔄
Circular Economy
Creates a closed-loop system where subscribers become stakeholders,
aligning incentives across the ecosystem.
📊
Transparent Ownership
Blockchain-based tokens provide clear, verifiable ownership records
and automated distribution of benefits.
🌱
Sustainable Funding
Tokenization creates a sustainable funding model for infrastructure
development without relying solely on external investment.
🔐
Community Governance
Token holders can participate in network decisions, ensuring
the system evolves to meet community needs.
);
};
if (loading) {
return (
Loading ChainLink Tokenization Demo...
);
}
return (
ChainLink Tokenization
Unity Fleet Ownership Model
Token Price:
${mockTokenData.networkStats.tokenPrice.toFixed(2)}
+6.6%
Market Cap:
${mockTokenData.networkStats.marketCap.toLocaleString()}
setActiveTab('overview')}
>
Network Overview
setActiveTab('wallet')}
>
Token Wallet
setActiveTab('ownership')}
>
Asset Ownership
setActiveTab('market')}
>
Market Data
setActiveTab('flow')}
>
Token Flow
{activeTab === 'overview' && renderOverview()}
{activeTab === 'wallet' && renderWallet()}
{activeTab === 'ownership' && renderAssetOwnership()}
{activeTab === 'market' && renderMarketData()}
{activeTab === 'flow' && renderTokenFlow()}
{showConfirmation && (
Confirm Token Action
Action:
{tokenAction === 'redeem' ? 'Redeem Tokens for Credits' :
tokenAction === 'stake' ? 'Stake Tokens for Rewards' :
'Use Tokens for Governance Vote'}
Amount:
{tokenAmount} tokens
Value:
${(tokenAmount * mockTokenData.networkStats.tokenPrice).toFixed(2)}
{tokenAction === 'redeem' && (
Credits:
{tokenAmount * 10} charging credits
)}
{tokenAction === 'stake' && (
Monthly Reward:
{(tokenAmount * 0.085 / 12).toFixed(2)} tokens
)}
setShowConfirmation(false)}>Cancel
Confirm
)}
);
}
export default ChainlinkDemo;