Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
6.9 KiB
6.9 KiB
Tezos Bridging Deployment Runbook
This runbook describes how to deploy and configure all possible bridging to the Tezos ecosystem: Etherlink (EVM chain 42793) and Tezos L1 (native Michelson).
Prerequisites (external verification)
Before implementation or production use:
-
CCIP (Etherlink)
- Check CCIP supported networks for Etherlink (chain 42793).
- If supported: obtain the CCIP chain selector for 42793 and set it in
alltra-lifi-settlement/src/config/chains.ts(ETHERLINK.selector) and setccipSupported: true.
-
LiFi (Etherlink)
- Check LiFi API (e.g.
https://li.quest/v1/chains) for chain 42793. - If present: set
lifiSupported: trueinalltra-lifi-settlement/src/config/chains.tsfor ETHERLINK. - If not present: use the same request process as REQUESTING_CCIP_LIFI_SUPPORT.md for Etherlink.
- Check LiFi API (e.g.
Part A: Etherlink (chain 42793)
A1. BridgeRegistry
- No contract change. Destination is registered at runtime.
- Action: After BridgeRegistry is deployed, ensure Etherlink is registered.
Use InitializeRegistry.s.sol, which registers 42793 as "Etherlink Mainnet".
If running initialization manually, call:registerDestination(42793, "Etherlink Mainnet", minFinalityBlocks, timeoutSeconds, baseFee, feeRecipient).
- When registering tokens (e.g. BRG-VLT, BRG-ISO), include 42793 in
allowedDestinations(or use integration defaults that already include 42793).
A2. VaultBridgeIntegration / eMoneyBridgeIntegration / WTokenBridgeIntegration
- Done in code: 42793 (Etherlink) is already in the default destination arrays in:
- Existing deployments: Use
setDefaultDestinations/setDefaultEvmDestinationsto add 42793 if not redeploying.
A3. CCIP bridges (UniversalCCIPBridge, CCIPWETH9Bridge, CCIPWETH10Bridge)
- Condition: Only if CCIP supports Etherlink (see Prerequisites).
- Steps:
- Deploy receiver bridge contracts on Etherlink (same interfaces as on source chain).
- For each token and each bridge: call
addDestination(token, etherlinkChainSelector, receiverBridgeOnEtherlink).
- Reference: DeployWETHBridges.s.sol, execute-bridge-config.sh.
A4. ChainRegistry and EVMAdapter (Etherlink)
- Script: DeployAllAdapters.s.sol already deploys an EVM adapter for Etherlink and registers chain 42793.
- Env:
UNIVERSAL_BRIDGE_ADDRESS,CHAIN_REGISTRY_ADDRESS,PRIVATE_KEY. - Run:
forge script script/deploy/chains/DeployAllAdapters.s.sol --rpc-url <RPC> --broadcast(fromsmom-dbis-138).
A5. LiFi / alltra-lifi-settlement
- Config: chains.ts includes an ETHERLINK entry (chainId 42793, rpcUrl, explorerUrl, nativeCurrency from eip155-42793). Set
selector,usdcAddress,ccipSupported,lifiSupportedafter Prerequisites verification. - Docs: CHAIN_SUPPORT.md includes Etherlink in the support matrix and verification section.
A6. BRG scripts and token registration
- Scripts: register-vault-deposit-tokens.sh, register-iso-deposit-tokens.sh document that 42793 (Etherlink) and 1 (Tezos L1) should be included in allowedDestinations when registering tokens.
- Default destinations: New deployments of VaultBridgeIntegration / eMoneyBridgeIntegration / WTokenBridgeIntegration already include 42793;
registerDepositTokenDefault/registereMoneyTokenDefault/registerWTokenDefaultwill include Etherlink.
Part B: Tezos L1 (native Michelson)
B1. TezosAdapter
- Contract: TezosAdapter.sol
Implements IChainAdapter: lock tokens, emit TezosBridgeInitiated; oracle callsconfirmTransaction(requestId, tezosTxHash)when Tezos tx is confirmed.
B2/B4. ChainRegistry and BridgeRegistry
- ChainRegistry: Tezos L1 is registered via DeployAllAdapters.s.sol as
registerNonEVMChain("Tezos-Mainnet", ChainType.Other, tezosAdapter, "https://tzkt.io", ...). - BridgeRegistry: InitializeRegistry.s.sol registers Tezos-Mainnet with chainId 1 (non-EVM slot). For tokens that may bridge to Tezos L1, include 1 in
allowedDestinations.
B3. Deploy TezosAdapter and register
- Run DeployAllAdapters.s.sol; it deploys TezosAdapter and registers "Tezos-Mainnet" in ChainRegistry.
B5. Tezos-side relay
- Runbook: TEZOS_L1_RELAY_RUNBOOK.md describes:
- TezosAdapter event schema (TezosBridgeInitiated)
- Relay flow: watch events → perform Tezos-side mint/transfer → call
confirmTransaction - ORACLE_ROLE usage and security notes.
Implementation order
- Prerequisites: Verify CCIP and LiFi for Etherlink (42793); record selectors and flags in chains.ts and CHAIN_SUPPORT.md.
- Etherlink: A1 (BridgeRegistry via InitializeRegistry) and A2 (integrations already include 42793) → A4 (DeployAllAdapters) → A5 (LiFi config/docs) → A3 if CCIP supports Etherlink → A6 (BRG scripts/docs).
- Tezos L1: B1 (TezosAdapter exists) → B2/B4 (BridgeRegistry destination 1 in InitializeRegistry) → B3 (DeployAllAdapters) → B5 (relay runbook).
- Doc: This runbook; update after Prerequisites verification.
References
- InitializeRegistry.s.sol – BridgeRegistry destinations (Etherlink 42793, Tezos-Mainnet 1, XRPL 0).
- DeployAllAdapters.s.sol – EVMAdapter(42793), TezosAdapter, ChainRegistry registration.
- execute-bridge-config.sh – CCIP addDestination pattern.
- TEZOS_L1_RELAY_RUNBOOK.md – Tezos L1 relay behavior and event schema.