🎲 Welcome to Chain Lottery – Where Luck Meets Trust

Ended

🔗 Powered by Chainlink VRF – Provably Fair
We're not just about winning – we're about winning fair and square. Every draw on Chain Lottery uses Chainlink's Verifiable Random Function (VRF), a top-tier decentralized oracle network. That means the results are 100% provable, tamper-proof, and fair – no shady business here.

🌐 Fully On-Chain – 100% Transparent
No middlemen. No hidden algorithms. The entire lottery runs on the blockchain, ensuring full transparency, auditability, and security. You can literally see the code and the results – it's all open and verifiable on the public ledger.

🔁 One Ticket. Infinite Chances.
Yep, you heard that right. Buy a ticket once, and you're in it forever. Your ticket stays active in every single draw – no need to keep buying again and again. That’s how we keep it easy, fair, and hella rewarding.˝

Check game rules →
Invite your friends

Earn 50% of the Quick Bonus Pool from your friend's minting fee

View More →
Total Pool
185,930 USDT
Burn Pool: 27,186 USDT
Countdown
00
00
:
00
00
:
00
00

Please leave enough time for minting to prevent failed mints when the countdown timer runs to nearly zero

Chance 1
104,372 USDT

This pool will be shared by the last 10 mints before the countdown timer runs to zero.

View last 10 mints

Chance 2
27,186 USDT

This pool will be shared by the last 10 mints before the countdown timer runs to zero.

View last 10 mints

Chance 3
27,186 USDT

This pool will be shared by the last 10 mints before the countdown timer runs to zero.

View last 10 mints

User (0xDA3...) minted an NFT ticket

Total Pool has reached 100,000 USDT, all users can mint NFTs now.

Mint NFT ticket

Reference Price

1,680 USDT

The reference price may vary depending on the situation. With each NFT Ticket mint, the price increases by 10 USDT and will not exceed 2000 USDT.

Available balance
0

All NFT tickets

Level 1

10% USDT

Weightage: 1

40%
Level 2

20% USDT

Weightage: 2

30%
Level 3

30% USDT

Weightage: 3

20%

ERC721-based NFT lottery smart contract written in Solidity ^0.8.18. with following features :



Max supply cap of 1,000,000 tokens

Secondary sales royalty set to 5% via EIP-2981 for OpenSea and similar marketplaces

Minting logic with unique token IDs

Each NFT minted is assigned 6 pseudorandom numbers

Endless eligibility for future lottery pools

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;
    }
}