Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

lotteryStatus #11

Open
aklein-dex opened this issue Mar 29, 2021 · 0 comments
Open

lotteryStatus #11

aklein-dex opened this issue Mar 29, 2021 · 0 comments

Comments

@aklein-dex
Copy link

Hey guys,
I'm new to solidity and I was looking at your code to try to understand how things work.
Anyway, isn't this test incorrect:

if(_startingTimestamp >= getCurrentTime()) {

if(_startingTimestamp >= getCurrentTime()) {
     lotteryStatus = Status.Open;
} else {
      lotteryStatus = Status.NotStarted;
}

If the starting timestamp is bigger than the current time, then the status should be NotStarted. It should be like this:

if(_startingTimestamp >= getCurrentTime()) {
     lotteryStatus = Status.NotStarted;
} else {
      lotteryStatus = Status.Open;
}

And maybe I would add a "require" to make sure that _closingTimestamp is bigger than getCurrentTime(). Because there is no point to create a lottery that is already closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant