About USDT

The Future of DeFi

USDT is a cutting-edge decentralized finance platform that combines innovative trading mechanisms with gamified experiences to create the ultimate DeFi ecosystem.

Lightning Fast

Execute trades and mint NFTs with minimal latency and maximum efficiency.

Secure & Audited

Smart contracts audited by leading security firms to ensure your funds are safe.

Community Driven

Built by the community, for the community with transparent governance.

High Yields

Maximize your returns with our innovative DeFi products and strategies.

Our Mission

To democratize access to advanced financial instruments and create a more inclusive financial system where everyone can participate, earn, and grow their wealth through innovative DeFi solutions.

$50M+

Total Value Locked

100K+

Active Users

24/7

Platform Uptime

Erc721 Lottery NFT Smart Contract

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import {ERC721} from "@openzeppelin-5.0.1/contracts/token/ERC721/ERC721.sol";
import {IERC2981} from "@openzeppelin-5.0.1/contracts/interfaces/IERC2981.sol";
import {Ownable} from "@openzeppelin-5.0.1/contracts/access/Ownable.sol";
import {Strings} from "@openzeppelin-5.0.1/contracts/utils/Strings.sol";
import {ERC2981} from "@openzeppelin-5.0.1/contracts/token/common/ERC2981.sol";

/**
 * @title LotteryNFT
 * @dev ERC721-compliant NFT contract with embedded lottery participation and EIP-2981 royalty support.
 */
contract LotteryNFT is ERC721, ERC2981, Ownable {
    using Strings for uint256;

    uint256 public constant MAX_SUPPLY = 1_000_000;
    uint256 public totalMinted;
    address public immutable developer;
    string private baseTokenURI;
    mapping(uint256 => uint8[6]) public tokenNumbers;

    constructor(address _developer, string memory _baseURI) ERC721("Lottery NFT", "LTRY") {
        require(_developer != address(0), "Invalid developer address");
        developer = _developer;
        baseTokenURI = _baseURI;
        _setDefaultRoyalty(_developer, 500);
    }

    function mint(address to) external {
        require(totalMinted < MAX_SUPPLY, "Max supply reached");
        uint256 tokenId = ++totalMinted;
        _safeMint(to, tokenId);
        tokenNumbers[tokenId] = _generateNumbers(tokenId, to);
    }

    function getTokenNumbers(uint256 tokenId) external view returns (uint8[6] memory) {
        require(_exists(tokenId), "Query for nonexistent token");
        return tokenNumbers[tokenId];
    }

    function setBaseURI(string memory uri) external onlyOwner {
        baseTokenURI = uri;
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "URI query for nonexistent token");
        return string(abi.encodePacked(baseTokenURI, tokenId.toString()));
    }

    function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC2981) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    function _generateNumbers(uint256 tokenId, address to) internal view returns (uint8[6] memory) {
        uint8[6] memory numbers;
        uint256 seed = uint256(keccak256(abi.encodePacked(block.timestamp, to, tokenId, block.prevrandao)));

        for (uint256 i = 0; i < 6; i++) {
            seed = uint256(keccak256(abi.encodePacked(seed, i)));
            numbers[i] = uint8((seed % 49) + 1);
        }

        return numbers;
    }
}