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 Jul 28, 2024. It is now read-only.
sherlock-admin opened this issue
Jan 25, 2024
· 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
require(blockNumber < block.number, "gOHM::getPriorVotes: not yet determined");
So the function getPriorVotes is not callable with the current block number, so castVoteInternal will always revert. This means users will be unable to vote.
Impact
Users cannot vote for proposals; their transactions will revert.
sherlock-admin
changed the title
Steep Teal Osprey - Voting will revert because of incorrect use of getPriorVotes
s1ce - Voting will revert because of incorrect use of getPriorVotes
Jan 30, 2024
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
s1ce
high
Voting will revert because of incorrect use of getPriorVotes
Summary
getPriorVotes
is used incorrectly which will cause all voting actions to revertVulnerability Detail
In
castVoteInternal
, there is the following line of code:uint256 currentVotes = gohm.getPriorVotes(voter, block.number);
However, if we look at the implementation of gohm on mainnet (https://etherscan.io/token/0x0ab87046fBb341D058F17CBC4c1133F25a20a52f#code):
The first line of
getPriorVotes
is:require(blockNumber < block.number, "gOHM::getPriorVotes: not yet determined");
So the function
getPriorVotes
is not callable with the current block number, socastVoteInternal
will always revert. This means users will be unable to vote.Impact
Users cannot vote for proposals; their transactions will revert.
Code Snippet
https://github.com/sherlock-audit/2024-01-olympus-on-chain-governance/blob/main/bophades/src/external/governance/GovernorBravoDelegate.sol#L446
Tool used
Manual Review
Recommendation
Use
block.number - 1
instead ofblock.number
Duplicate of #37
The text was updated successfully, but these errors were encountered: