-
Notifications
You must be signed in to change notification settings - Fork 1
docs: Token Voting Module documentation #91
Conversation
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: hello-shreyas <[email protected]>
Co-authored-by: Austin Green <[email protected]>
Co-authored-by: Austin Green <[email protected]>
Coverage after merging theo/docs into main will be
Coverage Report
|
@@ -0,0 +1,9 @@ | |||
# Llama Token Voting | |||
|
|||
Llama Token Voting is extensions to Llama instances. They allow token holders to create actions and collectively cast approvals or disapprovals. The `LlamaTokenGovernor` contract follows established token voting framework best practices and is designed to integrate directly with instances. |
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 there is a grammatical error at the start of the sentence here "Llama Token Voting is"
|
||
Llama Token Voting is extensions to Llama instances. They allow token holders to create actions and collectively cast approvals or disapprovals. The `LlamaTokenGovernor` contract follows established token voting framework best practices and is designed to integrate directly with instances. | ||
|
||
Llama Token Voting consists of two components: |
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.
Any reason why we're capitalizing Llama Token Voting here?
|
||
`LlamaTokenGovernor` is the contract that enables token holders to create actions and cast votes/vetoes. | ||
|
||
Llama Token Voting works by issuing a Llama policy to the `LlamaTokenGovernor` contract, which can hold roles and permissions that enable the contract to cast approvals/disapprovals and create actions. The Governor contract exposes this policyholder functionality via public functions to token holders. |
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.
I think it would be more grammatically correct to say the token voting module.
I think it makes sense to capitalize Llama since it's a proper noun and contract names like LlamaTokenGovernor
, but I don't see why Governor should be capitalized here
- The casting period | ||
- The submission period | ||
|
||
Llama Token Voting process begins with a delay period. This period is calculated by multiplying the `delayPeriodPct` by the action's approval or disapproval period. The purpose of the delay period is to provide token holders a window to delegate their tokens before voting balances are crystallized for the duration of the vote. |
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.
"Llama Token Voting process" is a grammatical error as well.
|
||
Llama Token Voting process begins with a delay period. This period is calculated by multiplying the `delayPeriodPct` by the action's approval or disapproval period. The purpose of the delay period is to provide token holders a window to delegate their tokens before voting balances are crystallized for the duration of the vote. | ||
|
||
The casting period is when token holders vote/veto a pending action. It is calculated as the product of the `votingPeriodPct` and the action's approval or disapproval period. It automatically begins at the end of the delay period. |
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.
I think it's worth adding a sentence that explains that voting occurs doing the approval period and vetoing occurs during the disapproval period.
|
||
The casting period is when token holders vote/veto a pending action. It is calculated as the product of the `votingPeriodPct` and the action's approval or disapproval period. It automatically begins at the end of the delay period. | ||
|
||
Finally, the submission period is when the result is submitted to the instance's `LlamaCore` contract if consensus is reached. It is calculated by subtract the `delayPeriodPct` and `votingPeriodPct` from `ONE_HUNDRED_IN_BPS`. It automatically begins at the end of the casting period. |
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.
Did you mean subtracting instead of subtract here?
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.
I think it's easier to just say the submission period is equal to 100% minus the delay and voting period. I wouldn't expect a reader to know what ONE_HUNDRED_IN_BPS is without looking at the code.
- Role: This parameter specifies the role of the token holder in the governance process. It is used to determine the permission ID of the `LlamaTokenGovernor`. | ||
- ActionInfo: This struct contains all the necessary information about the action on which the vote is being cast, including the action ID, creator, strategy, target, value, and data. | ||
- Support: Indicates the token holder's stance on the action. The values can be: | ||
- 0 for Against | ||
- 1 for For | ||
- 2 for Abstain | ||
- Reason: A human-readable string providing the rationale behind the token holder's vote. |
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.
We should bold these terms like we do in the llama docs
|
||
The function returns the weight of the cast, representing the influence of the token holder's vote based on their token balance. | ||
|
||
### Casting Vetoes |
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.
I think the key point to communicate here is that castVote and castVeto are the same but votes occur during the approval period and vetoes occur during the disapproval period
|
||
Note that if the Governor itself does not have the permission to create the action on the instance's `LlamaCore`, `createAction` will fail. | ||
|
||
The action creation process is the same as the core Llama system, but instead of creating actions based on the user's policy and permissions the Governor's validation check is based on if they hold enough tokens. |
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.
I would say something like if they hold more tokens than the creation threshold instead of hold enough tokens
|
||
The action creation process is the same as the core Llama system, but instead of creating actions based on the user's policy and permissions the Governor's validation check is based on if they hold enough tokens. | ||
|
||
If unfamiliar with the canonical Llama action creation process, our the main [Llama docs](https://github.com/llamaxyz/llama/tree/main/docs) will help. |
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 a typo/grammar mistake here with "our"
Motivation:
We need docs for token voting, and this is an initial push.
Modifications:
Result:
initial documentation