-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: comet library #176
feat: comet library #176
Conversation
Slither reportTHIS CHECKLIST IS NOT COMPLETE. Use |
@@ -268,6 +268,7 @@ abstract contract CompoundV3Connector is BaseConnector, Initializable { | |||
uint256 rewardBalance = 0; | |||
address rewardToken = cometRewards_.rewardConfig(address(cToken_)).token; | |||
if (rewardToken != address(0)) { | |||
// TODO: check if there is something to claim |
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.
We should check if there is something to claim before claiming it
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.
This will be awesome!
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.
Great work!!
This PR does two things. First, it introduces
LibComet
. This library reproduces some of the logic inside Comet's code to be able to calculate the amount of rewards owed to a certain account. But we do so in aview
manner, without modifying the stateThen, this PR also introduces
CometRewardsTracker
. A new contract that exposes the code inLibComet
, so that we can use it from our connector (this will done in another PR)Testing
In order to make sure that this works as expected, we've done the following:
CometRewardsTracker
that would compare our code's results with Comet's