The Beamswap Lottery is a fully on-chain, fair and provable drawing service leveraging the randomness precompile.

Draw Process and Prize Brackets

At each lottery round, a verification process is run to finalize the draw results and allow winners to claim their prizes. This process is designed to be fair, transparent, and secure.
Below is a simple, non-technical breakdown of how the Beamswap Lottery works, including examples of winning bracket setups.

Step 1: Conditions Check


The Beamswap Lottery draw is initiated and executed under a designated operator's supervision to ensure everything runs smoothly and fairly.

Lottery Status

Before every draw, the ticket buy window is closed, meaning no tickets can be bought during the draw.

Step 2: Draw

The system randomly selects a 6-digit winning number using the randomness precompile from Moonbeam.

Step 3: Winner Calculation

Prize Levels

The Beamswap Lottery recognizes different winning set-ups based on the number of consecutive digits on your ticket that match the winning number from right to left. More matching digits typically lead to a higher prize.

Examples of Wins

For the purpose of this example, let's assume the winning number in a particular draw is "456789".

Example 1: Three-Bracket Win

  • Your Ticket: Your ticket number is also "456123", and it matches the winning number in three different brackets:
    • 1st Bracket (First Digit): Both yours and the winning number have "4" as the first digit.
    • 2nd Bracket (Two Digits): Both have "45" as the first two digits.
    • 3rd Bracket (Three Digits): Both have "456" as the first three digits.
  • Result: You're eligible for prizes from each of these three brackets according to the Lottery's rules and prize distribution.

Example 2: One-Bracket Win

  • Your Ticket: Your ticket number is "423459", and it only matches the winning number in the 1st bracket:
    • 1st Bracket (First Digit): Both yours and the winning number have "4" as the First digit.
  • Result: You're eligible for the prize associated with the 1st bracket only.

Step 4: Prize Distribution

Prize Calculation

The prize for each bracket is determined by the total amount collected from ticket sales, the predefined prize breakdown for each bracket, and the number of winners in that bracket.

Prize Claim

Once the results are finalized and the lottery status changes to "Claimable", winners can claim their prizes based on the rules set forth in the smart contract.

Treasury Fee Allocation

The protocol allocates fees collected from this feature in the following manner:
  • 20% of GLMR is allocated for the buyback and burning of GLINT.
  • 60% of GLMR is distributed as rewards to stGLINT stakers.
  • The remaining 20% of GLMR is utilized for the maintenance of this feature.
Please be aware that these percentages are subject to change at any time.

Transparency and Security


The Beamswap Lottery contract is designed to ensure that the draw and prize distribution are conducted transparently and equitably.

Security Measures

Features like non-reentrancy guards are used to prevent potential security threats, ensuring the integrity of the Lottery.


Beamswap Lottery is designed to provide a fun and fair way to participate in a game of chance. Whether you win in multiple brackets or just one, the system ensures you receive your winnings according to the prize distribution rules.
Good luck, and may the odds be in your favor!