Skip to content
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

Adding A New Pool Via Governance Voting #42

Closed
anilhelvaci opened this issue Oct 26, 2022 · 3 comments
Closed

Adding A New Pool Via Governance Voting #42

anilhelvaci opened this issue Oct 26, 2022 · 3 comments
Assignees
Milestone

Comments

@anilhelvaci
Copy link
Owner

No description provided.

@anilhelvaci anilhelvaci changed the title Adding New Via Governance Voting Adding A New Pool Via Governance Voting Oct 26, 2022
@anilhelvaci anilhelvaci self-assigned this Oct 26, 2022
@anilhelvaci anilhelvaci added this to the Governance milestone Oct 26, 2022
anilhelvaci added a commit that referenced this issue Nov 7, 2022
…Work is still in progress, should add unit tests to it.
anilhelvaci added a commit that referenced this issue Nov 16, 2022
@anilhelvaci
Copy link
Owner Author

anilhelvaci commented Nov 18, 2022

Think

test-lendingPoolElectorate

  • What test cases should there be?
  • Should I write tests for voting and redeeming? In commitee.js only tests for addQuestion exist.

lendingPoolElectionManager

  • Should I test the voting and redeeming here?

  • I will probably have to use offerTo helper method because methods in the electorateFacet can be invoked via offers. Is this too costly?

    The reason why methods in electorateFacet can only be invoked via Zoe offers is because Electorate needs some assets to be escrowed in order the perform appropriate actions.

quorumTreshold

  • I want to use binaryVoteCounter.js contract for counting votes. However, we're required to do a token weighted voting. The current implementation of binaryVoteCounter contract expects a quorumTreshold to enforce the quorumRule. The problem is, in our case we don't know how many shares(tokens) will be used in voting. So if we wanted to do a MAJORITY voting we would need to know how many tokens are locked for the question to calculate required quorumTreshold for that particular question.

    Solution

    One possible solution would be to pass a promise in voteCounter terms as the quorumTreshold instead of a bigint and a reference to a method that lives under the ElectionManager called resolveTreshold. The body of this method;

    const resolveTreshold = async (questionHandle) => {
         const { questionSeat, tresholdPromiseKit } = getQuestion(questionHandle);
         const amountEscrowed = questionSeat.getAmountAllocated('GOV');
         const valueEscrowed = AmountMath.getValue(govBrand, amountEscrowed);
         tresholdPromiseKit.resolve(valueEscrowed);
    }

    We wrap the makeBinaryVoteCounter inside our own contract and implement a very similar scheduleClose method where it invokes above resolveTreshold before invoking closeVoting and quorumQounter awaits this promise to resolve before starting to count quorum.

anilhelvaci added a commit that referenced this issue Nov 22, 2022
…lectionManager`, implemented base test code for `ElectionManager`, implemented a `dummyGovernedContract.js` to test `ElectionManager`.
anilhelvaci added a commit that referenced this issue Nov 24, 2022
…ed out the required test code for `voteOnQuestion`. Implemented `voteOnQuestion` method body.
anilhelvaci added a commit that referenced this issue Nov 24, 2022
…ue with the assert section of the test.
anilhelvaci added a commit that referenced this issue Nov 28, 2022
anilhelvaci added a commit that referenced this issue Nov 29, 2022
@Chris-Hibbert
Copy link

Chris-Hibbert commented Nov 29, 2022

using a Promise to convey the quorumThreshold violates the legibility requirements. Anyone who can see the questionDetails would be able to see the Promise, but they wouldn't be able to tell what it will resolve to. I thought #41 had a proposal to update the quorumThreshold dynamically in a way that would lead to legibility.

The rest of your sketch seems like the right direction.

anilhelvaci added a commit that referenced this issue Nov 30, 2022
@anilhelvaci
Copy link
Owner Author

I thought #41 had a proposal to update the quorumThreshold dynamically in a way that would lead to legibility.

I think you're talking about updateTotalSupply.

using a Promise to convey the quorumThreshold violates the legibility requirements. Anyone who can see the questionDetails would be able to see the Promise, but they wouldn't be able to tell what it will resolve to.

I see where you're coming from, this makes sense. Using a promiseKit to update the quorumThreshold was just a brain storm I did back when I first encountered this problem. The current design uses updateTotalSupply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants