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

[PDE-668] ottersec final fixes #156

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

[PDE-668] ottersec final fixes #156

wants to merge 6 commits into from

Conversation

ungaro
Copy link
Member

@ungaro ungaro commented Jan 17, 2025

What's new in this PR?

  • It seems that YieldToken::mint hasn't been updated yet to follow the new conversion logic.

  • It seems that YieldToken::redeem hasn't done yieldBuffer check like withdraw yet.

  • Just to be safer, would it make sense to properly implement the rounding direction that you added in ComponentToken comments to the inherited contracts like AggregateToken? It would be better to do this in YieldToken as well just to be safe.

  • For the synchronous redeem in ComponentToken, it seems that the convertToAssets should be called before calling _burn because otherwise it will incorrectly inflate the shares value if the overridden convertToAssets depends on totalSupply.

  • the same issue applies to the synchronous ComponentToken::deposit as well, where transferring the asset should happen after the calculation. In general, we suggest that for actions that might change the value of totalSupply or totalAssets in ERC4626, all calculations should be done before making those changes. Thanks all!

  • For the asynchronous redeem logic in YieldToken, how will you handle the _notifyRedeem conversion rate to be precise?

  • For example, we observed that when users call requestRedeem, the shares will be burned first, which means that the conversion rate in the on-chain side will be inflated until the request is executed (either via withdraw or redeem).

  • Similarly, this applies to future contracts that want to inherit ComponentToken with async features enabled and has dependencies on totalSupply during the conversion logic.

@ungaro ungaro marked this pull request as ready for review January 20, 2025 15:06
@ungaro ungaro requested a review from eyqs January 20, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant