Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

docs: Token Voting Module documentation #91

Closed
wants to merge 25 commits into from
Closed

docs: Token Voting Module documentation #91

wants to merge 25 commits into from

Conversation

dd0sxx
Copy link
Contributor

@dd0sxx dd0sxx commented Jan 3, 2024

Motivation:

We need docs for token voting, and this is an initial push.

Modifications:

  • added docs dir
  • added token-voting dir in the docs dir
  • added docs for factory, governor, and token adapters.

Result:

initial documentation

dd0sxx and others added 5 commits January 3, 2024 15:32
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]>
docs/README.md Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
dd0sxx and others added 6 commits January 3, 2024 15:39
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]>
Copy link

github-actions bot commented Jan 9, 2024

Coverage after merging theo/docs into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/token-voting
   LlamaTokenGovernor.sol99.68%98.78%100%100%830
   LlamaTokenVotingFactory.sol88.89%66.67%100%100%67–68
src/token-voting/token-adapters
   LlamaTokenAdapterVotesTimestamp.sol100%100%100%100%

@@ -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.
Copy link
Contributor

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:
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor

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.

Comment on lines +42 to +48
- 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.
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

@AustinGreen AustinGreen Jan 9, 2024

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.
Copy link
Contributor

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"

@AustinGreen AustinGreen deleted the theo/docs branch January 11, 2024 18:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants