Co-authored-by: Cursor <cursoragent@cursor.com>
3.8 KiB
Runbook: Add LINK Support to Mainnet Relay Bridge
Last Updated: 2026-02-13
Status: Planned
Prerequisite: TOKEN_MAPPING_AND_MAINNET_ADDRESSES.md
Context
The Mainnet CCIPRelayBridge (0xF9A32F37099c582D28b4dE7Fca6eaC1e5259f939) is WETH9-only: it accepts only WETH9 in ccipReceive and has no token registry. The relay service already maps Chain 138 LINK → Mainnet LINK in tokenMapping; to actually deliver LINK 138→Mainnet you must extend the bridge or add a separate receiver.
Option A: Extend CCIPRelayBridge to accept LINK
-
Contract change
Insmom-dbis-138/contracts/relay/CCIPRelayBridge.sol:- Add an immutable or configurable
linkaddress (Mainnet LINK:0x514910771AF9Ca656af840dff83E8264EcF986CA). - In
ccipReceive, allowmessage.tokenAmounts[0].tokento be eitherweth9orlink; transfer the corresponding token to the decoded recipient. - Keep replay protection and router role as-is.
- Add an immutable or configurable
-
Deploy
Deploy a new bridge (or use an upgrade pattern if the contract is upgradeable; current one is not). Update:config/smart-contracts-master.json(chain 1) if you use a new contract key.- Relay service config:
CCIP_RELAY_BRIDGE_MAINNETif the LINK receiver is a new address. If the same contract handles both WETH9 and LINK, no relay config change beyond ensuringtokenMappingincludes LINK (already done viaconfig/token-mapping.json).
-
Fund
Transfer Mainnet LINK to the bridge (or LINK receiver) so it can pay out relayed amounts. -
Token mapping
Inconfig/token-mapping.json, setrelaySupported: truefor the LINK entry. Redeploy or restart the relay so it picks up the mapping (already maps LINK; bridge will no longer revert for LINK).
Option B: Deploy a separate LINK receiver
-
New contract
Deploy a small receiver contract (e.g.CCIPRelayBridgeLINK) that:- Has
ROUTER_ROLEgranted to the same CCIPRelayRouter (0xAd9A228CcEB4cbB612cD165FFB72fE090ff10Afb). - In
ccipReceive, accepts only Mainnet LINK; transfers LINK to the decoded recipient; replay protection by messageId (or reuse a shared registry).
- Has
-
Relay service
The relay currently sends all messages to one bridge address. To support LINK you would need either:- Router logic: Mainnet router inspects token in the message and calls the appropriate bridge (WETH9 bridge vs LINK bridge), or
- Relay service logic: Relay service chooses destination bridge address by token (e.g. LINK → LINK receiver, others → existing CCIPRelayBridge). That requires changing the relay to pass a different
relayBridgeAddressper token (or per message).
-
Fund
Fund the LINK receiver with Mainnet LINK. -
Config
Document the new LINK receiver address inconfig/smart-contracts-master.json(chain 1) and in TOKEN_MAPPING_AND_MAINNET_ADDRESSES.md. SetrelaySupported: truefor LINK inconfig/token-mapping.jsononce the path is live.
After LINK is supported
- Update TOKEN_MAPPING_AND_MAINNET_ADDRESSES.md table: LINK row → "Relay supported: ✅ Yes".
- In
config/token-mapping.json, setrelaySupported: truefor the LINK token entry. - Add a short note to CCIP_BRIDGE_MAINNET_CONNECTION.md that LINK is accepted (and which contract holds it).
References
- TOKEN_MAPPING_AND_MAINNET_ADDRESSES.md — Token mapping and recommendations
- CCIP_BRIDGE_MAINNET_CONNECTION.md — Mainnet contracts and relay flow
smom-dbis-138/contracts/relay/CCIPRelayBridge.sol— Current WETH9-only bridge