allo-protocol / allo-v2

Core Allo V2 Contracts
GNU Affero General Public License v3.0
84 stars 65 forks source link

review and ensure strategies are polymorphism #578

Closed thelostone-mc closed 1 month ago

thelostone-mc commented 2 months ago

Current Inheritance Structure

Internal  Allo 2 1

Proposed Changes

Internal  Allo 2 1 (1)

The following changes have been proposed to enhance the use of polymorphism within the strategies:

  1. QVImpactStreamStrategy Inheritance:
    • Curent State: QVImpactStreamStrategy currently inherits from BaseStrategy and doesnt follow the same design as the rest QV strategies, leading into duplicate code and more complexity.
    • Proposal: RefactorQVImpactStreamStrategy to inherit QVBaseStrategy.
  2. Abstract DonationVotingStrategy:

    • Current State: The DonationVoting category lacks a clear abstract base strategy, leading to potential code duplication and inconsistent implementation across various DonationVoting strategies.
    • Proposal:
      • Introduce an abstract DonationVotingBaseStrategy to serve as a template for other DonationVoting contracts, standardizing recipient handling and allocation procedures.
      • Refactor DonationVotingStrategy into DonationVotingSimpleStrategy, which inherits from DonationVotingBaseStrategy.
      • Refactor DonationVotingMerkleDistributionBaseStrategy to also inherit from DonationVotingBaseStrategy.

Strategies Structure

Current State

Currently, the project's strategies are scattered across different folders, including /strategies and /strategies/_poc. This arrangement can lead to difficulties in locating specific strategies and maintaining a cohesive structure.

Proposed Organization

To enhance clarity and organization, we propose grouping strategies into distinct folders based on their functionalities:

Removal of _poc ?

We can remove the _poc folder entirely and make sure we specify into the spec/readme that the strategies are not audited.

thelostone-mc commented 2 months ago

Ack ! This looks good to me Love the organization of code <3

@0xKurt Give this a read when you hop on tom