-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Compound V3 client contract #46
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* we are way over the size limit for Comet now -- need to look into why * scopelint doesn't give us the option to selectively ignore naming conventions on specific lines; because we are overriding certain Comet functions we don't have the option to change their names
davidlaprade
commented
May 16, 2023
davidlaprade
commented
May 16, 2023
davidlaprade
commented
May 16, 2023
mds1
reviewed
May 16, 2023
mds1
reviewed
May 17, 2023
Co-authored-by: Matt Solomon <[email protected]>
mds1
reviewed
May 17, 2023
davidlaprade
force-pushed
the
comet-client-contract
branch
from
May 18, 2023 20:14
3831e56
to
56bf3cf
Compare
mds1
approved these changes
May 22, 2023
apbendi
approved these changes
May 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @davidlaprade! A few small things, but overall this is excellent work and I'm excited to have a clean client abstraction, in addition to the Comet implementation.
Ported over to #49
mds1
reviewed
May 26, 2023
Co-authored-by: Matt Solomon <[email protected]>
kevincheng96
pushed a commit
to compound-finance/comet
that referenced
this pull request
Jun 8, 2023
My team received a grant from CGP 2.0 to add Flexible Voting support to Compound V3. In order to implement our extension we need to be able to determine, for any given block: how much principal a given account has supplied up to that time, and how much total principal has been supplied to Comet up to that time Our belief is that the easiest way to do this involves overriding the Comet.updateBasePrincipal function to store a couple checkpoints. You can see the PR for this work in ScopeLift/flexible-voting#46, and the specific overrides we need to make here. Since updateBasePrincipal is the single way that principal balances are updated by the system, being able to add checkpointing to it greatly simplifies our task. Thanks in advance!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theATokenFlexVoting
implementation of previous PRs, e.g. #11.Note that this PR leaves a few things unfinished, e.g.:
FlexVotingClient
and forCometFlexVoting
)