Indexing Optimism Bridge Deposits
Introduction
This tutorial will guide you through indexing Optimism Standard Bridge deposits in under 5 minutes using Envio HyperIndex's no-code contract import feature.
The Optimism Standard Bridge enables the movement of ETH and ERC-20 tokens between Ethereum and Optimism. We'll index bridge deposit events by extracting the DepositFinalized logs emitted by the bridge contracts on both networks.
Prerequisites
Before starting, ensure you have the following installed:
- Node.js (v22 or newer recommended)
- pnpm (recommended but not required)
- Docker Desktop (required to run the Envio indexer locally)
Note: Docker is specifically required to run your blockchain indexer locally. You can skip Docker installation if you plan only to use Envio Cloud.
Step 1: Initialize Your Indexer
- Open your terminal in an empty directory and run:
pnpx envio@3.0.0-rc.0 init
- Name your indexer (we'll use "optimism-bridge-indexer" in this example):
- Choose your preferred language (TypeScript, JavaScript, or ReScript):
Step 2: Import the Optimism Bridge Contract
-
Select Contract Import → Block Explorer → Optimism
-
Enter the Optimism bridge contract address:
0x4200000000000000000000000000000000000010 -
Select the
DepositFinalizedevent:- Navigate using arrow keys (↑↓)
- Press spacebar to select the event
Tip: You can select multiple events to index simultaneously.
Step 3: Add the Ethereum Mainnet Bridge Contract
-
When prompted, select Add a new contract
-
Choose Block Explorer → Ethereum Mainnet
-
Enter the Ethereum Mainnet gateway contract address:
0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1 -
Select the
ETHDepositInitiatedevent -
When finished adding contracts, select I'm finished