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

fix: add check on isParticipatingInUpcomingRound #270

Merged
merged 4 commits into from
Sep 9, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Redistribution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -801,11 +801,13 @@ contract Redistribution is AccessControl, Pausable {
* @param _depth The storage depth the applicant intends to report.
*/
function isParticipatingInUpcomingRound(address _owner, uint8 _depth) public view returns (bool) {
uint256 _lastUpdate = Stakes.lastUpdatedBlockNumberOfAddress(_owner);

if (currentPhaseReveal()) {
revert WrongPhase();
}

if (Stakes.lastUpdatedBlockNumberOfAddress(_owner) >= block.number - 2 * ROUND_LENGTH) {
if (_lastUpdate >= block.number - 2 * ROUND_LENGTH && _lastUpdate == 0) {
0xCardinalError marked this conversation as resolved.
Show resolved Hide resolved
revert MustStake2Rounds();
}

Expand Down
Loading