ScopeLift / flexible-voting

💪🗳️ Flexible Voting – A Powerful Building Block for DAO Governance
https://flexiblevoting.com
MIT License
86 stars 8 forks source link

Add Compound V3 client contract #46

Closed davidlaprade closed 1 year ago

davidlaprade commented 1 year ago

This PR adds a flex voting client contract that is compatible with Compound V3. This was developed through support from a grant from Compound here

Currently this PR depends upon a fork of Compound V3 (split from main on May 15, 2023). The only change was to make Comet.updateBasePrincipal virtual so that we could add checkpointing in the client. My intention is to upstream this change after we're aligned on the architecture of the present PR and it is approved/merged.

This PR also abstracts the flex voting client logic into a separate abstract contract called FlexVotingClient that can be re-used for client implementations in the future. Doing so allows us to greatly simplify the ATokenFlexVoting implementation of previous PRs, e.g. #11.

Note that this PR leaves a few things unfinished, e.g.: