Skip to content

Nonmember can still "cast" a vote #28

@oslfmt

Description

@oslfmt

While writing the tests for Governance.sol, I came upon something unexpected. I expected that when a non-member casts a vote, the function would throw an error, saying that this person is not a member. But it does not, and the reason is because the way the OZ contracts are designed, is that there is no concept of membership, technically. Rather it's voting power that allows someone to vote, and voting power is obtained by owning ERC20/ERC721 tokens.

When a non-member votes, the transaction will still complete successfully, but the vote will have no weight. This is because non-members have no NFT, and thus no voting power, and so their weight == 0. The vote is "cast", but it does not count for anything. As far as I can tell, the design is still safe for our purposes.

However, we'll probably want to have some function to check if a person is logged-in/a member on the frontend, and if not, don't even give them the option to vote, or have some message specifying why they can't. Otherwise, they could still "vote" successfully, but it just doesn't make too much sense from a UX pov @CptAstro @jagger-harris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions