ajibadeabd / multiSwap

MIT License
0 stars 0 forks source link

Observation #8

Open ezesundayeze opened 1 year ago

ezesundayeze commented 1 year ago

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 entryopy

https://github.com/ajibadeabd/multiSwap/blob/cb04b55de2758a0fdebecbbac71e6288e7bdffb8/contracts/EthFarm.sol#L64

ajibadeabd commented 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)

ezesundayeze commented 1 year ago

hmmm.

ajibadeabd commented 1 year ago

hmmm.

closeTime is like openingTime + duration(2 days). is there a better implementation

ezesundayeze commented 1 year ago

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.

ajibadeabd commented 1 year ago

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.

hmm, pretty much explanatory. will imlplement that. thanks