-
Notifications
You must be signed in to change notification settings - Fork 145
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
NFT Voting Module #260
NFT Voting Module #260
Conversation
match msg.token_info { | ||
TokenInfo::Existing { address } => { | ||
let address = deps.api.addr_validate(&address)?; | ||
TOKEN.save(deps.storage, &address)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"TOKEN" is supposed to be the address of the NFT contract this voting module is going to use, right? we should name it accordingly
also need to handle the new NFT contract case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! NFT voting is definitely something that would be great to have.
For this contract we do need staking to prevent double votes. For example:
- I have 2 NFTs.
- I vote on a proposal with 2 voting power.
- I send my NFTs to another wallet.
- That wallet votes on a proposal with 2 voting power.
Now we've double voted. I think the way forward here would be to write a modified stake-cw20
contract which lets you stake NFTs. Then, we could modify this contract to query that contract so that it can have voting power at height information and prevent that double voting.
@@ -0,0 +1,14 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we need to regenerate these schema files. :) Should be able to run cargo schema
in the root for that.
So all of this is true and we now have #309! However, this contract would work GREAT with non-transferable NFTs. Have a ticket to implement "soul bound" NFTs which we can use for things like titles. See: #311 tl;dr this contract might still be useful. |
Closing as I've merged the voting power queries into the staking contract after some discussion with @Callum-A . |
Add a simple NFT voting module which determines voting power based on the NFT token balance of specific addresses.