dao-contracts icon indicating copy to clipboard operation
dao-contracts copied to clipboard

Implement Staked Native Token Voting module

Open JakeHartnell opened this issue 2 years ago • 6 comments

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.

JakeHartnell avatar May 28 '22 18:05 JakeHartnell

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

Callum-A avatar May 28 '22 19:05 Callum-A

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.

JakeHartnell avatar May 28 '22 19:05 JakeHartnell

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)

Callum-A avatar May 28 '22 19:05 Callum-A

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?

JakeHartnell avatar May 28 '22 19:05 JakeHartnell

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

0xekez avatar Jul 01 '22 22:07 0xekez

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

Callum-A avatar Jul 04 '22 17:07 Callum-A

Believe this is done right?

JakeHartnell avatar Oct 29 '22 20:10 JakeHartnell