sumasamurai / predictor-challenge

MIT License
3 stars 5 forks source link

Determine if a round is valid for play. #5

Closed sumasamurai closed 11 months ago

sumasamurai commented 11 months ago

To determine if a round is valid for play, you can set certain criteria or conditions. Here's a general example of how you might define the function:

function _playable(uint256 epoch) internal view returns (bool) {
    return
        rounds[epoch].startTimestamp != 0 &&
        rounds[epoch].closeTimestamp != 0 &&
        block.timestamp > rounds[epoch].startTimestamp &&
        block.timestamp < rounds[epoch].closeTimestamp;
}