Closed sandybradley closed 1 year ago
I'm not convinced this finding is accurate. Though highlighting again payRewards
call vulnerability in the mempool could use some attention like not letting the same user deposit and withdraw within a block ...
As for the finding details:
payRewards
can only be front-run if the operator uses the public mempool. This highlights the need for an operating standard, using only mev-relay execution to avoid this off the bat.payRewards
in public mempool for 10 eth -> fraction.elastic = 1110 eth, fraction.base =1100 eth
payRewards
can only be front-run if the operator uses the public mempool. This highlights the need for an operating standard, using only mev-relay execution to avoid this off the bat.
We would be incentivized only to include this on slots we have for ourselves anyway, as in a sense we are paying ourselves the execution cost vs other validators getting that fee
`
LACK OF SLIPPAGE PROTECTION MIGHT CAUSE USERS UNEXPECTED LOSSES
SEVERITY: Medium
PATH: MevEth.sol:deposit, mint (L501-519, L543-560)
https://github.com/manifoldfinance/mevETH2/blob/63edde66d91c263b919fe9c21e128a382219880e/src/MevEth.sol#L501-L519 https://github.com/manifoldfinance/mevETH2/blob/63edde66d91c263b919fe9c21e128a382219880e/src/MevEth.sol#L543-L560
REMEDIATION:
introduce slippage control in deposit and mint so users can be certain that they will receive their expected amount of assets or shares, either when assets are moving in or out of the protocol for example, for deposit there should be a minShares parameter against which the resulting amount of share is checked. For mint there should be a maxAssets parameter against which the needed amount of assets is checked
DESCRIPTION
The functions deposit and mint allow a user to enter the protocol by depositing ETH for shares. deposit takes a specified amount of assets and mint takes a specified amount of shares. However neither function has slippage protection. For example, Alice might be expecting to receive 10 shares after calling deposit or mint in MevEth, however if Bob front-runs Alice with an action that changes the share rate, she will get less then what she desired, potentially causing unexpected loss of funds.
Step-by-step: ● Assume fraction.elastic = fraction.base = 100 ether.