diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 449833e..aaebd9c 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -85,3 +85,10 @@ export const ETH_MAINNET_NETWORK = 'mainnet'; export const FTM_MAINNET_NETWORK = 'fantom'; export const ARB_MAINNET_NETWORK = 'arbitrum-one'; export const OPS_MAINNET_NETWORK = 'optimism'; + +// Values that are modified in the contract but don't emit an event to handle +export const shareTokenNames = new Map(); +shareTokenNames.set('0x0a0b23d9786963de69cb2447dc125c49929419d8', 'MIM yVault'); + +export const shareTokenSymbol = new Map(); +shareTokenNames.set('0x0a0b23d9786963de69cb2447dc125c49929419d8', 'yvMIM'); diff --git a/src/utils/token.ts b/src/utils/token.ts index 5147fd6..a185262 100644 --- a/src/utils/token.ts +++ b/src/utils/token.ts @@ -1,7 +1,11 @@ import { Address } from '@graphprotocol/graph-ts'; import { Token } from '../../generated/schema'; import { ERC20 } from '../../generated/Registry/ERC20'; -import { DEFAULT_DECIMALS } from '../utils/constants'; +import { + DEFAULT_DECIMALS, + shareTokenNames, + shareTokenSymbol, +} from '../utils/constants'; export function getOrCreateToken(address: Address): Token { let id = address.toHexString(); @@ -15,8 +19,17 @@ export function getOrCreateToken(address: Address): Token { let symbol = erc20Contract.try_symbol(); // TODO: add overrides for name and symbol token.decimals = decimals.reverted ? DEFAULT_DECIMALS : decimals.value; - token.name = name.reverted ? '' : name.value; - token.symbol = symbol.reverted ? '' : symbol.value; + token.name = name.reverted + ? shareTokenNames.has(id) + ? shareTokenNames.get(id) + : '' + : name.value; + token.symbol = symbol.reverted + ? shareTokenSymbol.has(id) + ? shareTokenSymbol.get(id) + : '' + : symbol.value; + token.save(); } return token as Token;