mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
bug fixes + refactoring
This commit is contained in:
parent
ae51a19713
commit
7477438395
|
@ -103,7 +103,7 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
aave.supply(_token, _amt, address(this), referralCode);
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(token)) {
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, false);
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogBorrowOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -344,7 +351,9 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
TokenInterface tokenContract = TokenInterface(_token);
|
||||
|
||||
_amt = _amt == uint256(-1) ? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf) : _amt;
|
||||
_amt = _amt == uint256(-1)
|
||||
? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf)
|
||||
: _amt;
|
||||
|
||||
if (isEth) convertEthToWeth(isEth, tokenContract, _amt);
|
||||
|
||||
|
@ -355,7 +364,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogPaybackOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -484,7 +500,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogDelegateBorrow(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, delegateTo, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
delegateTo,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
aave.supply(_token, _amt, address(this), referralCode);
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(token)) {
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, false);
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogBorrowOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -344,7 +351,9 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
TokenInterface tokenContract = TokenInterface(_token);
|
||||
|
||||
_amt = _amt == uint256(-1) ? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf) : _amt;
|
||||
_amt = _amt == uint256(-1)
|
||||
? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf)
|
||||
: _amt;
|
||||
|
||||
if (isAVAX) convertAvaxToWavax(isAVAX, tokenContract, _amt);
|
||||
|
||||
|
@ -355,7 +364,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogPaybackOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -409,6 +425,7 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
_eventName = "LogDisableCollateral(address[])";
|
||||
_eventParam = abi.encode(tokens);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Swap borrow rate mode
|
||||
* @notice Swaps user borrow rate mode between variable and stable
|
||||
|
@ -483,7 +500,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogDelegateBorrow(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, delegateTo, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
delegateTo,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
aave.supply(_token, _amt, address(this), referralCode);
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(token)) {
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, false);
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogBorrowOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -344,7 +351,9 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
TokenInterface tokenContract = TokenInterface(_token);
|
||||
|
||||
_amt = _amt == uint256(-1) ? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf) : _amt;
|
||||
_amt = _amt == uint256(-1)
|
||||
? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf)
|
||||
: _amt;
|
||||
|
||||
if (isFTM) convertFtmToWftm(isFTM, tokenContract, _amt);
|
||||
|
||||
|
@ -355,7 +364,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogPaybackOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -484,8 +500,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogDelegateBorrow(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, delegateTo, getId, setId);
|
||||
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
delegateTo,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
aave.supply(_token, _amt, address(this), referralCode);
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(token)) {
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, false);
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogBorrowOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -344,7 +351,9 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
TokenInterface tokenContract = TokenInterface(_token);
|
||||
|
||||
_amt = _amt == uint256(-1) ? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf) : _amt;
|
||||
_amt = _amt == uint256(-1)
|
||||
? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf)
|
||||
: _amt;
|
||||
|
||||
if (isEth) convertEthToWeth(isEth, tokenContract, _amt);
|
||||
|
||||
|
@ -355,7 +364,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogPaybackOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -484,7 +500,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogDelegateBorrow(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, delegateTo, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
delegateTo,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
aave.supply(_token, _amt, address(this), referralCode);
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(token)) {
|
||||
if (getCollateralBalance(_token) > 0 && getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, false);
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogBorrowOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -344,7 +351,9 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
|
||||
TokenInterface tokenContract = TokenInterface(_token);
|
||||
|
||||
_amt = _amt == uint256(-1) ? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf) : _amt;
|
||||
_amt = _amt == uint256(-1)
|
||||
? getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf)
|
||||
: _amt;
|
||||
|
||||
if (isMatic) convertMaticToWmatic(isMatic, tokenContract, _amt);
|
||||
|
||||
|
@ -355,7 +364,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogPaybackOnBehalfOf(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, onBehalfOf, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
onBehalfOf,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -485,7 +501,14 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogDelegateBorrow(address,uint256,uint256,address,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, _amt, rateMode, delegateTo, getId, setId);
|
||||
_eventParam = abi.encode(
|
||||
token,
|
||||
_amt,
|
||||
rateMode,
|
||||
delegateTo,
|
||||
getId,
|
||||
setId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user