This Solidity smart contract rewards users for logging in daily. Users can claim a fixed reward once every 24 hours, and their rewards are stored within the contract.
- Users can claim rewards once per day.
- Keeps track of the last claimed timestamp for each user.
- Rewards are stored in a balance mapping.
- No external imports or constructors for simplicity.
- Allows users to claim their daily reward.
- Ensures that at least 24 hours have passed since the last claim.
- Updates the user's balance upon successful claim.
- Returns the total accumulated rewards of the caller.
- Use a Solidity-compatible development environment (e.g., Remix, Hardhat).
- Compile and deploy the contract.
- Users can interact with the contract by calling
claimReward()and checking their balance usinggetBalance().
- Reward Amount:
1 ether(for representation, not actual ETH). - Claim Interval:
1 day(24 hours between claims). - Storage: Uses mappings to track last claim times and balances.
- This contract does not distribute real tokens but keeps an internal record of rewards.
- The values can be adjusted within the contract code before deployment.
This project is open-source and available for modification and distribution under the MIT License.