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
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
The text was updated successfully, but these errors were encountered:
We should be able to check if that wallet has an ERC721 token. On the backend, a function implementation should suffice. In the frontend, there can be a function call extracting information on whether an address has the NFT, displaying an appropriate message.
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
The text was updated successfully, but these errors were encountered: