sumasamurai / predictor-challenge

MIT License
3 stars 5 forks source link

Add startRound code. #9

Closed sumasamurai closed 11 months ago

sumasamurai commented 11 months ago

This code is responsible for starting a new prediction round and recording its details in the rounds data structure. The StartRound event can be used to notify external parties or interfaces about the beginning of a new round.

event StartRound(uint256 indexed epoch);

function _startRound(uint256 epoch) internal {
    Round storage round = rounds[epoch];
    round.startTimestamp = block.timestamp;
    round.closeTimestamp = block.timestamp + 5 minutes;
    round.epoch = epoch;
    round.totalAmount = 0;

    emit StartRound(epoch);
}
sumasamurai commented 11 months ago

32