Closed brozorec closed 1 year ago
@brozorec doing this I realized that even if I removed the infinite limit switch, the modal's text is all about it
<Typography mt="1rem">
To avoid having to reapprove for subsequent transactions, you could enable infinite approval.
</Typography>
<Typography mt="1rem">
Otherwise, only the exact amount for this transaction will be allowed to be transfered from your wallet.
</Typography>
@brozorec we also need to decide what to do with
set(
produce((s: BorrowState) => {
if (s.collateral.allowance.value) {
// optimistic: we assume transaction will success and update allowance according to that
s.collateral.allowance.value -= parseFloat(s.collateral.input)
}
})
)
That code has been commented out, but we need to deal with it.
@ferostar
doing this I realized that even if I removed the infinite limit switch, the modal's text is all about it
Let's rewrite it as follows: "Approve the router contract [ADDRESS](with an etherscan link) to use [XXX] from your wallet."
we also need to decide what to do with
I suggest we remove it and when the tx on the src chain gets confirmed, we re-fetch the allowance. Wdyt?
Context
Currently, the allowance modal handles only the collateral asset that works when we deposit. It breaks when we want to pay back.
TODOs
mode
:DEPOSIT_AND_BORROW
orDEPOSIT
-> deal with allowance for the collateral assetPAYBACK_AND_WITHDRAW
orPAYBACK
-> deal with allowance for the debt assetallow()
to differentiate between what allowance to deal with?)