Skip to content
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

Instant revenue for the fee recipient #35

Closed
MerlinEgalite opened this issue Sep 11, 2023 · 2 comments · Fixed by #33 or #38
Closed

Instant revenue for the fee recipient #35

MerlinEgalite opened this issue Sep 11, 2023 · 2 comments · Fixed by #33 or #38
Assignees
Labels
🐛 bug Something isn't working

Comments

@MerlinEgalite
Copy link
Contributor

It seems that by being able to update the lastTotalAssets several times within a block the feeRecipient can generate instant revenu not based on interest accrual.

https://github.com/morpho-labs/morpho-blue-metamorpho/blob/ebe58aa6c8b9e9198c63c50bdc5de7d64609e81b/test/forge/FeeTest.sol#L45-L63

@MerlinEgalite MerlinEgalite added the 🐛 bug Something isn't working label Sep 11, 2023
@MerlinEgalite MerlinEgalite self-assigned this Sep 11, 2023
@MerlinEgalite MerlinEgalite reopened this Sep 11, 2023
@MerlinEgalite
Copy link
Contributor Author

Missclicked lol

@MerlinEgalite MerlinEgalite linked a pull request Sep 11, 2023 that will close this issue
@Rubilmax
Copy link
Contributor

So it's because lastTotalAssets is missing the deposit of users after the deposit. Instead, lastTotalAssets should be synced at the end of any interaction, and read to accrue fee at the beginning of any interaction

@Rubilmax Rubilmax self-assigned this Sep 12, 2023
@Rubilmax Rubilmax linked a pull request Sep 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants