I’m trying to create a raffle system, where a smart contract will be holding a nft until a specific timestamp is passed. The timestamp is set at contract creation. I’m trying to think of some mechanism to check the time and draw a winner if the raffle is expired.
My initial thought was having an event loop in the backend server fetching the current unix timestamp and comparing it with the contract’s unix. But I’m trying to keep things as decentralized as possible and I’m unsure about the security of that.
What could I do to check this, in the safest manner possible?