Skip to content
Request an audit

‹ All findings

castVoteWithReason always fires a VoteCast event with an empty reason

Low/InfoM^0 Minter Gateway·Three Sigma · Stablecoin framework · 8th January, 2024Codebase3S-M^0-N14

Description

The BatchGovernor contract supports castVoteWithReason to be compatible with certain governors.

Because the VoteCast event has a reason parameter, whoever uses this external function is expecting an event being emitted with the provided reason.

Instead, the reason parameter is always empty in the event being emitted by _castVote:

solidity
function _castVote(address voter_, uint256 weight_, uint256 proposalId_, uint8 support_) internal virtual {
    // ... emit VoteCast(voter_, proposalId_, support_, weight_, "");
}

Recommendation

Make sure that the reason input of castVoteWithReason is passed through to the VoteCast event.

Status

Addressed in #b97b196.