codeterrayt/Decentralized-Raffle-System — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a simple Ethereum decentralized raffle smart contract in Solidity. I want people to be able to join as buyers, buy raffle tickets by sending exactly 1 Ether, and have the contract track how many tickets are sold and how many are still available.

There should be an organizer role and a buyer role. Only the organizer should be able to assign roles, draw the winner once all tickets are sold, and view the winner. Only buyers should be able to buy tickets. When the organizer draws a winner, pick one ticket holder pseudo randomly, then only that winner should be able to withdraw all the Ether collected from ticket sales.

Keep it simple enough to run in Remix with Solidity 0.8.x. Add clear require messages, basic security checks, and helpful getter functions so I can test the whole flow with MetaMask or Remix accounts.

Want more depth? Deep Reverse