# Dual Governance

## Building on top of the Isolated Storage

#### We learned that DataStore keeps different entities in isolated storage slots with different IDs.&#x20;

However, this functionality is nothing to be excited about without a mechanism to enforce this logic on protocol and contract upgrades.

#### Geode manages crucial parts of it's operation with 2 step verification:

1. Governance Proposals
2. Senate Approvals

This setup creates another safeguard for the users of The Staking Library.

## Proposals

A proposal is Geode Governance offering a change within the protocol to the Senate.&#x20;

Every proposals isolates an ID for DataStore.

After the Controller is chosen, no one else can touch to the given storage ID.

<figure><img src="https://2485428749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw9Axw7FT11SMG7vNQwDN%2Fuploads%2Fz0CInKBhF2z66xIYZZ1O%2Fproposal.png?alt=media&#x26;token=9658da56-bffc-44bc-ad16-666c0b999491" alt=""><figcaption></figcaption></figure>

{% code title="GeodeUtilsLib.sol" %}

```solidity
  struct Proposal {
    address CONTROLLER;
    uint256 TYPE;
    bytes NAME;
    uint256 deadline;
  }
```

{% endcode %}

A Proposal has 4 parameters:

* **TYPE**: separates the proposals and related functionality between different ID types.
* **NAME**:important for ID generation through `DataStore.generateId()`
* **CONTROLLER**: the address that refers to the change that is proposed by given proposal ID.&#x20;
  * &#x20;This slot can refer to the controller of an id, a new implementation contract, a new Senate etc.
* **deadline**: refers to last timestamp until a proposal expires.

{% hint style="info" %}
All TYPEs are reserved as `ID_TYPE` within  [`globals.sol`](https://docs.geode.fi/developers/live-contracts/ethereum-v2/portal.sol/globals.sol)`.`
{% endhint %}

#### **There can be more TYPE reservations in the future.**

<table><thead><tr><th width="120">ID_TYPE</th><th>CONTROLLER</th></tr></thead><tbody><tr><td>0</td><td><mark style="background-color:red;">NONE -unused</mark></td></tr><tr><td>1</td><td><mark style="color:green;">new senate address</mark></td></tr><tr><td>2</td><td><mark style="color:blue;">new implementation contract for Portal</mark></td></tr><tr><td>3</td><td><mark style="background-color:red;">GAP - unused</mark></td></tr><tr><td>4</td><td><mark style="color:green;">Controller of a Operator</mark></td></tr><tr><td>5</td><td><mark style="color:purple;">Controller of a Pool</mark></td></tr><tr><td>21</td><td><mark style="color:blue;">Module: Withdrawal Contracts</mark></td></tr><tr><td>31</td><td><mark style="color:blue;">Module: gETH interfaces</mark></td></tr><tr><td>41</td><td><mark style="color:blue;">Module: Liquidity Pool</mark></td></tr><tr><td>42</td><td><mark style="color:blue;">Module: Liquidity Pool Token</mark></td></tr></tbody></table>

### Governance

Currently, Governance is an internal ERC-20 token that is only owned by Geode Finance Developers and Treasury.

This internal ownership is a needed step to eliminate the risk of some attacks like Governance tak-over.

In the future, the Governance of Geode is supposed to be decentralized with the distribution of these tokens.

### Senate

Currently, Senate is a Multisig of Geode developers.&#x20;

But GeodeUtils Library includes a logic for changing the Senate, as well as an Election for it.

TYPE 1 proposals stand for Senate Elections.

However, the future of Senate will not be decided by elections, but with an other approach:

#### A Decentralized Senate with a weighted vote distribution:

{% content-ref url="../future-of-geode/further-decentralization/quadratic-weighted-senate-draft" %}
[quadratic-weighted-senate-draft](https://docs.geode.fi/key-concepts/future-of-geode/further-decentralization/quadratic-weighted-senate-draft)
{% endcontent-ref %}

### Limited Upgradability

*TYPE 2* proposals ensure Limited Upgradability on both Portal and Withdrawal Contracts.

{% content-ref url="limited-upgradability" %}
[limited-upgradability](https://docs.geode.fi/key-concepts/portal/limited-upgradability)
{% endcontent-ref %}

### Onboarding Operators

*TYPE 4* proposals stands for onboarding a new Node Operator to the Marketplace:

page link

### New Withdrawal Contract, gETH interface or Liquidity Pools

Other *TYPEs* like *21, 31* etc. stands for other important parameters of Portal like default Liquidity Pool or withdrawal Contract implementation.
