Decentralized raffle using PYUSD with fair winner selection powered by Pyth entropy.
Pharos is a decentralized raffle platform that enables fair, verifiable raffles for physical goods, digital assets, and crypto prizes. It uses Pyth Network’s entropy for on-chain randomness, so winners are provable and cannot be predicted or manipulated. Users connect their wallet, browse live raffles (like limited edition sneakers, concert tickets, or cash prizes), purchase tickets using PYUSD (PayPal's stablecoin), and the smart contract automatically selects winners when the raffle closes.
This DApp is built using OpenZeppelin contracts and protected with ReentrancyGuard. It picks winners using Pyth Network Entropy, which gives secure and verifiable randomness through a callback and commitment system — meaning no one can cheat or control the outcome.
The app reads raffle details from IPFS and interacts with smart contracts using a single ABI method.
It’s built with Solidity, Hardhat, Next.js, Viem, Wagmi, TypeScript, and TailwindCSS. Data is fetched using ethers.js v5, and wagmi hooks connect the blockchain data with the UI.
Smart contracts handle the commit–reveal process, use both ETH (for Pyth fees) and PYUSD (for tickets), and rely on SafeERC20 for safe token transfers. Only authorized roles can perform admin actions. Winners are chosen based on weighted random selection — more tickets mean higher chances.
Contracts also set limits like the maximum number of tickets per user, raffle time windows, and factory-based creation for new raffles. The factory manages gas and fund requests.
The frontend shows raffles, filters and sorts data from on-chain events, and uses skeleton loading for a smooth user experience.
Security is ensured through ReentrancyGuard, SafeERC20, user limits, and event logs for transparency. Because randomness comes directly from Pyth’s on-chain entropy, all winners can be verified publicly, with no need to trust any central authority.

