Open ezesundayeze opened 1 year ago
@ezesundayeze
if(currentTime > openingTime && currentTime > closeTime)
Explanation-->
current time is the time the user called the staking contract. openingTime is when the betting starts closeTime is when the bet ends The below code snippet checks if the current time falls between the opening and close time.
if(currentTime > openingTime && currentTime > closeTime)
hmmm.
hmmm.
closeTime is like openingTime + duration(2 days). is there a better implementation
hmmm.
closeTime is like openingTime + duration(2 days). is there a better implementation
I see.
I think the time is supposed to be like this:
Start time
: the time at which the bet was started.
OpenWindow
: the period when it is still valid to place a bet
endTime
: the time the bet ends
currentTime
: the time the user made the transaction.
hmmm.
closeTime is like openingTime + duration(2 days). is there a better implementation
I see.
I think the time is supposed to be like this:
Start time
: the time at which the bet was started.OpenWindow
: the period when it is still valid to place a betendTime
: the time the bet endscurrentTime
: the time the user made the transaction.
hmm, pretty much explanatory. will imlplement that. thanks
I took a second look at this, I think it's counter-intuitive, I might be misreading it; I believe the
currentTime > openingTime
is supposed to be valid and shouldn't be as one of the checks. Because you want the user to bet between opening time to a specific time, maybe 2 hours before the closing time. Whatever increases the entryopyhttps://github.com/ajibadeabd/multiSwap/blob/cb04b55de2758a0fdebecbbac71e6288e7bdffb8/contracts/EthFarm.sol#L64