diff --git a/contracts/asset/AssetManager.sol b/contracts/asset/AssetManager.sol index b269351..e7b2158 100644 --- a/contracts/asset/AssetManager.sol +++ b/contracts/asset/AssetManager.sol @@ -94,12 +94,11 @@ contract AssetManager is Controller, ReentrancyGuardUpgradeable, IAssetManager { /** * @dev Returns the amount of the lending pool balance minus the amount of total staked. * @param tokenAddress ERC20 token address - * @return Amount can be borrowed + * @return loanAmount Amount can be borrowed */ - function getLoanableAmount(address tokenAddress) public view override returns (uint256) { + function getLoanableAmount(address tokenAddress) public view override returns (uint256 loanAmount) { uint256 poolBalance = getPoolBalance(tokenAddress); - if (poolBalance > totalPrincipal[tokenAddress]) return poolBalance - totalPrincipal[tokenAddress]; - return 0; + loanAmount = poolBalance > totalPrincipal[tokenAddress] ? poolBalance - totalPrincipal[tokenAddress] : 0; } /**