In the TokenManager.sol contract, there is a check to ensure that the msg.value provided by the caller is at least equal to the required _amount. If msg.value is less than _amount, the function reverts with an error. However, the function does not handle the scenario where msg.value is greater than _amount, resulting in the excess amount not being returned to the caller. This can lead to users overpaying and losing funds unintentionally.
he tillIn function handles deposits of either native tokens (ETH) or ERC20 tokens. However, there is a potential issue when the function is called with ETH (i.e., msg.value is greater than 0) but the _tokenAddress corresponds to an ERC20 token. In this scenario, the function does not revert, and the user effectively loses the msg.value sent with the transaction because it is not used or refunded.
`2.` is duplicate of https://github.com/code-423n4/2021-11-nested-findings/issues/136
This Issue makes sense because the contract charges multiple fees like Platform,tax etc.due to this user may send more eth to the contract and hence the `amount-msg.value` will be trapped in the contract
Users may lose funds if they send more Ether than required. This can lead to a poor user experience and potential loss of trust in the contract.
Manual Review
Modify the function to return any excess msg.value to the caller
add a check at the beginning of the function to ensure that msg.value is zero when _tokenAddress is not the wrapped native token
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.