This repository contains the Foundry smart contract, a Solidity-based system for user registration, daily check-ins, XP point management, and booster purchases.
The Foundry contract implements a gamified system where users can register, perform daily check-ins to earn XP points, purchase boosters to increase their XP earnings, and convert their XP points to NZT.
- User registration
- Daily check-ins with increasing rewards for consecutive days
- Booster system to multiply XP earnings
- XP to NZT conversion
- Owner-controlled pricing and conversion rates
- Solidity Version: ^0.8.16
- License: MIT
-
Register User
function registerUser() public
Registers a new user in the system.
-
Daily Check-in
function dailyCheckIn() public
Allows users to check in daily and earn XP points.
-
Purchase Booster
function purchaseBooster(uint256 plan) public payable
Enables users to purchase a booster plan to increase XP earnings.
-
Withdraw XP
function withdrawXP() public
Converts user's XP points to NZT and transfers it to their account.
-
Fetch User Info
function fetchUserInfo(address _address) public view returns(User memory)
Retrieves user information for a given address.
-
Change Booster Prices
function changeBoosterPrices(uint256[5] memory newPrices) public onlyOwner
-
Change XP Conversion Rate
function changeXpConversionRate(uint256 newRate) public onlyOwner
-
Deposit NZT
function depositNZT() public payable onlyOwner
-
Withdraw NZT
function withdrawNZT(uint256 amount) public onlyOwner
- The contract uses
onlyOwner
modifier to restrict access to sensitive functions. - Booster duration is set to 28 days and is checked before application.
- Proper checks are implemented to prevent reentrancy and other common vulnerabilities.
This project is licensed under the MIT License.