refactor isETH condition

This commit is contained in:
Thrilok kumar 2022-10-15 22:30:42 +05:30 committed by GitHub
parent 48980f7509
commit 0ea3c5613c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,11 +201,9 @@ abstract contract MorphoCompound is Helpers, Events {
{ {
uint256 _amt = getUint(_getId, _amount); uint256 _amt = getUint(_getId, _amount);
bool _isETH = _tokenAddress == ethAddr;
MORPHO_COMPOUND.borrow(_poolTokenAddress, _amt, _maxGasForMatching); MORPHO_COMPOUND.borrow(_poolTokenAddress, _amt, _maxGasForMatching);
if (_isETH) convertWethToEth(_isETH, TokenInterface(wethAddr), _amt); convertWethToEth(_tokenAddress == ethAddr, TokenInterface(wethAddr), _amt);
setUint(_setId, _amt); setUint(_setId, _amt);
@ -252,7 +250,7 @@ abstract contract MorphoCompound is Helpers, Events {
MORPHO_COMPOUND.withdraw(_poolTokenAddress, _amt); MORPHO_COMPOUND.withdraw(_poolTokenAddress, _amt);
if (_isETH) convertWethToEth(_isETH, TokenInterface(wethAddr), _amt); convertWethToEth(_isETH, TokenInterface(wethAddr), _amt);
setUint(_setId, _amt); setUint(_setId, _amt);