-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit fixes #3
Audit fixes #3
Conversation
maxaleks
commented
Apr 30, 2020
- locked pragma
- added dependency information to readme
- improved validation of min and max deposits
- improved validation of prize sizes
- improved validation of round duration
contracts/PoaMania.sol
Outdated
require(_roundDuration > 0, "should be greater than 0"); | ||
uint256 randomUpdateInterval = random.getUpdateInterval(); | ||
require( | ||
_roundDuration > randomUpdateInterval.mul(4).mul(blockTime) && _roundDuration > blockTime.mul(40), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move randomUpdateInterval.mul(2).mul(blockTime)
to a private function and use such a function in _setRoundDuration()
and in getLockStart()
.
How did you get 40 blocks? Why 40 exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 40 exactly?
It's just the length of one random collection round. What value do you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's maybe change this part of condition to _roundDuration > blockTime.mul(randomUpdateInterval)
since randomUpdateInterval
is the collection round length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only for the case when randomUpdateInterval
is 0. But as you said me randomUpdateInterval
can't be changed, so I'll just remove this check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK