If msg.value
is more than _amount
in the tillIn
function, the excess Ether sent with the transaction will remain in the contract's balance unless explicitly returned or handled within the function.
the extra ether that send to the contract will be lost due to handling excess msg.value
,
the tillin
function only check if the msg.value
is less than amount
add this test to PreMarkets.t.sol and then run
forge test --mt test_ask_offer_extra_eth -vvvv
user ETH will be lost .
Manuel Review
Handling excess msg.value
effectively is important to ensure user funds are managed transparently and securely. Returning the excess is typically the best approach unless there's a specific use case for handling overpayments differently.
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.