Skip to content

Nexis-Network/foundry-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Foundry Smart Contract

This repository contains the Foundry smart contract, a Solidity-based system for user registration, daily check-ins, XP point management, and booster purchases.

Table of Contents

Overview

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.

Features

  • 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

Contract Details

  • Solidity Version: ^0.8.16
  • License: MIT

Usage

User Functions

  1. Register User

    function registerUser() public

    Registers a new user in the system.

  2. Daily Check-in

    function dailyCheckIn() public

    Allows users to check in daily and earn XP points.

  3. Purchase Booster

    function purchaseBooster(uint256 plan) public payable

    Enables users to purchase a booster plan to increase XP earnings.

  4. Withdraw XP

    function withdrawXP() public

    Converts user's XP points to NZT and transfers it to their account.

  5. Fetch User Info

    function fetchUserInfo(address _address) public view returns(User memory)

    Retrieves user information for a given address.

Owner Functions

  1. Change Booster Prices

    function changeBoosterPrices(uint256[5] memory newPrices) public onlyOwner
  2. Change XP Conversion Rate

    function changeXpConversionRate(uint256 newRate) public onlyOwner
  3. Deposit NZT

    function depositNZT() public payable onlyOwner
  4. Withdraw NZT

    function withdrawNZT(uint256 amount) public onlyOwner

Security

  • 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.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published