hackquest logo
  • 学习
  • 课程探索
  • 实战
  • 探索黑客松
  • 往期项目
  • 社区
  • 论坛
  • 全球活动
  • 我的社区
  • 共学营
  • 组织中心
  • 更多
    • 词汇表
    • 博客
    • 水龙头
    • 工作机会
    • 媒体工具包
    • 创始人
hackquest logo

DailyCheckIn

The Daily Login Reward System is an innovative decentralized application (dApp) designed to incentivize user engagement through a blockchain-based reward mechanism. Built with Solidity, the smart cont

技术栈

Move
Solidity
React

描述

The Daily Login Reward System is a blockchain-based decentralized application (dApp) that rewards users for daily engagement. Its backbone is a Solidity smart contract deployed on the Ethereum network, featuring a straightforward yet robust design. The contract uses two key mappings: lastLogin tracks each user’s most recent claim timestamp, while userRewards records their accumulated rewards. Users can claim a fixed 1 ETH reward every 24 hours (86,400 seconds), enforced by a COOLDOWN_PERIOD constant. The claimReward() function updates these mappings and emits a RewardClaimed event, while getRewardBalance() and timeUntilNextReward() provide read-only access to a user’s status. Written for Solidity ^0.8.0, it avoids external dependencies, ensuring simplicity and security.

The frontend, built with HTML, CSS, and JavaScript, integrates Web3.js to connect to the Ethereum network via MetaMask. Hosted locally (e.g., via python -m http.server), it features a modern interface with a gradient background, animated buttons, and a dynamic cooldown progress bar. Users connect their wallets (like

本次黑客松进展

0
队长
Hhq_1742449659
项目链接
赛道
SocialFiNFTDeFi