Sample Use Case
This unique scheme is against the standard flow in web3 apps. Therefore, we need a simple use case to make it easy to understand.
Weighted Voting
In DAOTON there are 3 types of voting, which determines how votes are counted to decide for a proposal.
Democracy voting: Each vote is counted as 1.
Weighted token voting: Each vote is equal to the amount of the DAO token staked.
NFT voting: One NFT one vote.
Let DAOLon be a DAO with a proposal called Proposal-X, whose voting type is weighted token voting. DAOLon has a token called DAOL. It is a lockable Jetton (TEP-X).
Alice is a true supporter of the proposal and wants to vote "Yes". She knows she has to stake as much as possible to increase the weight of her vote. She checks the proposal end time. She has 100 $DAOL in her wallet. She decides to stake 60 $DAOL for this vote and keep 40 $DAOL for possible short terms needs. She needs to stake 60 $DAOL with end-time equal to (or greater than) the porposal end-time. Let us see the lockable token flow:
Alice sends a lock transaction to her jetton-wallet contract with two main parameters:
int lock-amount: The amount of tokens in to be locked.
int end-time: The time after which the tokens can be unlocked.
Her DAOL-wallet contract lock() function decreases her token balance and increses her lock_balance and sets the end_time = end-time if the end-time parameter in her message is greater than the current end_time state variable. (Wallet can only increase end_time and/or lock_ballance if not let either one stay the same.)
Upon receving locking_notification message, Alice sends a vote transaction to the proposal contract with her vote.
The proposal contract calls the get_lock() getter function on Alice's jetton-wallet contract to see her lock amount and end-time.
If the lock end-time >= porposal end_time then the vote() function counts her vote with the lock amount; and sends a notification back.
The lockable jetton standard is designed such that Alice cannot double spend her locks. Well, a person cannot double spend her own wallet but let us go into more detail to see what happens under the hood:
Last updated