For pools with WETH, the _transferFrom will try to use the native ether for the payment if msg.value is >= the amount required.
If msg.value is not zero, but also not enough to make the payment, the else branch will be entered which will pull the full amount of WETH tokens from the sender.
If msg.value is greater than the amount (leaving excess), or the else branch was entered, the remaining ether balance of the contract is sent to the sender. Note this is only if the token is WETH,
… token
Discussion: https://github.com/primitivefinance/DFMM/pull/89#discussion_r1550020949
For pools with
WETH
, the_transferFrom
will try to use the native ether for the payment ifmsg.value
is >= the amount required.If
msg.value
is not zero, but also not enough to make the payment, theelse
branch will be entered which will pull the full amount of WETH tokens from the sender.If
msg.value
is greater than the amount (leaving excess), or theelse
branch was entered, the remaining ether balance of the contract is sent to the sender. Note this is only if the token isWETH
,