diff --git a/bridge_indexer/configs/mainnet.yaml b/bridge_indexer/configs/mainnet.yaml new file mode 100644 index 0000000..51136ea --- /dev/null +++ b/bridge_indexer/configs/mainnet.yaml @@ -0,0 +1,129 @@ +contracts: + tezos_smart_rollup: + kind: tezos + address: ${SMART_ROLLUP_ADDRESS} + typename: rollup + + etherlink_rollup_kernel: + kind: evm + address: '0x0000000000000000000000000000000000000000' + typename: kernel + + etherlink_rollup_kernel_native: + kind: evm + address: '0x0000000000000000000000000000000000000000' + typename: kernel_native + + l2_pepe_token: + kind: evm + address: 0x9121b153bbcf8c23f20ee43b494f08760b91ad64 + typename: l2_token + l2_ottez_token: + kind: evm + address: 0x8322723f5ca51cb20a80d6c55d24eaa1651f68c7 + typename: l2_token + + +indexes: + tezos_head: + kind: tezos.head + datasources: + - tzkt + callback: tezos.on_head + + tezos_rollup_cement: + kind: tezos.operations + first_level: ${L1_FIRST_LEVEL} + datasources: + - tzkt + types: + - sr_cement + contracts: + - tezos_smart_rollup + handlers: + - callback: tezos.on_cement_commitment + pattern: + - type: sr_cement + destination: tezos_smart_rollup + + + tezos_deposit_operations: + kind: tezos.operations + first_level: ${L1_FIRST_LEVEL} + datasources: + - tzkt + types: + - transaction + contracts: + - tezos_smart_rollup + handlers: + - callback: tezos.on_rollup_call + pattern: + - type: transaction + destination: tezos_smart_rollup + entrypoint: default + + etherlink_deposit_events: + kind: evm.events + first_level: ${L2_FIRST_LEVEL} + datasources: + - etherlink_subsquid + - etherlink_node + handlers: + - callback: etherlink.on_deposit + contract: etherlink_rollup_kernel + name: Deposit + + etherlink_xtz_deposit_transactions: + kind: evm.transactions + first_level: ${L2_FIRST_LEVEL} + datasources: + - etherlink_subsquid + - etherlink_node + handlers: + - callback: etherlink.on_xtz_deposit + from_: etherlink_rollup_kernel + + + etherlink_withdrawal_events: + kind: evm.events + first_level: ${L2_FIRST_LEVEL} + datasources: + - etherlink_subsquid + - etherlink_node + handlers: + - callback: etherlink.on_withdraw + contract: etherlink_rollup_kernel + name: Withdrawal + - callback: etherlink.on_xtz_withdraw + contract: etherlink_rollup_kernel_native + name: Withdrawal + + tezos_withdrawal_operations: + kind: tezos.operations + first_level: ${L1_FIRST_LEVEL} + datasources: + - tzkt + types: + - sr_execute + contracts: + - tezos_smart_rollup + handlers: + - callback: tezos.on_rollup_execute + pattern: + - type: sr_execute + destination: tezos_smart_rollup + + + etherlink_token_balance_update_events: + kind: evm.events + datasources: + - etherlink_subsquid + - etherlink_node + handlers: + - callback: etherlink.on_transfer + contract: l2_pepe_token + name: Transfer + - callback: etherlink.on_transfer + contract: l2_ottez_token + name: Transfer diff --git a/bridge_indexer/handlers/batch.py b/bridge_indexer/handlers/batch.py index dee5c70..d7ec52a 100644 --- a/bridge_indexer/handlers/batch.py +++ b/bridge_indexer/handlers/batch.py @@ -1,15 +1,13 @@ import logging - -from bridge_indexer.handlers.bridge_matcher import BridgeMatcher - -logger = logging.getLogger('bridge_indexer.handlers.batch') - - from collections.abc import Iterable from dipdup.context import HandlerContext from dipdup.index import MatchedHandler +from bridge_indexer.handlers.bridge_matcher import BridgeMatcher + +logger = logging.getLogger('bridge_indexer.handlers.batch') + async def batch( ctx: HandlerContext, diff --git a/bridge_indexer/handlers/ticket.py b/bridge_indexer/handlers/ticket.py index 559693a..5f8d835 100644 --- a/bridge_indexer/handlers/ticket.py +++ b/bridge_indexer/handlers/ticket.py @@ -37,9 +37,10 @@ async def register_fa_tickets(self): ) first_levels.append(ticket_data['firstLevel']) - from bridge_indexer.handlers.rollup_message import RollupMessageIndex + if first_levels: + from bridge_indexer.handlers.rollup_message import RollupMessageIndex - RollupMessageIndex.first_ticket_level = min(first_levels) + RollupMessageIndex.first_ticket_level = min(first_levels) async def fetch_ticket(self, ticketer_address, ticket_content: TicketContent): ticket_hash = self.get_ticket_hash(ticketer_address, ticket_content)