How to index an EVM contract
-
Create an account (link) and log in to the user dashboard.
-
Create a project. This is how you will manage your indexing with Center.
-
Create a managed Postgres database. If you have already created a managed Postgres database, you can skip this step.
- Go to the "Destinations" tab on the sidebar.
- Click "Add Destination" in the upper right corner.
- Click "Managed Postgres Database".
- Give the database a name.
- Create the destination.
- Run migrations by clicking on the green "Run Migrations" button in the UI.
- To access this destination, you can use your favorite Postgres client or
psql
in the terminal (see guide).
Note: All of these steps must be followed before adding your contract.
-
Add an EVM Contract.
- Go to the "Sources" tab on the sidebar.
- Select "Add Source" in the upper right corner.
- Select "EVM Contract".
- Fill in the details for your contract (Network, Address, Name). See example below:
- Network: Ethereum
- Name: Milady
- Address:
0x12970e6868f88f6557b76120662c1b3e50a646bf
- Click "Import ABI from Etherscan". If this does not work for your contract, you will need to add the ABI manually.
- Create the source.
-
Start accessing your data.
- The sync will start immediately.
- You can view the progress of the sync directly in the dashboard on the source page.
- To see data, you can either:
- Click on a contract event in the Contract Events table in the dashboard.
- Go to your managed Postgres instance. Tables will automatically be created for the contract events.