-
Notifications
You must be signed in to change notification settings - Fork 111
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
TRUST H2 #1013
TRUST H2 #1013
Conversation
jankjr
commented
Nov 10, 2023
•
edited
Loading
edited
- Write tests to test for inflation attacks.
- Implement fix
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.
let's document the current plan and reasoning at the top of the morpho collateral plugin / wrapper
…s to check if it's possible to frontrun claiming rewards
233e799
to
02e87a6
Compare
Trust H2
🚨 Vulnerabilities Summary
For more details view the full report in OpenZeppelin Code |
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.
i think this pr is moving the right direction, but the new linear-reward-stream accounting seems to just be in parallel to the old accounting, and not actually affecting anything.
i think we should add a bunch of tests proving that the linear stream works, and then make them pass by integrating it correctly.
contracts/plugins/assets/morpho-aave/MorphoTokenisedDeposit.sol
Outdated
Show resolved
Hide resolved
contracts/plugins/assets/morpho-aave/MorphoTokenisedDeposit.sol
Outdated
Show resolved
Hide resolved
contracts/plugins/assets/morpho-aave/MorphoTokenisedDeposit.sol
Outdated
Show resolved
Hide resolved
contracts/plugins/assets/morpho-aave/MorphoTokenisedDeposit.sol
Outdated
Show resolved
Hide resolved
…l rewards uneconomical
02e87a6
to
0f1c9a9
Compare
contracts/plugins/assets/morpho-aave/MorphoTokenisedDeposit.sol
Outdated
Show resolved
Hide resolved
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.
So, something I see in this implementation is that the rewards aren't quite streaming but rather calling sync()
updates how much of the rewards are 'unlocked'. I don't hate it, but I feel like if sync isn't called for a while we'd be locking rewards for quite some time. Maybe worth calling sync on withdraw/deposit just to make sure it's a bit more frequent. (Edit: nvm, seems _claimAndSyncRewards()
is called on every transfer anyway, forgot about that)
Additionally, I was originally imagining this would work like Convex or StakeDAO on how they stream rewards over a week. To me, that makes more sense but I also see why it's done this way since it's extending the RewardableERC20 contract.
Looks good to me!