diff --git a/contracts/misc/UiPoolDataProvider.sol b/contracts/misc/UiPoolDataProvider.sol index 9cbefbcd..1be6e3cb 100644 --- a/contracts/misc/UiPoolDataProvider.sol +++ b/contracts/misc/UiPoolDataProvider.sol @@ -18,6 +18,7 @@ import {IChainlinkAggregator} from '../interfaces/IChainlinkAggregator.sol'; import { DefaultReserveInterestRateStrategy } from '../protocol/lendingpool/DefaultReserveInterestRateStrategy.sol'; +import {IERC20DetailedBytes} from './interfaces/IERC20DetailedBytes.sol'; contract UiPoolDataProvider is IUiPoolDataProvider { using WadRayMath for uint256; @@ -111,7 +112,13 @@ contract UiPoolDataProvider is IUiPoolDataProvider { .scaledTotalSupply(); // we're getting this info from the aToken, because some of assets can be not compliant with ETC20Detailed - reserveData.symbol = IERC20Detailed(reserveData.underlyingAsset).symbol(); + try IERC20Detailed(reserveData.underlyingAsset).symbol() returns (string memory symbol) { + reserveData.symbol = symbol; + } catch (bytes memory /*lowLevelData*/) { + bytes32 symbol = IERC20DetailedBytes(reserveData.underlyingAsset).symbol(); + reserveData.symbol = string(abi.encodePacked(symbol)); + } + // reserveData.symbol = IERC20Detailed(reserveData.underlyingAsset).symbol(); reserveData.name = ''; ( diff --git a/contracts/misc/interfaces/IERC20DetailedBytes.sol b/contracts/misc/interfaces/IERC20DetailedBytes.sol index de91e288..8c47df16 100644 --- a/contracts/misc/interfaces/IERC20DetailedBytes.sol +++ b/contracts/misc/interfaces/IERC20DetailedBytes.sol @@ -1,8 +1,12 @@ // SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; -contract IERC20DetailedBytes { - bytes32 public name; - bytes32 public symbol; - uint256 public decimals; -} +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; + +interface IERC20DetailedBytes is IERC20 { + function name() external view returns (bytes32); + + function symbol() external view returns (bytes32); + + function decimals() external view returns (uint8); +} \ No newline at end of file