From 0e73640bfafa525b42e6abf9bd4c3cdd7d43bcfa Mon Sep 17 00:00:00 2001 From: phamphong9981 Date: Fri, 6 Sep 2024 14:18:21 +0700 Subject: [PATCH] fix: evm proxy history object string --- .../evm/crawl_evm_proxy_history.service.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/services/evm/crawl_evm_proxy_history.service.ts b/src/services/evm/crawl_evm_proxy_history.service.ts index bdee65458..b9e105080 100644 --- a/src/services/evm/crawl_evm_proxy_history.service.ts +++ b/src/services/evm/crawl_evm_proxy_history.service.ts @@ -139,22 +139,24 @@ export default class CrawlProxyContractEVMService extends BullableService { // break; default: if (firstTimeCatchProxyEvent) { - implementationAddress = await this.contractHelper.isContractProxy( - evmEvent.address, - _.find( - EIPProxyContractSupportByteCode, - (value, __) => value.TYPE === evmEventProxy.type - )?.SLOT, - undefined, - bytecodes[evmEvent.address] - ); + implementationAddress = ( + await this.contractHelper.isContractProxy( + evmEvent.address, + _.find( + EIPProxyContractSupportByteCode, + (value, __) => value.TYPE === evmEventProxy.type + )?.SLOT, + undefined, + bytecodes[evmEvent.address] + ) + )?.logicContractAddress; } break; } newJSONProxy.proxy_contract = _.toLower(evmEvent.address); newJSONProxy.implementation_contract = - _.toLower(implementationAddress as string) || null; + _.toLower(implementationAddress as string | undefined) || null; newJSONProxy.block_height = evmEvent.block_height; newJSONProxy.tx_hash = evmEvent.tx_hash; newJSONProxy.last_updated_height = lastUpdatedHeight;