-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add governance docs #9
base: main
Are you sure you want to change the base?
Conversation
@prxgr4mm3r is attempting to deploy a commit to the Brushfam Team on Vercel. To accomplish this, @prxgr4mm3r needs to request access to the Team. Afterwards, an owner of the Team is required to accept their membership request. If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account. |
you need to enable `PSP22Votes` feature, embed modules data structures and implement them via `#[openbrush::implementation]` macro | ||
as described in [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush). | ||
|
||
you need to enable `governance` feature. Also, you need to use implementation macro |
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.
It needs governance and psp22
@@ -4,14 +4,25 @@ title: GovernorVotes | |||
--- | |||
This extension gives Governor contract the ability to communicate with [PSP22Votes](../../PSP22/Extensions/votes.md) token. | |||
The main purpose of this extension is to provide a way to check how much voting power a voter has. | |||
Also, it provides the ability to delegate tokens from one account to another for voting. | |||
You can check the [documentation](https://docs.openzeppelin.com/contracts/4.x/api/governance#GovernorVotes) in OpenZeppelin Contracts for more information about the voting mechanism. |
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'm not actually sure that it's the best idea to point directly to OpenZeppelin, maybe there is some other link?
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.
left some comments
} | ||
``` | ||
|
||
You can check [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush) to understand how it works. |
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.
You can check [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush) to understand how it works. | |
You can check [this section](../../overview.md/#reuse-implementation-of-traits-from-openbrush) to understand how it works. |
First, you should implement basic version of [PSP22](../psp22.md). | ||
|
||
With [default `Cargo.toml`](../../overview.md/#the-default-toml-of-your-project-with-openbrush), | ||
you need to enable `governance` feature. Also, you need to use implementation macro |
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.
you need to enable `governance` feature. Also, you need to use implementation macro | |
you need to enable `governance` feature. Also, you need to use the implementation macro |
It should add a `votes` field in your Storage. It should be named `votes` and have the type `votes::Data`. | ||
It stores information about delegations, [checkpoints]() for each account, which stores the number of votes at a certain time, and the total number of votes, also at a certain time. | ||
Also, Storage should have a `nonces` field. It should be named `nonces` and have the type `nonces::Data`. | ||
It stores the number of nonces for each account. Nonce is a number that is incremented each time a user delegates tokens to another account by signature. |
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.
It should add a `votes` field in your Storage. It should be named `votes` and have the type `votes::Data`. | |
It stores information about delegations, [checkpoints]() for each account, which stores the number of votes at a certain time, and the total number of votes, also at a certain time. | |
Also, Storage should have a `nonces` field. It should be named `nonces` and have the type `nonces::Data`. | |
It stores the number of nonces for each account. Nonce is a number that is incremented each time a user delegates tokens to another account by signature. | |
You need to add a storage field of type `votes::Data`, which will store the information about delegations, the number of votes at a certain time, and the total number of votes, at a certain time. | |
Also, you will need a storage field of type `nonces::Data`, which stores the number of nonces for each account. Nonce is a number that is incremented each time a user delegates tokens to another account. |
... | ||
} | ||
``` | ||
That's it! Now we have a [PSP22Votes](/) contract. You can use it in your [Governor](../../governance/governor.md) contract, as a voting power. |
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 it is used to count votes, or something like that 😄 Rephrase pls
title: Governance | ||
--- | ||
This feature provides a governance mechanism. It allows token holders to vote on proposals and change the token's parameters. | ||
Everybody who has enough votes can create a proposal to call a method of some contract with some arguments. Then token holders can vote for, against the proposal, or abstain. |
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.
If they abstain, they basically do not vote so we don't need to mention it here)
Everybody who has enough votes can create a proposal to call a method of some contract with some arguments. Then token holders can vote for, against the proposal, or abstain. | |
Everybody who has enough votes can create a proposal to call a method of some contract with some arguments. Then token holders can vote for or against the proposal. |
} | ||
``` | ||
|
||
You can check [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush) to understand how it works. |
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.
You can check [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush) to understand how it works. | |
You can check [this section](../../overview.md/#reuse-implementation-of-traits-from-openbrush) to understand how it works. |
} | ||
``` | ||
## Step 3: Add GovernorVotes field in your Storage | ||
GovernorVotes field in your Storage should be named `governor_votes` and have type `governor_votes::Data`. |
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.
same thing with naming
|
||
## Step 2: Add field in your Storage, that uses Checkpoints | ||
For example, you want to save how total supply of your token changes over time. | ||
Then you need to add a field in your Storage, that uses Checkpoints. |
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.
they also need to update the logic in transfer functions otherwise it will not be updated just like that)
|
||
With [default `Cargo.toml`](../../overview.md/#the-default-toml-of-your-project-with-openbrush), | ||
you need to enable `Nonces` feature, embed modules data structures and implement them via `#[openbrush::implementation]` macro | ||
as described in [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush). |
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.
as described in [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush). | |
as described in [this section](../../overview.md/#reuse-implementation-of-traits-from-openbrush). |
as described in [that section](../../overview.md/#reuse-implementation-of-traits-from-openbrush). | ||
|
||
## Step 2: Add Nonces field in your Storage | ||
Nonces field in your Storage should be named `nonces` and have type `nonces::Data`. |
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.
same thing with naming
No description provided.