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

Implement Staked Native Token Voting module #310

Closed
JakeHartnell opened this issue May 28, 2022 · 7 comments
Closed

Implement Staked Native Token Voting module #310

JakeHartnell opened this issue May 28, 2022 · 7 comments
Assignees

Comments

@JakeHartnell
Copy link
Member

Related to #65.

This is the simple version. Basically, we just implement the VotingPowerAtHeight query by querying a user's staked balance. AND THAT'S IT!

Now querying a user's staked balance might be a bit tricky, but the AllDelagations query should return a list of the user's delegations and you can sum them up.

@cypherape cypherape self-assigned this May 28, 2022
@Callum-A
Copy link
Collaborator

Is this implementation secure though? There's no way to query staked native token by height no?

@JakeHartnell
Copy link
Member Author

Is this implementation secure though? There's no way to query staked native token by height no?

Should be fine actually! Remember the tokens are bonded and can't be transferred.

@Callum-A
Copy link
Collaborator

Yeah, you're totally right! Wondering how we should implement the TotalVotingPowerAHeight. We should also put a cap on proposal length then maybe? i.e. what if i create a proposal length of 29 days! (Unlikely but maybe worth considering? Thoughts)

@JakeHartnell
Copy link
Member Author

Yeah, you're totally right! Wondering how we should implement the TotalVotingPowerAHeight. We should also put a cap on proposal length then maybe? i.e. what if i create a proposal length of 29 days! (Unlikely but maybe worth considering? Thoughts)

This would be the one edge case to worry about... if voting period is longer than unbonding period. Could enforce this via the UI?

@0xekez
Copy link
Contributor

0xekez commented Jul 1, 2022

@Callum-A
Copy link
Collaborator

Callum-A commented Jul 4, 2022

ION DAO has done this here: https://github.com/many-things/ion-dao-contracts/blob/dev/contracts/stake/src/contract.rs

My main concern here say if someone wanted to use JUNO for a DAO is that we would need to support a mechanism so said user's do not lose their rewards and keep track of staked balances

@JakeHartnell
Copy link
Member Author

Believe this is done right?

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

4 participants