> For the complete documentation index, see [llms.txt](https://docs.5sky.io/ecosystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.5sky.io/ecosystem/faq/lottery-smart-contract.md).

# Lottery Smart Contract

🎰 Welcome to the Lottery Smart Contract FAQ! 🎰

1. **What does "Contract Source Code Verified" mean?**
   * It means the source code of the smart contract is publicly accessible and matches the bytecode stored on the blockchain, ensuring transparency and trust.
2. **How are lottery chances recorded and winners selected?**
   * When an NFT is purchased or upgraded, 5% of the payment and the designated chances for that tier are logged into the Lottery contract. Winners are selected after a 25-day cycle from the last draw.
3. **How is randomness ensured in the lottery system?**
   * The lottery uses Chainlink's Verifiable Random Function (VRF) to ensure unbiased, verifiable, and truly random numbers.
4. **What is Chainlink's VRF?**
   * Chainlink's VRF is designed for applications requiring genuine, unpredictable, and verifiable random numbers. It ensures the generation of random numbers on the blockchain is secure, transparent, and verifiable.
5. **How are the lottery prizes distributed?**
   * The tokens in the contract are distributed among winners as follows:
     * First-place NFT: 55%.
     * Second-place NFT: 25%.
     * Third-place NFT: 15%.
     * 5% is transferred to a charitable wallet.
6. **Can an NFT win multiple prizes in one lottery?**
   * Yes, an NFT can win in all three levels simultaneously in one lottery if it has multiple chances.
7. **Who can invoke the functions of the lottery contract?**
   * Anyone can invoke the functions, provided 25 days have passed since the last lottery.
8. **What happens after the lottery is conducted?**
   * The lottery time is registered in the contract, and the date for the next lottery is set for 25 days later.
9. **How are chances added to NFTs?**
   * Chances are added to NFTs through the main contract upon invoking functions like purchase or upgrade.
