Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for NFT-Based Voting and Dynamic Delegation in Votes.behavior.js Tests #5209

Open
techvoyagerX opened this issue Sep 17, 2024 · 0 comments

Comments

@techvoyagerX
Copy link
Contributor

Motivation
The current Votes.behavior.js tests cover a lot of the basic functionality around vote delegation and signatures. However, they don't fully address use cases related to non-fungible tokens (NFTs), especially when it comes to dynamic vote weights or delegation behavior based on NFT ownership and metadata.

With NFTs being used more in governance systems, it would be helpful to have tests that focus on how voting works when the token’s value or voting power is tied to its metadata or other unique properties.

📝 Details
I'd like to suggest extending the current tests to handle a few specific NFT-related scenarios:

Dynamic Vote Weights for NFTs:
Right now, the getWeight function just returns 1n for non-fungible tokens, but in real-world use, the vote weight could vary based on the NFT’s metadata (e.g., rarity). Adding a mock or example test for this kind of weight calculation could be really useful.

Delegation Behavior with NFT Transfers:
What happens when an NFT is delegated for votes and then transferred to someone else? The current tests don’t cover this edge case. It would be great to add a test that ensures delegation is revoked when the NFT changes ownership.

Batch Voting and Large-Scale NFT Governance:
Governance using large NFT collections might involve batch delegations or complex scenarios. Expanding the test coverage here would help ensure the system handles these cases without performance issues.

A couple of possible API tweaks to support this testing:

Add a callback or configurable function to getWeight so the weight of an NFT can be based on its metadata.
Include scenarios where delegation or vote weight changes dynamically when NFTs are transferred between accounts.
These additions would help make the Votes contract more robust for projects using NFTs in their governance models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant