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?

2 Answers 2


There may be more recent/relevant solutions but I have used Ethereum Alarm Clock in the past with good results.


this is exactly a use case for Gelato Automate from Gelato Network, you create a task and set when should be executed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.