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
Create another implementation of cw4 (besides cw4-group) called cw4-stake.
This contract will implement all the same cw4 queries, both smart and raw. It will error on UpdateMembers message, but will send the same "on update" events as defined in #140 (Maybe we should remove HandleMsg::UpdateMembers from cw4 and leave that only in cw4-group?).
It works as follows:
Init defines a native denom, as well as a ratio (tokens to votes - eg. if we want to normalize to 1 ATOM = 1 vote, not 1 uatom, we make this ratio 1.000.000). It also defines an unbonding period (cw0::Duration)
I can bond tokens, sending them with the message. This will update the "bonded tokens" in my account and update my votes based on the ratio
I can unbond tokens, specifying how many and removing that many "bonded tokens" from my account, placing them as "unbonding tokens" with an expiration time equal to current block plus "unbonding period".
I can claim any previously unbonding tokens that have now hit their expiration time, by destroying those claims and releasing the relevant native tokens to my address.
Note: Much of this bonding/unbonding logic has been implemented as bond/unbond/claim in cw20-staking. That is a bit different as the ratio per share is dynamic and it does something with the bonded tokens, but you can use a slightly simplified version of that logic.
Bonus: If you pull this whole bonding/unbonding logic and state into one file that could be easily reused by other contracts
Test this group by itself, as well as backing a cw3-flex-multisig (before #141 we just test case where membership is static during open proposals)
The text was updated successfully, but these errors were encountered:
Create another implementation of
cw4
(besidescw4-group
) calledcw4-stake
.This contract will implement all the same
cw4
queries, both smart and raw. It will error onUpdateMembers
message, but will send the same "on update" events as defined in #140 (Maybe we should removeHandleMsg::UpdateMembers
fromcw4
and leave that only incw4-group
?).It works as follows:
bond
tokens, sending them with the message. This will update the "bonded tokens" in my account and update my votes based on the ratiounbond
tokens, specifying how many and removing that many "bonded tokens" from my account, placing them as "unbonding tokens" with an expiration time equal to current block plus "unbonding period".claim
any previously unbonding tokens that have now hit their expiration time, by destroying those claims and releasing the relevant native tokens to my address.Note: Much of this bonding/unbonding logic has been implemented as bond/unbond/claim in
cw20-staking
. That is a bit different as the ratio per share is dynamic and it does something with the bonded tokens, but you can use a slightly simplified version of that logic.Bonus: If you pull this whole bonding/unbonding logic and state into one file that could be easily reused by other contracts
Test this group by itself, as well as backing a
cw3-flex-multisig
(before #141 we just test case where membership is static during open proposals)The text was updated successfully, but these errors were encountered: