mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Replace deprecated methods
This commit is contained in:
parent
5d8139c494
commit
279452e845
|
@ -160,7 +160,7 @@ abstract contract OneProtoResolver is OneHelpers {
|
||||||
|
|
||||||
|
|
||||||
uint initalBal = getTokenBal(_buyAddr);
|
uint initalBal = getTokenBal(_buyAddr);
|
||||||
oneProtoContract.swap.value(ethAmt)(
|
oneProtoContract.swap{value: ethAmt}(
|
||||||
_sellAddr,
|
_sellAddr,
|
||||||
_buyAddr,
|
_buyAddr,
|
||||||
_sellAmt,
|
_sellAmt,
|
||||||
|
@ -201,7 +201,7 @@ abstract contract OneProtoResolver is OneHelpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint initalBal = getTokenBal(_buyAddr);
|
uint initalBal = getTokenBal(_buyAddr);
|
||||||
oneSplitContract.swapMulti.value(ethAmt)(
|
oneSplitContract.swapMulti{value: ethAmt}(
|
||||||
convertToTokenInterface(oneProtoData.tokens),
|
convertToTokenInterface(oneProtoData.tokens),
|
||||||
_sellAmt,
|
_sellAmt,
|
||||||
_slippageAmt,
|
_slippageAmt,
|
||||||
|
@ -248,7 +248,7 @@ abstract contract OneInchResolver is OneProtoResolver {
|
||||||
uint initalBal = getTokenBal(buyToken);
|
uint initalBal = getTokenBal(buyToken);
|
||||||
|
|
||||||
// solium-disable-next-line security/no-call-value
|
// solium-disable-next-line security/no-call-value
|
||||||
(bool success, ) = address(getOneInchAddress()).call.value(ethAmt)(oneInchData.callData);
|
(bool success, ) = address(getOneInchAddress()).call{value: ethAmt}(oneInchData.callData);
|
||||||
if (!success) revert("1Inch-swap-failed");
|
if (!success) revert("1Inch-swap-failed");
|
||||||
|
|
||||||
uint finalBal = getTokenBal(buyToken);
|
uint finalBal = getTokenBal(buyToken);
|
||||||
|
|
|
@ -105,7 +105,7 @@ abstract contract BasicResolver is AaveHelpers {
|
||||||
tokenContract.approve(getAaveProvider().getLendingPoolCore(), _amt);
|
tokenContract.approve(getAaveProvider().getLendingPoolCore(), _amt);
|
||||||
}
|
}
|
||||||
|
|
||||||
aave.deposit.value(ethAmt)(token, _amt, getReferralCode());
|
aave.deposit{value: ethAmt}(token, _amt, getReferralCode());
|
||||||
|
|
||||||
if (!getIsColl(aave, token)) aave.setUserUseReserveAsCollateral(token, true);
|
if (!getIsColl(aave, token)) aave.setUserUseReserveAsCollateral(token, true);
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ abstract contract BasicResolver is AaveHelpers {
|
||||||
TokenInterface(token).approve(getAaveProvider().getLendingPoolCore(), _amt);
|
TokenInterface(token).approve(getAaveProvider().getLendingPoolCore(), _amt);
|
||||||
}
|
}
|
||||||
|
|
||||||
aave.repay.value(ethAmt)(token, _amt, payable(address(this)));
|
aave.repay{value: ethAmt}(token, _amt, payable(address(this)));
|
||||||
|
|
||||||
setUint(setId, _amt);
|
setUint(setId, _amt);
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ abstract contract AaveHelpers is DSMath, Stores {
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertEthToWeth(bool isEth, TokenInterface token, uint amount) internal {
|
function convertEthToWeth(bool isEth, TokenInterface token, uint amount) internal {
|
||||||
if(isEth) token.deposit.value(amount)();
|
if(isEth) token.deposit{value: amount}();
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertWethToEth(bool isEth, TokenInterface token, uint amount) internal {
|
function convertWethToEth(bool isEth, TokenInterface token, uint amount) internal {
|
||||||
|
|
|
@ -181,7 +181,7 @@ contract BasicResolver is CompoundHelpers {
|
||||||
enterMarket(cToken);
|
enterMarket(cToken);
|
||||||
if (token == getAddressETH()) {
|
if (token == getAddressETH()) {
|
||||||
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
||||||
CETHInterface(cToken).mint.value(_amt)();
|
CETHInterface(cToken).mint{value: _amt}();
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
||||||
|
@ -250,7 +250,7 @@ contract BasicResolver is CompoundHelpers {
|
||||||
|
|
||||||
if (token == getAddressETH()) {
|
if (token == getAddressETH()) {
|
||||||
require(address(this).balance >= _amt, "not-enough-eth");
|
require(address(this).balance >= _amt, "not-enough-eth");
|
||||||
CETHInterface(cToken).repayBorrow.value(_amt)();
|
CETHInterface(cToken).repayBorrow{value: _amt}();
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
||||||
|
@ -293,7 +293,7 @@ contract ExtraResolver is BasicResolver {
|
||||||
|
|
||||||
if (token == getAddressETH()) {
|
if (token == getAddressETH()) {
|
||||||
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
||||||
CETHInterface(cToken).mint.value(_amt)();
|
CETHInterface(cToken).mint{value: _amt}();
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
||||||
|
@ -361,7 +361,7 @@ contract ExtraResolver is BasicResolver {
|
||||||
_amt = _amt == uint(-1) ? cTokenContract.borrowBalanceCurrent(borrower) : _amt;
|
_amt = _amt == uint(-1) ? cTokenContract.borrowBalanceCurrent(borrower) : _amt;
|
||||||
if (tokenToPay == getAddressETH()) {
|
if (tokenToPay == getAddressETH()) {
|
||||||
require(address(this).balance >= _amt, "not-enought-eth");
|
require(address(this).balance >= _amt, "not-enought-eth");
|
||||||
CETHInterface(cTokenPay).liquidateBorrow.value(_amt)(borrower, cTokenColl);
|
CETHInterface(cTokenPay).liquidateBorrow{value: _amt}(borrower, cTokenColl);
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(tokenToPay);
|
TokenInterface tokenContract = TokenInterface(tokenToPay);
|
||||||
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
||||||
|
|
|
@ -195,7 +195,7 @@ contract BasicResolver is CompoundHelpers {
|
||||||
enterMarket(cToken);
|
enterMarket(cToken);
|
||||||
if (token == getAddressETH()) {
|
if (token == getAddressETH()) {
|
||||||
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
||||||
CETHInterface(cToken).mint.value(_amt)();
|
CETHInterface(cToken).mint{value: _amt}();
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
||||||
|
@ -276,7 +276,7 @@ contract BasicResolver is CompoundHelpers {
|
||||||
|
|
||||||
if (token == getAddressETH()) {
|
if (token == getAddressETH()) {
|
||||||
require(address(this).balance >= _amt, "not-enough-eth");
|
require(address(this).balance >= _amt, "not-enough-eth");
|
||||||
CETHInterface(cToken).repayBorrow.value(_amt)();
|
CETHInterface(cToken).repayBorrow{value: _amt}();
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
||||||
|
@ -343,7 +343,7 @@ contract ExtraResolver is BasicResolver {
|
||||||
|
|
||||||
if (token == getAddressETH()) {
|
if (token == getAddressETH()) {
|
||||||
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
||||||
CETHInterface(cToken).mint.value(_amt)();
|
CETHInterface(cToken).mint{value: _amt}();
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
||||||
|
@ -414,7 +414,7 @@ contract ExtraResolver is BasicResolver {
|
||||||
_amt = _amt == uint(-1) ? cTokenContract.borrowBalanceCurrent(borrower) : _amt;
|
_amt = _amt == uint(-1) ? cTokenContract.borrowBalanceCurrent(borrower) : _amt;
|
||||||
if (tokenToPay == getAddressETH()) {
|
if (tokenToPay == getAddressETH()) {
|
||||||
require(address(this).balance >= _amt, "not-enought-eth");
|
require(address(this).balance >= _amt, "not-enought-eth");
|
||||||
CETHInterface(cTokenPay).liquidateBorrow.value(_amt)(borrower, cTokenColl);
|
CETHInterface(cTokenPay).liquidateBorrow{value: _amt}(borrower, cTokenColl);
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(tokenToPay);
|
TokenInterface tokenContract = TokenInterface(tokenToPay);
|
||||||
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
|
||||||
|
|
|
@ -167,7 +167,7 @@ abstract contract BasicResolver is DydxHelpers {
|
||||||
if (token == getEthAddr()) {
|
if (token == getEthAddr()) {
|
||||||
TokenInterface tokenContract = TokenInterface(getWETHAddr());
|
TokenInterface tokenContract = TokenInterface(getWETHAddr());
|
||||||
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
||||||
tokenContract.deposit.value(_amt)();
|
tokenContract.deposit{value: _amt}();
|
||||||
tokenContract.approve(getDydxAddress(), _amt);
|
tokenContract.approve(getDydxAddress(), _amt);
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
|
@ -273,7 +273,7 @@ abstract contract BasicResolver is DydxHelpers {
|
||||||
if (token == getEthAddr()) {
|
if (token == getEthAddr()) {
|
||||||
TokenInterface tokenContract = TokenInterface(getWETHAddr());
|
TokenInterface tokenContract = TokenInterface(getWETHAddr());
|
||||||
require(address(this).balance >= _amt, "not-enough-eth");
|
require(address(this).balance >= _amt, "not-enough-eth");
|
||||||
tokenContract.deposit.value(_amt)();
|
tokenContract.deposit{value: _amt}();
|
||||||
tokenContract.approve(getDydxAddress(), _amt);
|
tokenContract.approve(getDydxAddress(), _amt);
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
|
|
|
@ -226,7 +226,7 @@ contract LiquidityManage is LiquidityHelpers {
|
||||||
tokenContract.approve(getLiquidityAddress(), _amt);
|
tokenContract.approve(getLiquidityAddress(), _amt);
|
||||||
}
|
}
|
||||||
|
|
||||||
LiqudityInterface(getLiquidityAddress()).deposit.value(ethAmt)(token, _amt);
|
LiqudityInterface(getLiquidityAddress()).deposit{value: ethAmt}(token, _amt);
|
||||||
setUint(setId, _amt);
|
setUint(setId, _amt);
|
||||||
|
|
||||||
emit LogDepositLiquidity(token, _amt, getId, setId);
|
emit LogDepositLiquidity(token, _amt, getId, setId);
|
||||||
|
|
|
@ -81,7 +81,7 @@ abstract contract KyberResolver is KyberHelpers {
|
||||||
sellContract.approve(getKyberAddr(), _sellAmt);
|
sellContract.approve(getKyberAddr(), _sellAmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint _buyAmt = KyberInterface(getKyberAddr()).trade.value(ethAmt)(
|
uint _buyAmt = KyberInterface(getKyberAddr()).trade{value: ethAmt}(
|
||||||
sellAddr,
|
sellAddr,
|
||||||
_sellAmt,
|
_sellAmt,
|
||||||
buyAddr,
|
buyAddr,
|
||||||
|
|
|
@ -398,7 +398,7 @@ contract BasicResolver is MakerHelpers {
|
||||||
|
|
||||||
if (isEth(address(tokenContract))) {
|
if (isEth(address(tokenContract))) {
|
||||||
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
||||||
tokenContract.deposit.value(_amt)();
|
tokenContract.deposit{value: _amt}();
|
||||||
} else {
|
} else {
|
||||||
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
||||||
}
|
}
|
||||||
|
@ -671,7 +671,7 @@ contract BasicExtraResolver is BasicResolver {
|
||||||
|
|
||||||
if (isEth(address(makerData.tokenContract))) {
|
if (isEth(address(makerData.tokenContract))) {
|
||||||
_amtDeposit = _amtDeposit == uint(-1) ? address(this).balance : _amtDeposit;
|
_amtDeposit = _amtDeposit == uint(-1) ? address(this).balance : _amtDeposit;
|
||||||
makerData.tokenContract.deposit.value(_amtDeposit)();
|
makerData.tokenContract.deposit{value: _amtDeposit}();
|
||||||
} else {
|
} else {
|
||||||
_amtDeposit = _amtDeposit == uint(-1) ? makerData.tokenContract.balanceOf(address(this)) : _amtDeposit;
|
_amtDeposit = _amtDeposit == uint(-1) ? makerData.tokenContract.balanceOf(address(this)) : _amtDeposit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ contract OasisHelpers is Helpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertEthToWeth(TokenInterface token, uint amount) internal {
|
function convertEthToWeth(TokenInterface token, uint amount) internal {
|
||||||
if(address(token) == getAddressWETH()) token.deposit.value(amount)();
|
if(address(token) == getAddressWETH()) token.deposit{value: amount}();
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertWethToEth(TokenInterface token, uint amount) internal {
|
function convertWethToEth(TokenInterface token, uint amount) internal {
|
||||||
|
|
|
@ -94,7 +94,7 @@ abstract contract UniswapHelpers is Stores, DSMath {
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertEthToWeth(TokenInterface token, uint amount) internal {
|
function convertEthToWeth(TokenInterface token, uint amount) internal {
|
||||||
if(address(token) == getAddressWETH()) token.deposit.value(amount)();
|
if(address(token) == getAddressWETH()) token.deposit{value: amount}();
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertWethToEth(TokenInterface token, uint amount) internal {
|
function convertWethToEth(TokenInterface token, uint amount) internal {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user