Skip to content

Commit

Permalink
Fix filtered Wrap/Unrwap Events
Browse files Browse the repository at this point in the history
  • Loading branch information
Ktl-XV committed Dec 7, 2023
1 parent bc1b949 commit 4f6a0b0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 43 deletions.
72 changes: 36 additions & 36 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ services:
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events_bsc'
MAX_BLOCKS_REORG: 50
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
EP_DEPLOYMENT_BLOCK: 5375047
MAX_BLOCKS_TO_SEARCH: 2000
MAX_BLOCKS_TO_PULL: 5000
Expand All @@ -119,10 +119,10 @@ services:
CHAIN_ID: '137'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events_polygon'
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
ENABLE_PROMETHEUS_METRICS: "true"
EP_DEPLOYMENT_BLOCK: 14391480
MAX_BLOCKS_TO_SEARCH: 1000
Expand Down Expand Up @@ -154,10 +154,10 @@ services:
CHAIN_ID: '43114'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events_avalanche'
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
ENABLE_PROMETHEUS_METRICS: "true"
EP_DEPLOYMENT_BLOCK: 3601700
MAX_BLOCKS_TO_SEARCH: 5000
Expand Down Expand Up @@ -187,10 +187,10 @@ services:
CHAIN_ID: '250'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events_fantom'
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
EP_ADDRESS: "0xDEF189DeAEF76E379df891899eb5A00a94cBC250"
ENABLE_PROMETHEUS_METRICS: "true"
EP_DEPLOYMENT_BLOCK: 18855765
Expand Down Expand Up @@ -218,10 +218,10 @@ services:
CHAIN_ID: '42220'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events_celo'
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
ENABLE_PROMETHEUS_METRICS: "true"
EP_DEPLOYMENT_BLOCK: 9350111
MAX_BLOCKS_TO_SEARCH: 5000
Expand All @@ -243,10 +243,10 @@ services:
CHAIN_ID: '10'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events_optimism'
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
EP_DEPLOYMENT_BLOCK: 1691335
MAX_BLOCKS_TO_SEARCH: 1000
MAX_BLOCKS_TO_PULL: 1000
Expand Down Expand Up @@ -274,10 +274,10 @@ services:
CHAIN_ID: '42161'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events_arbitrum'
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
EP_DEPLOYMENT_BLOCK: 4050733
MAX_BLOCKS_TO_SEARCH: 1000
MAX_BLOCKS_TO_PULL: 1000
Expand Down Expand Up @@ -308,10 +308,10 @@ services:
RESCRAPE_BLOCKS: 10
FEAT_NFT: "true"
NFT_FEATURE_START_BLOCK: 1410394
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
FEAT_WRAP_UNWRAP_NATIVE_EVENT: "true"
WRAP_UNWRAP_NATIVE_CONTRACT_ADDRESS: '0x4200000000000000000000000000000000000006'

Expand All @@ -327,10 +327,10 @@ services:
CHAIN_ID: '1'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}'
SCHEMA: 'events'
KAFKA_BROKERS: '${KAFKA_BROKERS}'
KAFKA_SSL: '${KAFKA_SSL}'
KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
#KAFKA_BROKERS: '${KAFKA_BROKERS}'
#KAFKA_SSL: '${KAFKA_SSL}'
#KAFKA_AUTH_USER: '${KAFKA_AUTH_USER}'
#KAFKA_AUTH_PASSWORD: '${KAFKA_AUTH_PASSWORD}'
LOG_LEVEL: "info"
FEAT_EXCLUSIVE_TOKENS_FROM_TRANSACTIONS: "true"
TOKENS_FROM_TRANSACTIONS_START_BLOCK: 9193266
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export const FEAT_WRAP_UNWRAP_NATIVE_TRANSFER_EVENT = getBoolConfig(
export const WRAP_UNWRAP_NATIVE_START_BLOCK = getIntConfig('EP_DEPLOYMENT_BLOCK', -1);
validateStartBlock(
'EP_DEPLOYMENT_BLOCK',
WRAP_UNWRAP_NATIVE_START_BLOCK,
EP_DEPLOYMENT_BLOCK,
'FEAT_WRAP_UNWRAP_NATIVE_EVENT',
FEAT_WRAP_UNWRAP_NATIVE_EVENT,
);
Expand Down
6 changes: 0 additions & 6 deletions src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ export const eventScrperProps: EventScraperProps[] = [
contractAddress: V3_EXCHANGE_ADDRESS,
startBlock: FIRST_SEARCH_BLOCK,
parser: parseFillEvent,

tokenMetadataMap: { tokenA: 'makerTokenAddress', tokenB: 'takerTokenAddress' },
},
{
Expand All @@ -387,7 +386,6 @@ export const eventScrperProps: EventScraperProps[] = [
contractAddress: EP_ADDRESS,
startBlock: NFT_FEATURE_START_BLOCK,
parser: parseErc721OrderFilledEvent,

tokenMetadataMap: { tokenA: 'erc20Token', tokenB: 'erc721Token' },
},
{
Expand All @@ -409,7 +407,6 @@ export const eventScrperProps: EventScraperProps[] = [
contractAddress: EP_ADDRESS,
startBlock: NFT_FEATURE_START_BLOCK,
parser: parseErc721OrderPresignedEvent,

tokenMetadataMap: { tokenA: 'erc20Token', tokenB: 'erc721Token' },
},
{
Expand All @@ -421,7 +418,6 @@ export const eventScrperProps: EventScraperProps[] = [
contractAddress: EP_ADDRESS,
startBlock: NFT_FEATURE_START_BLOCK,
parser: parseErc1155OrderFilledEvent,

tokenMetadataMap: { tokenA: 'erc20Token', tokenB: 'erc1155Token' },
},
{
Expand All @@ -443,7 +439,6 @@ export const eventScrperProps: EventScraperProps[] = [
contractAddress: EP_ADDRESS,
startBlock: NFT_FEATURE_START_BLOCK,
parser: parseErc1155OrderPresignedEvent,

tokenMetadataMap: { tokenA: 'erc20Token', tokenB: 'erc1155Token' },
},
{
Expand Down Expand Up @@ -489,7 +484,6 @@ export const eventScrperProps: EventScraperProps[] = [
},
{
enabled: FEAT_ONCHAIN_GOVERNANCE,

name: 'ZeroExProtocolGovernorProposalCreatedEvent',
tType: OnchainGovernanceProposalCreatedEvent,
table: 'onchain_governance_proposal_created',
Expand Down
1 change: 1 addition & 0 deletions src/filters/wrap_unwrap_native_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export async function filterWrapUnwrapEvents(events: Event[], web3Source: Web3So

const validTxHashSet = new Set(txHashes);
const filteredLogs = events.filter((log: Event) => validTxHashSet.has(log.transactionHash));
return filteredLogs;
}
return [];
}

0 comments on commit 4f6a0b0

Please sign in to comment.