BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

`Function:_setFinallizedVaultBalance ()` time check conflicts with `Function:setWinner()` thime check

Function:_setFinallizedVaultBalance () time check conflicts with Function:setWinner() thime check

Description
In Function:_setFinallizedVaultBalance (), check logic is

if (block.timestamp <= eventStartDate) {
revert eventNotStarted();
}

But in Function:setWinner(), check logic is

function setWinner(uint256 countryIndex) public onlyOwner returns (string memory) {
......
@> if (block.timestamp <= eventEndDate) {
revert eventNotEnded();
}
@> _setFinallizedVaultBalance();
......
}

It is obvious that eventEndDate > eventStartDate.

Recommended mitigation

function _setFinallizedVaultBalance () internal returns (uint256) {
- if (block.timestamp <= eventStartDate) {
+ if (block.timestamp <= eventEndDate) {
- revert eventNotStarted();
+ revert eventNotEnded();
}
return finalizedVaultAsset = IERC20(asset()).balanceOf(address(this));
}
Updates

Appeal created

bube Lead Judge 21 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!