Revert "feat: update logic"

This reverts commit 07b44ce236.
This commit is contained in:
Shriya Tyagi 2024-01-17 20:37:23 +04:00
parent 07b44ce236
commit e05781d51e

View File

@ -37,15 +37,15 @@ abstract contract BasicConnector is Events, DSMath, Basic {
vaultTokenContract.asset()
);
bool _isEth = vaultToken == ethAddr;
if (_isEth) {
_underlyingAmt = _underlyingAmt == uint256(-1) ? address(this).balance : _underlyingTokenContract.balanceOf(address(this));
convertEthToWeth(_isEth, TokenInterface(wethAddr), _underlyingAmt);
if (_underlyingAmt == uint256(-1)) {
if (address(_underlyingTokenContract) == wethAddr) {
TokenInterface(wethAddr).deposit{value: address(this).balance}();
}
_underlyingAmt = _underlyingTokenContract.balanceOf(address(this));
} else {
_underlyingAmt = _underlyingAmt == uint256(-1)
? _underlyingTokenContract.balanceOf(address(this))
: _underlyingAmt;
if (address(_underlyingTokenContract) == wethAddr) {
TokenInterface(wethAddr).deposit{value: _underlyingAmt}();
}
}
// Returns final amount in token decimals.