Notes
- LI.FI is a bridge aggregator — it routes through underlying bridges (Across, Stargate, Hop, cBridge, etc.)
- Uses a Diamond proxy pattern (EIP-2535)
- The Diamond address is the same on every chain but Arc, whose address differs
- Uses standard EVM chain IDs for
destinationChainId - The
bridgefield in BridgeData specifies which underlying bridge to use hasSourceSwaps/hasDestinationCallenable swap-then-bridge or bridge-then-execute patterns- Requires ERC-20 approval to the LiFi Diamond address
- Finality depends on the underlying bridge selected (varies from 1 minute to 20 minutes)
Its names in a program
On Ethereum,Lifi is a namespace: its contracts need no import.
Deployments
ABI
LiFiDiamondABI
import LiFiDiamondABI from "./protocols/lifi/LiFiDiamondABI.json"; Speaks for: lifiDiamond.
startBridgeTokensViaAcrossV4((bytes32 transactionId, string bridge, string integrator, address referrer, address sendingAssetId, address receiver, uint256 minAmount, uint256 destinationChainId, bool hasSourceSwaps, bool hasDestinationCall) bridgeData, (bytes32 receiverAddress, bytes32 refundAddress, bytes32 sendingAssetId, bytes32 receivingAssetId, uint256 outputAmount, uint128 outputAmountMultiplier, bytes32 exclusiveRelayer, uint32 quoteTimestamp, uint32 fillDeadline, uint32 exclusivityParameter, bytes message) acrossData) payableextractBridgeData(bytes data) pure returns ((bytes32 transactionId, string bridge, string integrator, address referrer, address sendingAssetId, address receiver, uint256 minAmount, uint256 destinationChainId, bool hasSourceSwaps, bool hasDestinationCall) bridgeData)
0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE), whose code does not dispatch them: startBridgeTokensViaAcrossV4. Do not call them there: the call does not run the function, and whether it reverts is up to that code.
Not on Fantom’s lifiDiamond (0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE), whose code does not dispatch them: startBridgeTokensViaAcrossV4. Do not call them there: the call does not run the function, and whether it reverts is up to that code.
Not on Avalanche C-Chain’s lifiDiamond (0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE), whose code does not dispatch them: startBridgeTokensViaAcrossV4. Do not call them there: the call does not run the function, and whether it reverts is up to that code.
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
