← notes

Adding a network to a token list that moves real funds

Jul 19, 2023

Add the Base mainnet definition to the Optimism token list, the file bridges and interfaces read to resolve a token.

A network definition has to carry enough for a consumer to bridge correctly: the chain id, the standard bridge address, and for each token the L1 and L2 addresses with their decimals. The OP Stack detail that surprises people is that predeploy addresses are identical across chains, so the standard bridge sits at the same 0x4200... address on Base as on Optimism. That is a property of the stack, and it is why a mechanical check can hardcode it.

The reason this deserves care rather than a quick merge is what a wrong entry does. An incorrect L2 address reaches real bridge interfaces, and a user who bridges to a wrong or non-existent counterpart has sent tokens to something that will not credit them. There is no undo. A decimal mismatch between the L1 and L2 token is the quieter version: everything works until amounts are off by a factor of a thousand.

High review burden on a diff that looks trivial, which is a bad combination and exactly why a mechanical check earns its place.

Merged as #421. Pairs with base-bridge-validator, which enforces this file.