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

fix(reallocate): prevent slippage #298

Merged
merged 2 commits into from
Nov 14, 2023
Merged

Conversation

Rubilmax
Copy link
Contributor

@Rubilmax Rubilmax commented Nov 2, 2023

This PR protects the allocator from bearing slippage by simply not allowing to withdraw/supply shares. The allocator can still withdraw all from a market by passing type(uint256).max

@Rubilmax Rubilmax linked an issue Nov 2, 2023 that may be closed by this pull request
@Rubilmax Rubilmax marked this pull request as ready for review November 2, 2023 16:13
@Rubilmax Rubilmax force-pushed the fix/prevent-slippage branch from c0fd883 to 07e00ba Compare November 2, 2023 16:31
Copy link
Contributor

@MerlinEgalite MerlinEgalite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back to the good old days?

src/MetaMorpho.sol Outdated Show resolved Hide resolved
@MerlinEgalite
Copy link
Contributor

replaced by #307

@Rubilmax Rubilmax reopened this Nov 7, 2023
@Rubilmax
Copy link
Contributor Author

Rubilmax commented Nov 7, 2023

replaced by #307

It is based on it! The 2 PRs don't address the same issue

@MerlinEgalite
Copy link
Contributor

MerlinEgalite commented Nov 7, 2023

ah you're right, can you update it then?

@MerlinEgalite MerlinEgalite merged commit 26e8947 into cantina-review Nov 14, 2023
@MerlinEgalite MerlinEgalite deleted the fix/prevent-slippage branch November 14, 2023 10:29
Comment on lines -34 to -35
/// @notice The amount of shares to allocate.
uint256 shares;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also change the dev comment above the struct @MerlinEgalite

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Add slippage protection to reallocate
4 participants