Description
Display user-specific data on the profile page, including submitted memes, votes cast, staked amounts, and won NFTs.
Tasks
Contract Functions Used
MemeRegistry.memes(uint256) - Get meme details (iterate through all memes to find user's)
VotingEngine.votes(uint256, address) - Get user's vote for each battle
WinningMemeNFT.balanceOf(address) - Get user's NFT count
WinningMemeNFT.tokenOfOwnerByIndex(address, uint256) - Get NFT token IDs (if implemented)
WinningMemeNFT.tokenOfMeme(uint256) - Get NFT token ID for meme
Files to Modify
frontend/app/profile/page.tsx
frontend/hooks/useUserMemes.ts (new file)
frontend/hooks/useUserVotes.ts (new file)
frontend/hooks/useUserNFTs.ts (new file)
Description
Display user-specific data on the profile page, including submitted memes, votes cast, staked amounts, and won NFTs.
Tasks
useUserMemes(userAddress)to fetch all memes submitted by useruseUserVotes(userAddress)to fetch all votes cast by user across all battlesuseUserNFTs(userAddress)to fetch winning NFTs fromWinningMemeNFTContract Functions Used
MemeRegistry.memes(uint256)- Get meme details (iterate through all memes to find user's)VotingEngine.votes(uint256, address)- Get user's vote for each battleWinningMemeNFT.balanceOf(address)- Get user's NFT countWinningMemeNFT.tokenOfOwnerByIndex(address, uint256)- Get NFT token IDs (if implemented)WinningMemeNFT.tokenOfMeme(uint256)- Get NFT token ID for memeFiles to Modify
frontend/app/profile/page.tsxfrontend/hooks/useUserMemes.ts(new file)frontend/hooks/useUserVotes.ts(new file)frontend/hooks/useUserNFTs.ts(new file)