Skip to content
This repository was archived by the owner on Jul 10, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all 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
49 changes: 10 additions & 39 deletions contracts/adapters/voting/OffchainVotingHash.sol
Original file line number Diff line number Diff line change
Expand Up @@ -188,48 +188,19 @@ contract OffchainVotingHashContract {
node.proposalId,
snapshot
);

if (node.choice == 0) {
if (params.previousYes != node.nbYes) {
return true;
} else if (params.previousNo != node.nbNo) {
return true;
}

if (node.choice == 0 && (params.previousYes != node.nbYes || params.previousNo != node.nbNo)) {
return true;
}

if (
hasVoted(
dao,
actionId,
voter,
node.timestamp,
node.proposalId,
1,
node.sig
)
) {
if (params.previousYes + weight != node.nbYes) {
return true;
} else if (params.previousNo != node.nbNo) {
return true;
}
bool isVoted1 = hasVoted(dao, actionId, voter, node.timestamp, node.proposalId, 1, node.sig);
if (isVoted1&& (params.previousYes + weight != node.nbYes || params.previousNo != node.nbNo)) {
return true;
}
if (
hasVoted(
dao,
actionId,
voter,
node.timestamp,
node.proposalId,
2,
node.sig
)
) {
if (params.previousYes != node.nbYes) {
return true;
} else if (params.previousNo + weight != node.nbNo) {
return true;
}

bool isVoted2 = hasVoted(dao, actionId, voter, node.timestamp, node.proposalId, 2, node.sig);
if (isVoted2 && (params.previousYes != node.nbYes || params.previousNo + weight != node.nbNo)) {
return true;
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion contracts/helpers/OffchainVotingHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ contract OffchainVotingHelperContract {
return IVoting.VotingState.GRACE_PERIOD;
}

// If the vote has started but the voting period has not passed yet, it's in progress
// If the vote has started but the grace period has not finished yet, it's in GRACE_PERIOD
// slither-disable-next-line timestamp
if (block.timestamp < gracePeriodStartingTime + gracePeriod) {
return IVoting.VotingState.GRACE_PERIOD;
Expand Down