Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/__snapshots__/getBridgeUiConfig.unit.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports[`successfully generates bridge UI config from deployment transaction 1`]
"l2Contracts": {
"customGateway": "0xB59dD42cC815FdA12B8b40A410164D49Fd2E96Fc",
"multicall": "0x73465577E9FD7Cd585E4270F23A9eBa99B92b6eD",
"proxyAdmin": "0x7618B3d4d8C71132BfCd33fDD98424a060F37470",
"proxyAdmin": "0xA811e68582E043680D915a38Cc11005Ef1F0A509",
"router": "0xFb4ea97964A04D0Dd367Bd69ffF03e66dfDB55b8",
"standardGateway": "0x6b6f76e5D2A2C8Ee2cc2964ccaAFf570835B003a",
"weth": "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",
Expand Down
2 changes: 1 addition & 1 deletion src/getBridgeUiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export async function getBridgeUiConfig<TChain extends Chain>({
l2Contracts: {
customGateway: tokenBridgeContracts.parentChainContracts.customGateway,
multicall: tokenBridgeContracts.parentChainContracts.multicall,
proxyAdmin: tokenBridgeContracts.orbitChainContracts.proxyAdmin,
proxyAdmin: coreContracts.adminProxy,
router: tokenBridgeContracts.parentChainContracts.router,
standardGateway: tokenBridgeContracts.parentChainContracts.standardGateway,
weth: tokenBridgeContracts.parentChainContracts.weth,
Expand Down
14 changes: 14 additions & 0 deletions src/getBridgeUiConfig.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,18 @@ it('successfully generates bridge UI config from deployment transaction', async
});

expect(bridgeUiConfig).toMatchSnapshot();

// l2Contracts describes the PARENT chain; l3Contracts describes the orbit chain.
// A regression here means l2Contracts.proxyAdmin was populated from the orbit
// chain's proxyAdmin instead of the parent chain's (see coreContracts.adminProxy).
expect(bridgeUiConfig.tokenBridgeContracts.l2Contracts.proxyAdmin).not.toBe(
bridgeUiConfig.tokenBridgeContracts.l3Contracts.proxyAdmin,
);

// Confirm the parent-chain proxyAdmin is an address with real bytecode ON THE PARENT CHAIN.
const parentChainCode = await sepoliaClient.getBytecode({
address: bridgeUiConfig.tokenBridgeContracts.l2Contracts.proxyAdmin as `0x${string}`,
});
expect(parentChainCode).toBeDefined();
expect(parentChainCode!.length).toBeGreaterThan(2); // more than just "0x"
});
Loading