In TokenManager.sol
the tillIn()
function is used to transfer either ether or whitelisted ERC20s to CapitalPool.sol
.
If ether is sent in the msg.value, but an ERC20 token address is passed as a parameter, the ether that was sent will be locked in TokenManager.sol
and unable to be retrieved.
This finding is different than the Medium in the automated report because the tokens are being locked in TokenManager.sol
, not PreMarkets.sol
.
Here's a POC calling createOffer()
in Premarkets.sol
which calls tillIn()
, but there are other function calls where this is also possible.
Add to Premarkets.t.sol
:
User funds are locked in TokenManager.sol
Manual Review / Foundry
Add a check in any payable function that calls tillIn()
that if there is a non-zero msg.value, the tokenAddress should be 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.