You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 27, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Users able to deposit at epoch time they are not suppose to
Summary
if block.timestamp == epochConfig[_id].epochBegin then both modifiers will not revert which is probably not correct. There is variable _epochEnd in the contract that is not being used and seems like it is supposed to be in those modifiers.
modifier epochHasNotStarted(uint256_id) {
if (block.timestamp> epochConfig[_id].epochBegin)
revertEpochAlreadyStarted();
_;
}
/** @notice You can only call functions that use this modifier after the epoch has started */modifier epochHasStarted(uint256_id) {
if (block.timestamp< epochConfig[_id].epochBegin)
revertEpochNotStarted();
_;
}
Users are able to deposit at epoch times they are not supposed to
Code Snippet
Tool used
Manual Review
Recommendation
/** @notice You can only call functions that use this modifier before the epoch has started */modifier epochHasNotStarted(uint256_id) {
if (block.timestamp>= epochConfig[_id].epochBegin &&block.timestamp<= epochConfig[_id].epochEnd)
revertEpochAlreadyStarted();
_;
}
/** @notice You can only call functions that use this modifier after the epoch has started */modifier epochHasStarted(uint256_id) {
if (block.timestamp< epochConfig[_id].epochBegin &&block.timestamp> epochConfig[_id].epochEnd)
revertEpochNotStarted();
_;
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
volodya
medium
Users able to deposit at epoch time they are not suppose to
Summary
if
block.timestamp == epochConfig[_id].epochBegin
then both modifiers will not revert which is probably not correct. There is variable_epochEnd
in the contract that is not being used and seems like it is supposed to be in those modifiers.VaultV2.sol#L432
Vulnerability Detail
Impact
Users are able to deposit at epoch times they are not supposed to
Code Snippet
Tool used
Manual Review
Recommendation
Duplicate of #480
The text was updated successfully, but these errors were encountered: