Skip to content

Conversation

@chenquanyu
Copy link
Collaborator

@chenquanyu chenquanyu commented Sep 1, 2023

This PR is a code implementation of #2, #3, #5. Close #2, Close #3, Close #5.

This PR is going to add the Governance contract to manage consensus list, Policy contract to manage policy parameters. We will have the first Phase of consensus in genesis block and the users can vote for new Phases with GAS in Governance contract. The GovReward contract will keep the reward GAS for governance voters. For governance requirements, please refer to https://docs.google.com/document/d/11iDJGpCDNrKmPQN8TOhmEqBlWZAOstH15j3Afc2xoQo/edit#heading=h.idvp9uir3xt8.

The GovernanceVote contract is an abstract contract for Policy and other contracts (like GovProxyAdmin) who need a 1/2 consensus vote to execute some function.

We will use upgradable contracts for Governance, Policy and GovReward, ERC1967Proxy is used as proxy and GovProxyAdmin is used as the admin of upgrade.

For the implemention of #5, we will need following contracts in genesis alloc:

  1. GovProxyAdmin 0x1212000000000000000000000000000000000000
  2. Governance Proxy 0x1212000000000000000000000000000000000001
  3. Governance Implemention 0x1212100000000000000000000000000000000001
  4. Policy Proxy 0x1212000000000000000000000000000000000002
  5. Policy implemention 0x1212100000000000000000000000000000000002
  6. Governance Reward 0x1212000000000000000000000000000000000003
  7. Governance Reward implemention 0x1212100000000000000000000000000000000003

@txhsl txhsl self-requested a review September 15, 2023 10:27
@txhsl txhsl linked an issue Sep 19, 2023 that may be closed by this pull request
@txhsl txhsl changed the title add governance contracts add governance and policy contracts Sep 20, 2023
Copy link

@cloud8little cloud8little left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolegys
Copy link
Collaborator

nicolegys commented Dec 1, 2023

From the user's point of view, there is no function for users to get their voted draftIds. If someone has voted for several proposals in the past phases, he must walk through the previous transactions to find the draftIds and then get his ethers back (Unless he wrote them down somewhere by himself).

@nicolegys
Copy link
Collaborator

merge?

@chenquanyu
Copy link
Collaborator Author

From the user's point of view, there is no function for users to get their voted draftIds. If someone has voted for several proposals in the past phases, he must walk through the previous transactions to find the draftIds and then get his ethers back (Unless he wrote them down somewhere by himself).

May be will need a UI for users to vote, and will list all the voted draft from event log.

@AnnaShaleva AnnaShaleva self-requested a review January 19, 2024 11:19
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the PR was updated, so I'm leaving existing comments here for now and continue review once my review is re-requested.

@chenquanyu, please, tag me once you finish adjustments.

@chenquanyu
Copy link
Collaborator Author

Is this fact connected with the way how we deploy system contracts? I.e. some storage items are missing in genesis allocations?

Immutable variables are evaluated once at construction time and their value is copied to all the places in the code where they are accessed. So it has nothing to do with storage, we are solving this problem by overriding these methods which use "immutable __self" variable.

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

@AnnaShaleva AnnaShaleva requested a review from txhsl April 10, 2024 07:24
@AnnaShaleva
Copy link
Member

@roman-khimov, @txhsl, @nicolegys, @ZhangTao1596 ready for the final review&merge.

@chenquanyu
Copy link
Collaborator Author

chenquanyu commented Apr 11, 2024

We have not yet added the function of burning fees. We can send part of fees to an empty address in the governance contract to burn and configure this burning ratio in the policy contract. Issue opened in #163.

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@mialbu mialbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor documentation and consistency-related comments.

@AnnaShaleva AnnaShaleva changed the title add governance and policy contracts Add governance and policy contracts Apr 16, 2024
@AnnaShaleva AnnaShaleva merged commit c896e52 into bane-main Apr 16, 2024
@AnnaShaleva AnnaShaleva deleted the governance branch April 16, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploy Governance contract and Policy contract in genesis block Policy contract Governance contract

9 participants