mirror of
https://github.com/Instadapp/dsa-connectors-2.0.git
synced 2024-07-29 21:57:39 +00:00
Merge pull request #14 from Instadapp/fluid-approve-fix
Fix fluid approve
This commit is contained in:
commit
dc8f8b4e03
|
@ -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_)
|
||||||
);
|
);
|
||||||
|
@ -256,5 +263,5 @@ abstract contract FluidConnector is Events, Stores {
|
||||||
}
|
}
|
||||||
|
|
||||||
contract ConnectV2Fluid is FluidConnector {
|
contract ConnectV2Fluid is FluidConnector {
|
||||||
string public constant name = "Fluid-v1.1";
|
string public constant name = "Fluid-v1.2";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user