tillIn()
is used to deposit funds into the protocol to create offers. However, if a user sends an excess amount of ETH, the surplus is not refunded, causing the excess funds to become permanently stuck in the contract.
tilIn()
is implemented as follows.
The code first checks if msg.value < _amount
to ensure the user has sent enough ETH. Next, the ETH is wrapped into WETH and transferred to the CapitalPool contract.
The issue arises when msg.value > _amount
, as the excess ETH is not wrapped into WETH because only _amount
is sended, resulting in the surplus being stuck in the contract. Since there's no function to withdraw this excess ETH, it remains permanently locked in the contract.
The excess ETH will remain permanently locked in the contract, leading to a loss of funds.
Manual review.
To resolve the issue, ensure that any excess ETH is refunded to the user.
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.