Replace deprecated methods

This commit is contained in:
Mubaris NK 2021-02-06 00:30:33 +05:30
parent 5d8139c494
commit 279452e845
No known key found for this signature in database
GPG Key ID: 9AC09AD0F8D68561
11 changed files with 22 additions and 22 deletions

View File

@ -160,7 +160,7 @@ abstract contract OneProtoResolver is OneHelpers {
uint initalBal = getTokenBal(_buyAddr);
oneProtoContract.swap.value(ethAmt)(
oneProtoContract.swap{value: ethAmt}(
_sellAddr,
_buyAddr,
_sellAmt,
@ -201,7 +201,7 @@ abstract contract OneProtoResolver is OneHelpers {
}
uint initalBal = getTokenBal(_buyAddr);
oneSplitContract.swapMulti.value(ethAmt)(
oneSplitContract.swapMulti{value: ethAmt}(
convertToTokenInterface(oneProtoData.tokens),
_sellAmt,
_slippageAmt,
@ -248,7 +248,7 @@ abstract contract OneInchResolver is OneProtoResolver {
uint initalBal = getTokenBal(buyToken);
// 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");
uint finalBal = getTokenBal(buyToken);

View File

@ -105,7 +105,7 @@ abstract contract BasicResolver is AaveHelpers {
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);
@ -176,7 +176,7 @@ abstract contract BasicResolver is AaveHelpers {
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);

View File

@ -89,7 +89,7 @@ abstract contract AaveHelpers is DSMath, Stores {
}
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 {

View File

@ -181,7 +181,7 @@ contract BasicResolver is CompoundHelpers {
enterMarket(cToken);
if (token == getAddressETH()) {
_amt = _amt == uint(-1) ? address(this).balance : _amt;
CETHInterface(cToken).mint.value(_amt)();
CETHInterface(cToken).mint{value: _amt}();
} else {
TokenInterface tokenContract = TokenInterface(token);
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
@ -250,7 +250,7 @@ contract BasicResolver is CompoundHelpers {
if (token == getAddressETH()) {
require(address(this).balance >= _amt, "not-enough-eth");
CETHInterface(cToken).repayBorrow.value(_amt)();
CETHInterface(cToken).repayBorrow{value: _amt}();
} else {
TokenInterface tokenContract = TokenInterface(token);
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
@ -293,7 +293,7 @@ contract ExtraResolver is BasicResolver {
if (token == getAddressETH()) {
_amt = _amt == uint(-1) ? address(this).balance : _amt;
CETHInterface(cToken).mint.value(_amt)();
CETHInterface(cToken).mint{value: _amt}();
} else {
TokenInterface tokenContract = TokenInterface(token);
_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;
if (tokenToPay == getAddressETH()) {
require(address(this).balance >= _amt, "not-enought-eth");
CETHInterface(cTokenPay).liquidateBorrow.value(_amt)(borrower, cTokenColl);
CETHInterface(cTokenPay).liquidateBorrow{value: _amt}(borrower, cTokenColl);
} else {
TokenInterface tokenContract = TokenInterface(tokenToPay);
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");

View File

@ -195,7 +195,7 @@ contract BasicResolver is CompoundHelpers {
enterMarket(cToken);
if (token == getAddressETH()) {
_amt = _amt == uint(-1) ? address(this).balance : _amt;
CETHInterface(cToken).mint.value(_amt)();
CETHInterface(cToken).mint{value: _amt}();
} else {
TokenInterface tokenContract = TokenInterface(token);
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
@ -276,7 +276,7 @@ contract BasicResolver is CompoundHelpers {
if (token == getAddressETH()) {
require(address(this).balance >= _amt, "not-enough-eth");
CETHInterface(cToken).repayBorrow.value(_amt)();
CETHInterface(cToken).repayBorrow{value: _amt}();
} else {
TokenInterface tokenContract = TokenInterface(token);
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");
@ -343,7 +343,7 @@ contract ExtraResolver is BasicResolver {
if (token == getAddressETH()) {
_amt = _amt == uint(-1) ? address(this).balance : _amt;
CETHInterface(cToken).mint.value(_amt)();
CETHInterface(cToken).mint{value: _amt}();
} else {
TokenInterface tokenContract = TokenInterface(token);
_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;
if (tokenToPay == getAddressETH()) {
require(address(this).balance >= _amt, "not-enought-eth");
CETHInterface(cTokenPay).liquidateBorrow.value(_amt)(borrower, cTokenColl);
CETHInterface(cTokenPay).liquidateBorrow{value: _amt}(borrower, cTokenColl);
} else {
TokenInterface tokenContract = TokenInterface(tokenToPay);
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");

View File

@ -167,7 +167,7 @@ abstract contract BasicResolver is DydxHelpers {
if (token == getEthAddr()) {
TokenInterface tokenContract = TokenInterface(getWETHAddr());
_amt = _amt == uint(-1) ? address(this).balance : _amt;
tokenContract.deposit.value(_amt)();
tokenContract.deposit{value: _amt}();
tokenContract.approve(getDydxAddress(), _amt);
} else {
TokenInterface tokenContract = TokenInterface(token);
@ -273,7 +273,7 @@ abstract contract BasicResolver is DydxHelpers {
if (token == getEthAddr()) {
TokenInterface tokenContract = TokenInterface(getWETHAddr());
require(address(this).balance >= _amt, "not-enough-eth");
tokenContract.deposit.value(_amt)();
tokenContract.deposit{value: _amt}();
tokenContract.approve(getDydxAddress(), _amt);
} else {
TokenInterface tokenContract = TokenInterface(token);

View File

@ -226,7 +226,7 @@ contract LiquidityManage is LiquidityHelpers {
tokenContract.approve(getLiquidityAddress(), _amt);
}
LiqudityInterface(getLiquidityAddress()).deposit.value(ethAmt)(token, _amt);
LiqudityInterface(getLiquidityAddress()).deposit{value: ethAmt}(token, _amt);
setUint(setId, _amt);
emit LogDepositLiquidity(token, _amt, getId, setId);

View File

@ -81,7 +81,7 @@ abstract contract KyberResolver is KyberHelpers {
sellContract.approve(getKyberAddr(), _sellAmt);
}
uint _buyAmt = KyberInterface(getKyberAddr()).trade.value(ethAmt)(
uint _buyAmt = KyberInterface(getKyberAddr()).trade{value: ethAmt}(
sellAddr,
_sellAmt,
buyAddr,

View File

@ -398,7 +398,7 @@ contract BasicResolver is MakerHelpers {
if (isEth(address(tokenContract))) {
_amt = _amt == uint(-1) ? address(this).balance : _amt;
tokenContract.deposit.value(_amt)();
tokenContract.deposit{value: _amt}();
} else {
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
}
@ -671,7 +671,7 @@ contract BasicExtraResolver is BasicResolver {
if (isEth(address(makerData.tokenContract))) {
_amtDeposit = _amtDeposit == uint(-1) ? address(this).balance : _amtDeposit;
makerData.tokenContract.deposit.value(_amtDeposit)();
makerData.tokenContract.deposit{value: _amtDeposit}();
} else {
_amtDeposit = _amtDeposit == uint(-1) ? makerData.tokenContract.balanceOf(address(this)) : _amtDeposit;
}

View File

@ -142,7 +142,7 @@ contract OasisHelpers is Helpers {
}
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 {

View File

@ -94,7 +94,7 @@ abstract contract UniswapHelpers is Stores, DSMath {
}
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 {