mirror of
https://github.com/Instadapp/dsa-connectors-2.0.git
synced 2024-07-29 21:57:39 +00:00
feat: fix approve
This commit is contained in:
parent
ab3d5dc02d
commit
e146d1d862
|
@ -6,12 +6,13 @@ pragma solidity ^0.8.2;
|
||||||
* @dev Lending & Borrowing.
|
* @dev Lending & Borrowing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {Stores} from "../../common/stores.sol";
|
import {Basic} from "../../common/basic.sol";
|
||||||
import {TokenInterface} from "../../common/interfaces.sol";
|
import {TokenInterface} from "../../common/interfaces.sol";
|
||||||
|
|
||||||
import {Events} from "./events.sol";
|
import {Events} from "./events.sol";
|
||||||
import {IVault} from "./interface.sol";
|
import {IVault} from "./interface.sol";
|
||||||
|
|
||||||
abstract contract FluidConnector is Events, Stores {
|
abstract contract FluidConnector is Events, Basic {
|
||||||
/**
|
/**
|
||||||
* @dev Returns Eth address
|
* @dev Returns Eth address
|
||||||
*/
|
*/
|
||||||
|
@ -103,7 +104,8 @@ abstract contract FluidConnector is Events, Stores {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenInterface(vaultDetails_.supplyToken).approve(
|
approve(
|
||||||
|
TokenInterface(vaultDetails_.supplyToken),
|
||||||
vaultAddress_,
|
vaultAddress_,
|
||||||
uint256(newCol_)
|
uint256(newCol_)
|
||||||
);
|
);
|
||||||
|
@ -121,11 +123,13 @@ abstract contract FluidConnector is Events, Stores {
|
||||||
: uint256(-newDebt_);
|
: uint256(-newDebt_);
|
||||||
} else {
|
} else {
|
||||||
isPaybackMin_
|
isPaybackMin_
|
||||||
? TokenInterface(vaultDetails_.borrowToken).approve(
|
? approve(
|
||||||
|
TokenInterface(vaultDetails_.borrowToken),
|
||||||
vaultAddress_,
|
vaultAddress_,
|
||||||
repayApproveAmt_
|
repayApproveAmt_
|
||||||
)
|
)
|
||||||
: TokenInterface(vaultDetails_.borrowToken).approve(
|
: approve(
|
||||||
|
TokenInterface(vaultDetails_.borrowToken),
|
||||||
vaultAddress_,
|
vaultAddress_,
|
||||||
uint256(-newDebt_)
|
uint256(-newDebt_)
|
||||||
);
|
);
|
||||||
|
@ -208,7 +212,8 @@ abstract contract FluidConnector is Events, Stores {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenInterface(vaultDetails_.supplyToken).approve(
|
approve(
|
||||||
|
TokenInterface(vaultDetails_.supplyToken),
|
||||||
vaultAddress_,
|
vaultAddress_,
|
||||||
uint256(newCol_)
|
uint256(newCol_)
|
||||||
);
|
);
|
||||||
|
@ -226,11 +231,13 @@ abstract contract FluidConnector is Events, Stores {
|
||||||
: uint256(-newDebt_);
|
: uint256(-newDebt_);
|
||||||
} else {
|
} else {
|
||||||
isPaybackMin_
|
isPaybackMin_
|
||||||
? TokenInterface(vaultDetails_.borrowToken).approve(
|
? approve(
|
||||||
|
TokenInterface(vaultDetails_.borrowToken),
|
||||||
vaultAddress_,
|
vaultAddress_,
|
||||||
repayApproveAmt_
|
repayApproveAmt_
|
||||||
)
|
)
|
||||||
: TokenInterface(vaultDetails_.borrowToken).approve(
|
: approve(
|
||||||
|
TokenInterface(vaultDetails_.borrowToken),
|
||||||
vaultAddress_,
|
vaultAddress_,
|
||||||
uint256(-newDebt_)
|
uint256(-newDebt_)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user