mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Update contracts/mainnet/connectors/morpho-aave/helpers.sol
Co-authored-by: Thrilok kumar <thrilok2000@gmail.com>
This commit is contained in:
parent
85da96b950
commit
0289824465
|
@ -20,18 +20,12 @@ abstract contract Helpers is Stores, Basic {
|
|||
) internal returns (TokenInterface _tokenContract, uint256 _amt) {
|
||||
_amt = getUint(_getId, _amount);
|
||||
|
||||
bool _isETH = _tokenAddress == ethAddr;
|
||||
|
||||
_tokenContract = _isETH
|
||||
? TokenInterface(wethAddr)
|
||||
: TokenInterface(_tokenAddress);
|
||||
|
||||
if (_amt == uint256(-1)) {
|
||||
_amt = _isETH
|
||||
? address(this).balance
|
||||
: _tokenContract.balanceOf(address(this));
|
||||
if (_tokenAddress == ethAddr) {
|
||||
_tokenContract = TokenInterface(wethAddr);
|
||||
if (_amt == uint256(-1)) _amt = address(this).balance;
|
||||
convertEthToWeth(true, _tokenContract, _amt);
|
||||
} else {
|
||||
_tokenContract = TokenInterface(_tokenAddress);
|
||||
if (_amt == uint256(-1)) _amt = _tokenContract.balanceOf(address(this));
|
||||
}
|
||||
|
||||
if (_isETH) convertEthToWeth(_isETH, _tokenContract, _amt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user