Can I set counting mode this way? Will there be any issues?

My question is there anything wrong with my function?

    function COUNTING_MODE()
        returns (string memory)
        return "support=bravo&quorum=against";

The following is from Openzeppelin Documentation:

A description of the possible support values for castVote and the way these votes are counted, meant to be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of key-value pairs that each describe one aspect, for example support=bravo&quorum=for,abstain.

There are 2 standard keys: support and quorum.

support=bravo refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in GovernorBravo.

quorum=bravo means that only For votes are counted towards quorum.

quorum=for,abstain means that both For and Abstain votes are counted towards quorum.

If a counting module makes use of encoded params, it should include this under a params key with a unique name that describes the behavior. For example:

params=fractional might refer to a scheme where votes are divided fractionally between for/against/abstain.

params=erc721 might refer to a scheme where specific NFTs are delegated to vote.

Following the official documentation, it seems that there is nothing wrong with your function.

1 Like