Geode Finance
Search…
⌃K

Controllers, Proposals and Senate

Build on top of Isolated Storage

We learned that DataStore keeps different entities in isolated storage slots with different IDs.

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

GeodeUtils Library

A library to ensure the Global Trustlessness of Geode with Senate/Governance functionalities.

Senate is the protector of all citizens, protecting them from a greedy/malicious Governance.

Proposals

Proposal basically refers to give the control of an ID to a CONTROLLER with a distinct TYPE.

A Proposal has 4 specs:
  • TYPE: separates the proposals and related functionality between different ID types.
  • NAME: id is created by keccak(name, type)
  • CONTROLLER: the address that refers to the change that is proposed by given proposal ID. * * 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.
A proposal is Geode Governance offering a change within the protocol to the Senate. Isolated Storage is changed when its approved. Proposal is denied when it expires.
After the Controller is chosen, no one else can touch to the given storage ID.
It is important to underline that, the effect of the approval can change when the TYPE of the proposal changes
The most important effect of this implementation is where the 'Limited Upgradability' takes place.

TYPES that are reserved in GeodeUtils Library:

  • 0: inactive
  • 1: Senate Election Proposal to be voted on by Controllers
  • 2: Upgrade Portal's proposed implementation address for the desired contract upgrade
  • 3: used as a GAP for future referance, no functionality.
TYPEs that are reserved in StakeUtils Library:
  • 4: Node Operators
  • 5: Planets
  • 6: Comets
  • 11: Upgrade to the miniGovernance contract's implementation

There can be more TYPE reservations in the future.

TYPE
CONTROLLER
1
new senate address
2
new implementation contract for Portal
4
Controller of a Operator
5
Controller of a Planet
6
Controller of a Comet
11
new implementation contract for miniGovernances

Furthermore, GeodeUtils includes these logics:

  1. 1.
    Governance functionalities, such as proposing a new Planet or a new Node Operator, proposing a contract upgrade, or proposing a new Senate.
  2. 2.
    Cover Limited Upgradability where it is required to have the approval of Senate on the Governances proposals. Most importantly, while upgrading to the Portal's implementation (TYPE 2).
  3. 3.
    Senate functionalities. Such as limiting the Governance Tax, updating the required parameters such as MiniGovernance version-id (TYPE 11), approving to onboard an Operator or a Planet (Type 4 and 5).
  4. 4.
    Senate Elections, where the electors are Planet CONTROLLERs (TYPE 1).