Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unichain #168

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,37 @@ services:
BLOCK_RECEIPTS_MODE: "standard"
networks:
- 0x-data-migrations_default

event-pipeline-unichain:
build:
context: .
dockerfile: Dockerfile.dev
platform: linux/amd64
restart: always
environment:
SCRAPER_MODE: 'BLOCKS'
EVM_RPC_URL: '${RPC_URL_UNICHAIN}'
CHAIN_ID: '130'
POSTGRES_URI: 'postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}'
SCHEMA: 'events_unichain'
FEAT_ZEROEX_EXCHANGE_PROXY: "false"
SETTLER_DEPLOYMENT_BLOCK: 8151122
MAX_BLOCKS_TO_SEARCH: 1000
MAX_BLOCKS_TO_PULL: 100
SECONDS_BETWEEN_RUNS: 1
RESCRAPE_BLOCKS: 10
FEAT_WRAP_UNWRAP_NATIVE_EVENT: "true"
WRAP_UNWRAP_NATIVE_CONTRACT_ADDRESS: '0x4200000000000000000000000000000000000006'
FEAT_TOKENS_FROM_TRANSFERS: "true"
FEAT_ERC20_TRANSFER_ALL: "true"
FEAT_SETTLER_ERC721_TRANSFER_EVENT: "true"
TOKENS_FROM_TRANSFERS_START_BLOCK: "1"
SOCKET_BRIDGE_CONTRACT_ADDRESS: "0x3a23f943181408eac424116af7b7790c94cb97a5"
SOCKET_BRIDGE_EVENT_START_BLOCK: "8151122"
BLOCK_RECEIPTS_MODE: "standard"
networks:
- 0x-data-migrations_default

token-scraper-ethereum:
depends_on:
- postgres
Expand Down
1 change: 1 addition & 0 deletions env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ RPC_URL_LINEA=
RPC_URL_MODE=
RPC_URL_MANTLE=
RPC_URL_WORLDCHAIN=
RPC_URL_UNICHAIN=
23 changes: 12 additions & 11 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const supportedChains: Map = {
34443: { name: 'Mode' },
5000: { name: 'Mantle' },
480: { name: 'Worldchain' },
130: { name: 'Unichain' },
};

interface BridgeContract {
Expand Down Expand Up @@ -145,10 +146,10 @@ export const SCRAPER_MODE: ScraperMode =
process.env.SCRAPER_MODE === undefined
? DEFAULT_SCRAPER_MODE
: process.env.SCRAPER_MODE === 'BLOCKS'
? 'BLOCKS'
: process.env.SCRAPER_MODE === 'EVENTS'
? 'EVENTS'
: throwError('Wrong SCRAPER_MODE');
? 'BLOCKS'
: process.env.SCRAPER_MODE === 'EVENTS'
? 'EVENTS'
: throwError('Wrong SCRAPER_MODE');
export const METRICS_PATH = process.env.METRICS_PATH || DEFAULT_METRICS_PATH;

export const PROMETHEUS_PORT = getIntConfig('PROMETHEUS_PORT', DEFAULT_PROMETHEUS_PORT);
Expand Down Expand Up @@ -389,13 +390,13 @@ export const FEAT_UNISWAP_V2_PAIR_CREATED_EVENT = getBoolConfig(
export const UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS = process.env
.UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS
? process.env.UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS.split(',').map((contract) => {
const [name, factoryAddress, startBlock] = contract.split(':');
return {
name,
factoryAddress,
startBlock: parseInt(startBlock),
};
})
const [name, factoryAddress, startBlock] = contract.split(':');
return {
name,
factoryAddress,
startBlock: parseInt(startBlock),
};
})
: [];

if (
Expand Down
Loading