I want to create an escrow program in Rust on Solana with the following requirements: Anyone can send an amount to the escrow, a lottery function runs on the backend to select a winner, and the NFT is sent to the winner while the amount sent by the winner goes to the admin. The other participants get their SOL tokens back.
I'm new to Solana, and when I checked most of the repository examples, they were focused on swap exchange escrow accounts for tokens X to tokens Y. I tried to work on it, but I couldn't complete this specific task. I need an escrow solution that only deals with SOL tokens, where the admin can select the winner, the escrow holds the amount, and there is a cancel function for participants to retrieve their SOL tokens if needed.