The LI.FI Diamond entryway contract is 0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE on most supported networks. Please note, on some networks the address is different. You can find the ABI on Github.

Architecture

The LI.FI Contract is built using the EIP-2535 (Multi-facet Proxy) standard. The contract logic lives behind a single contract that in turn uses DELEGATECALL to call facet contracts that contain the business logic.

All business logic is built using facet contracts that live in src/Facets.

For more information on EIP-2535 you can view the entire EIP here.

Contract Flow

A basic example would be a user bridging from one chain to another using Stargate Protocol. The user would interact with the LI.FIDiamond contract which would pass the Stargate-specific call to the StargateV2Facet which then passes required calls + parameters to Stargate’s contracts.

The basic flow is illustrated below.

Diamond Helper Contracts

The LI.FI Diamond contract is deployed along with some helper contracts that facilitate things like upgrading facet contracts, look-ups for methods on facet contracts, ownership checking and withdrawals of funds. For specific details please check out EIP-2535.