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

feat(morpho): protect from slippage #314

Merged
merged 24 commits into from
Nov 3, 2023

Conversation

Rubilmax
Copy link
Collaborator

@Rubilmax Rubilmax commented Oct 23, 2023

@Rubilmax Rubilmax changed the base branch from review-cantina to feat/async-slippage-protection October 23, 2023 14:24
@Rubilmax Rubilmax changed the title Feat/morpho slippage protection feat(morpho): protect from slippage Oct 23, 2023
@Rubilmax Rubilmax marked this pull request as ready for review October 24, 2023 08:30
@Rubilmax Rubilmax force-pushed the feat/async-slippage-protection branch from 3ea66a7 to 4e7913e Compare October 24, 2023 13:49
…bs/morpho-stack into feat/morpho-slippage-protection
@MerlinEgalite
Copy link
Contributor

Are all those commits necessary? 👀

@Rubilmax
Copy link
Collaborator Author

Are all those commits necessary? 👀

They are due to the mix between rebase & merge
I don't have issues in not having the cleanest possible git tree, specifically when it costs additional time to do so

@Rubilmax Rubilmax self-assigned this Oct 26, 2023
…bs/morpho-blue-bundlers into feat/morpho-slippage-protection
…bs/morpho-blue-bundlers into feat/morpho-slippage-protection
Base automatically changed from feat/async-slippage-protection to review-cantina October 31, 2023 08:31
Copy link
Contributor

@Jean-Grimal Jean-Grimal left a comment

Choose a reason for hiding this comment

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

We should also add revert test for slippage

src/MorphoBundler.sol Show resolved Hide resolved
@Rubilmax
Copy link
Collaborator Author

This PR should not be merged yet

…undlers into feat/morpho-slippage-protection
Copy link

openzeppelin-code bot commented Nov 1, 2023

feat(morpho): protect from slippage

Generated at commit: 42b13a1c2b3abdfaf5213033497ff2cf1135d9f8

🚨 Vulnerabilities Summary

Process Issues Results
Contract Inspector note
low
critical
Total
20
10
1
31
Dependency Checker Total 0

For more details view the full report in OpenZeppelin Code

…undlers into feat/morpho-slippage-protection
Copy link
Collaborator Author

@Rubilmax Rubilmax left a comment

Choose a reason for hiding this comment

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

LGTM

@MerlinEgalite MerlinEgalite merged commit 9bf54dc into review-cantina Nov 3, 2023
8 checks passed
@MerlinEgalite MerlinEgalite deleted the feat/morpho-slippage-protection branch November 3, 2023 06:30
@MerlinEgalite MerlinEgalite linked an issue Nov 3, 2023 that may be closed by this pull request
/// @param shares The amount of shares to burn.
/// @param slippageAmount The minimum amount of shares to mint in exchange for `assets` when it is used.
Copy link

Choose a reason for hiding this comment

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

error: shares are burned in withdraw and not minted

/// @notice Warning: should only be called via the bundler's `multicall` function.
/// @dev Either `assets` or `shares` should be zero. Most usecases should rely on `assets` as an input so the
/// initiator is guaranteed to withdraw `assets` tokens, but the possibility to mint a specific amount of shares is
Copy link

Choose a reason for hiding this comment

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

error: shares are burned in withdraw and not minted

@MerlinEgalite MerlinEgalite mentioned this pull request Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

M-03 Bundler Slippage May Cause Unexpected Loss of Funds
6 participants