-
Notifications
You must be signed in to change notification settings - Fork 1
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
Governance Analysis #41
Comments
Development Notes
|
Initial DesignBelow is the initial design I've come to after going over Agoric's existing governance package and Compound Finance's governance method.
The general rules around the initial governance design is;
The way I'm planning to implement above behaviors in agoric-sdk governance package is; Users should lock their GOV tokens inside a ZCFSeat so that we're sure they actually have those tokens. ElectorateThe existing implementation of the an Electorate is the committee.js contract which stores all posed questions in a map that has structure like this; const allQuestions = MapStore<QuestionHandle, VoteCounterFacets> Since users will lock their GOV tokens into our contract we're gonna have to use a /**
@type {{
voteCounterFacet: VoteCounterFacet,
tokenSeat: ZCFSeat
}} QuestionFacet
*/
const allQuestions = MapStore<QuestionHandle, QuestionFacet> To achieve desired behavior a collection of methods like below should be implemented; const verifyCanPoseQuestion = () => {
// Checks if the user has enough GOV tokens to pose a question. This method will be added to the existing `addQuestion` implementation in the committee contract.
};
const vote = (questionHandle) => {
// Enables users to vote on a particular question at a the weight they posses GOV tokens.
};
const redeem = (questionHandle) => {
// Lets users redeem the GOV tokens they locked for a particular question.
};
const electorateFacet = {
addQuestion,
vote,
redeem,
};
const creatorFacet = {
.
.
.
getElectorateFacetInvitation: () => getElectorateFacetInvitation(zcf, electorateFacet), // See ElectorateTools
}; ElectorateToolsThis module is gonna be like the existing ElectorateTools but we'll store this in our package and will implement required utility methods for our Electorate here. One obvious method is; /**
* @param {ZCF} zcf
* @param {ElectorateFacet} electorateFacet
*/
const getElectorateFacetInvitation = (zcf, electorateFacet) => {
const electorateFacetHandler = () => Far(`questionPoser`, electorateFacet);
return zcf.makeInvitation(electorateFacetHandler, `electorateFacet`);
}; ElectionManagerWork_In_Progress Below is a very high level overview of the design that aims to show which methods will be added to which component. |
…Work is still in progress, should add unit tests to it.
See README.md
Zoe now has filters that allow a contract or its governance to limit which offers can be exercised. The purpose of this is to allow governance to disable access to the contract in emergencies. My apologies that this hasn't been added to the documentation yet.
Our bootstrap environment holds those. I suspect this is insufficiently documented. You might ask about it in office hours.
Their voterFacet can be used to cast ballots on questions they know about. The harder question is how they come to know about votes in progress. The committee's publicFacet has a
The creatorFacet in committee.js has a method
I recommend following the attestation model. This allows holders of some tokens to get attestations that they can use to vote and doesn't require locking up the tokens. |
Thanks @Chris-Hibbert !!! |
Question Dump On attestation2022-11-11
2022-11-14
Related Code I'd be glad if you could answer above questions 🙏 @Chris-Hibbert @dckc |
The If so, then it would make sense to expand
No; that would allow dApp developers to interfere with chain-wide services.
Probably LendingPool. @Chris-Hibbert , does that make sense to you? Another possibility is a separate contract. BLD Boost was originally a separate contract from the attestation maker, but we folded them together to simplify some things. I can probably dig up the separate contract and you might want to use that. |
certainly not the electorate or electionManager. Whatever can validate ownership of the underlying token, which makes some sense for the lendingPool.
Yes, that would be helpful. I recall the original version (or at least an earlier version) having tests that started with assets created in the JS layer. Anil Helvaci => Found it: Agoric/agoric-sdk#3475 |
I don't know what it means for an ERTP brand to represent a cosmos denom @dckc. What I had in mind is a simple ERTP fungible token created with
Requires some changes to the
This seems like a quicker approach. I would be so glad if you could provide me the separate contract and the tests you mention here. I want to sum up what I understand just to make sure we're on the same page;
Am I correct? @Chris-Hibbert @dckc ? I'm still not sure how this separate contract will make sure users actually have the GOV tokens without making them lock their GOV tokens? |
Oops. I'm afraid the whole discussion of attestations has been a red herring. You did say that you plan for users to put their tokens in escrow with Zoe in order to prove ownership. Attestations are a way to avoid that, since BLD boost is designed to let people participate without transferring their BLD tokens to Zoe. |
I need to make sure users have the governance token of my protocol before I let them do any governance action. One possible solution I had in mind was to escrow the tokens in Zoe. But this is not mandatory I just need to make sure they have the tokens. You and Chris suggested attestations saying that it is more flexible and users might need their tokens for something else. This makes sense to me. But from what I can understand; attestations, as they are right now, only work for BLD brand and no other ERTP brand. If there's a solution for this, I want to use attestations for governance tokens distributed from lending protocol. |
The attestations used in BLD boost attest that some cosmos-level tokens have a lien against them. In order to get further in this discussion, I suppose we need to clear this up...
I'm not sure how to do that briefly. Perhaps in office hours tomorrow? |
That'd be great, looking forward to it! |
Rethink
|
@Chris-Hibbert says it has to be a contract ref: coreArchitecture.png |
In this session of the office hours it has been clarified that there's no easy way for an ordinary ERTP token can be attested. So moving forward with the escrowing strategy. |
…lectionManager`, implemented base test code for `ElectionManager`, implemented a `dummyGovernedContract.js` to test `ElectionManager`.
…ed out the required test code for `voteOnQuestion`. Implemented `voteOnQuestion` method body.
…ue with the assert section of the test.
…d scenario (scenario-1) is tested.
Governance Implementation Initial ReviewInstructions
ContextAs a result of the conversation above and my own work, I've made the below design
|
Requirements
The parameters to be controlled by governance are listed in the bounty specification. Seems like they all can be controlled by one
ParamManager
controlled by acontractHelper
.Current Structure
There's a
ParamManager
for every pool in the protocol. TheseParamManager
s are stored in theLendingPool
contract. Ideally I want to use the contractHelper.js but not sure how I can make that happen in a scenario where we are required to update the parameters that are directly related to pools.Steps
The text was updated successfully, but these errors were encountered: