mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
removed eth specific conditions
This commit is contained in:
parent
aa1dc3776a
commit
00e562abc7
|
@ -7,16 +7,13 @@ pragma experimental ABIEncoderV2;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
|
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
|
||||||
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
|
|
||||||
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
||||||
import { TokenInterface } from "../../common/interfaces.sol";
|
|
||||||
import { AccountInterface } from "./interfaces.sol";
|
import { AccountInterface } from "./interfaces.sol";
|
||||||
import { DSMath } from "../../common/math.sol";
|
|
||||||
import { Stores } from "../../common/stores.sol";
|
import { Stores } from "../../common/stores.sol";
|
||||||
import { Variables } from "./variables.sol";
|
import { Variables } from "./variables.sol";
|
||||||
import { Events } from "./events.sol";
|
import { Events } from "./events.sol";
|
||||||
|
|
||||||
contract LiquidityResolver is DSMath, Stores, Variables, Events {
|
contract LiquidityResolver is Stores, Variables, Events {
|
||||||
using SafeERC20 for IERC20;
|
using SafeERC20 for IERC20;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,11 +67,7 @@ contract LiquidityResolver is DSMath, Stores, Variables, Events {
|
||||||
|
|
||||||
IERC20 tokenContract = IERC20(token);
|
IERC20 tokenContract = IERC20(token);
|
||||||
|
|
||||||
if (token == ethAddr) {
|
tokenContract.safeTransfer(address(instaPool), _amt);
|
||||||
Address.sendValue(payable(address(instaPool)), _amt);
|
|
||||||
} else {
|
|
||||||
tokenContract.safeTransfer(address(instaPool), _amt);
|
|
||||||
}
|
|
||||||
|
|
||||||
setUint(setId, _amt);
|
setUint(setId, _amt);
|
||||||
|
|
||||||
|
@ -127,11 +120,7 @@ contract LiquidityResolver is DSMath, Stores, Variables, Events {
|
||||||
for (uint i = 0; i < tokens_.length; i++) {
|
for (uint i = 0; i < tokens_.length; i++) {
|
||||||
amts_[i] = getUint(getIds[i], amts_[i]);
|
amts_[i] = getUint(getIds[i], amts_[i]);
|
||||||
|
|
||||||
if (tokens_[i] == ethAddr) {
|
IERC20(tokens_[i]).safeTransfer(address(instaPool), amts_[i]);
|
||||||
Address.sendValue(payable(address(instaPool)), amts_[i]);
|
|
||||||
} else {
|
|
||||||
IERC20(tokens_[i]).safeTransfer(address(instaPool), amts_[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
setUint(setIds[i], amts_[i]);
|
setUint(setIds[i], amts_[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user