Loss of excess ether inside the tillIn() function of the TokenManager contract
The tillIn() function of the TokenManager contract is used to get a user's msg.value and after wrapping it, transfers the token to the pool in the case of wrappedNativeToken is the _tokenAddress. Users could send more ether than the actual purchase price in order to ensure that they can 'till in'. However, the tillIn() function did not return the excess ether, which would cause asset loss to the user. Consider the following scenario:
User A believes that the value of tilling in is 0.3 eth, considering that it may be revert due to price changes, so user A passes 0.305 eth to till in with 0.3 ether
User A's transaction is executed, the 0.3 ether is wrapped and transferred, but since the contract does not return excess eth, user A actually loses 0.005 eth.
Fund loss due to not returning the excess ETH inside the function tillIn()
Manual
Consider returning the excess ETH when it is more than the amount variable:
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.