The function TokenManager.sol::tillIn
allows msg.value be used, the tillIn converts eth amount to weth and then transferred as seen here
The TokenManager.sol::tillIn
receives msg.value, and does the following things as will be highlighted
verifies msg.value < _amount
wrap eth to weth
transfer weth to capitalPoolAddr
But a scenario not considered is when msg.value is significantly greater than amount, scenarios like this are likely to happen.
In the function Premarkets.sol:createOffer
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L39 , the tillIn function called with msg.value
The disconnect between the amount used in the CreateOfferParams.amount
and msg.value
, could bring up scenarios where msg.value > params.amount
and lead to loss of funds that increases significantly as the difference increses significantly.
Although the lost ETH rescuable, it leads to owner calls to rescueToken and distributed rescued ETH to affected users causing some loss of funds still and hence why the impact is a medium impact but highly likely.
Loss of funds to a certain degree
Manual Review
ensure msg.value == _amount
deposit IWrappedNativeToken(wrappedNativeToken).deposit{value: msg.value}();
and override amount with msg.value
Invalid, these are by default, invalid based on codehawks [general guidelines](https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity#findings-that-may-be-invalid). The check implemented is simply a sufficiency check, it is users responsibility to only send an appropriate amount of native tokens where amount == msg.value when native token is intended to be used as collateral (which will subsequently be deposited as wrapped token). All excess ETH can be rescued using the `Rescuable.sol` contract. > Users sending ETH/native tokens > If contracts allow users to send tokens acc111identally.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.