After debugging, I found out that the depositUnderlyingAndBorrowHTokenAndAddLiquidity function is trying to transfer underlying twice, once totalUnderlyingAmount and later call to depositUnderlyingInternal transfer extra depositAmount which results in dust in DSProxy. Since in non-signature functions we approve transfer of large amount of tokens in advance this issue didn’t come to surface, but in the withSignature functions we permit transfer of totalUnderlyingAmount only, the later call to transfer depositAmount in depositUnderlyingInternal resulted in failure of transaction.
Hey @paulrberg, in recent testing @defi-david discovered that all calls to depositUnderlyingAndBorrowHTokenAndAddLiquidityWithSignature failed, but calls to depositUnderlyingAndBorrowHTokenAndAddLiquidity worked.
After debugging, I found out that the
depositUnderlyingAndBorrowHTokenAndAddLiquidity
function is trying to transfer underlying twice, oncetotalUnderlyingAmount
and later call todepositUnderlyingInternal
transfer extradepositAmount
which results in dust in DSProxy. Since in non-signature functions we approve transfer of large amount of tokens in advance this issue didn’t come to surface, but in thewithSignature
functions we permit transfer oftotalUnderlyingAmount
only, the later call to transferdepositAmount
indepositUnderlyingInternal
resulted in failure of transaction.