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

c4-009 Variable Pool liquidity check can be bypassed with a sandwitch… #128

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/libraries/CapsLibrary.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ library CapsLibrary {
/// @dev Reverts if the Variable Pool does not have enough liquidity
/// This safety mechanism prevents takers from matching orders that could not be withdrawn from the Variable Pool.
/// Nevertheless, the Variable Pool may still fail to withdraw the cash due to other factors (such as a pause, etc),
/// which is understood as an acceptable risk.
/// which is understood as an acceptable risk, since it can be mitigated by a multicall.
/// This check can be bypassed with a sandwitch attack that supplies just enough to make the pool liquid again,
/// which we understand as an acceptable risk, since it can be mitigated by a multicall.
/// @param state The state struct
/// @param amount The amount of cash to withdraw
function validateVariablePoolHasEnoughLiquidity(State storage state, uint256 amount) public view {
Expand Down
Loading