Skip to content
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

Merged
merged 6 commits into from
May 1, 2020
Merged

Audit fixes #3

merged 6 commits into from
May 1, 2020

Conversation

maxaleks
Copy link
Collaborator

  1. locked pragma
  2. added dependency information to readme
  3. improved validation of min and max deposits
  4. improved validation of prize sizes
  5. improved validation of round duration

@maxaleks maxaleks requested a review from varasev April 30, 2020 13:40
require(_roundDuration > 0, "should be greater than 0");
uint256 randomUpdateInterval = random.getUpdateInterval();
require(
_roundDuration > randomUpdateInterval.mul(4).mul(blockTime) && _roundDuration > blockTime.mul(40),
Copy link
Contributor

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?

Copy link
Collaborator Author

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?

Copy link
Contributor

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?

Copy link
Collaborator Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@maxaleks maxaleks merged commit 5d6c91d into master May 1, 2020
@maxaleks maxaleks deleted the audit-fixes branch May 1, 2020 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants