diff --git a/src/services/evm/erc20.service.ts b/src/services/evm/erc20.service.ts index 6939b3c4a..18799ba99 100644 --- a/src/services/evm/erc20.service.ts +++ b/src/services/evm/erc20.service.ts @@ -203,7 +203,11 @@ export default class Erc20Service extends BullableService { async insertNewErc20Contracts(_payload: { evmSmartContracts: { id: number; address: string }[]; }) { - const { evmSmartContracts } = _payload; + const evmSmartContracts = [ + ...new Map( + _payload.evmSmartContracts.map((item) => [item.address, item]) + ).values(), + ]; if (evmSmartContracts.length > 0) { const currentHeight = await this.viemClient.getBlockNumber(); const erc20Instances = await this.getErc20Instances( diff --git a/src/services/evm/erc721.service.ts b/src/services/evm/erc721.service.ts index cd5e82459..952b6f4bf 100644 --- a/src/services/evm/erc721.service.ts +++ b/src/services/evm/erc721.service.ts @@ -319,7 +319,11 @@ export default class Erc721Service extends BullableService { async insertNewErc721Contracts(_payload: { evmSmartContracts: { id: number; address: string }[]; }) { - const { evmSmartContracts } = _payload; + const evmSmartContracts = [ + ...new Map( + _payload.evmSmartContracts.map((item) => [item.address, item]) + ).values(), + ]; if (evmSmartContracts.length > 0) { const currentHeight = await this.viemClient.getBlockNumber(); const erc721Instances = await this.getErc721Instances(