Completing a Raffle
example usage on how completing a raffle works.
Now let's see how you can end your raffle by picking a random winner.
Before you can pick the winner, there are certain things that needs to be considered:
Total tickets sold should be >=80% of the total ticket supply (ex. 80 of 100 sold tickets required to pick a winner).
The tickets should be sold within the specified end time. if not raffle will be automatically cancelled, NFT will be reverted to the original creator, any tickets bought will be refunded.
If the user cancels the raffle, a mandatory fee of 30% of the NFT price will be levied.
To End a raffle, head to /my-raffles, here you can see every raffles you own. You can also see the current reward share for every entity.

Picking a winner for the raffle
originX leverages the ChainLink's VRF to pick a random winner.
A raffleCreator can use two functions pickWinner for a raffleId or cancelRaffle.
PickWinner:Picks the winner for a RaffleId.
Requirement:Total Sold Tickets should be greater than or equal to 80% of Total Ticket Supply.
Function:
1. Picks a Random Ticket holder as the Raffle Winner from the Total sold tickets.
2. Transfers the NFT to the Raffle Winner.
3. Prize Distribution to various entities - .
CancelRaffle: Cancels a RaffleId.
Requirements: RaffleId shouldn't been cancelled before.
Function: Refunds the ticket amounts back to the Ticket buyers & NFT to the Raffle Creator.

Internal Transactions of the selected charity address:

Congratulations on completing your first impactful raffle, you can now check your wallet transaction to see the update balance. also you got a extra 5% of the selling price. 🏆
This is the basic functionalities of originX successfully implemented. Here are some future enhancements/features that are yet to be implemented
Fractional NFTs
Charity consensus
Various other EIPs support(ERC1155, ERC4097)
Multi-chain support
Real Charity addresses (even in testnets)
Smart contract improvement
Overall UI/UX improvements
Last updated