mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feat: updated with mkr symbol case
This commit is contained in:
parent
52443dcd58
commit
92155c1017
|
@ -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 = '';
|
||||
|
||||
(
|
||||
|
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user