> ## Documentation Index
> Fetch the complete documentation index at: https://docs.li.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# 智能合约地址

export const ContractAddresses = () => {
  const [chains, setChains] = useState(null);
  const [error, setError] = useState(null);
  useEffect(() => {
    const fetchChains = async () => {
      try {
        const response = await fetch('https://li.quest/v1/chains?chainTypes=EVM');
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
        const jsonData = await response.json();
        setChains(jsonData.chains);
      } catch (err) {
        setError(err.message);
      }
    };
    fetchChains();
  }, []);
  const renderChains = chains => <table className="p-3">
      <thead>
        <tr>
          <th></th>
          <th className="text-left"><strong>Chain Name</strong></th>
          <th className="text-left"><strong>Chain ID</strong></th>
          <th><strong>Diamond Address</strong></th>
        </tr>
      </thead>
      <tbody>
        {chains.filter(chain => chain.diamondAddress).sort((a, b) => a.id - b.id).map(chain => <tr key={chain.key}>
            <td>
              <img src={chain.logoURI} alt={chain.name} className="w-3 h-3 rounded-full not-prose" />
            </td>
            <td><strong>{chain.name}</strong></td>
            <td><code>{chain.id}</code></td>
            <td><code>{chain.diamondAddress}</code></td>
          </tr>)}
      </tbody>
    </table>;
  if (error) return <div>Error: {error}</div>; else if (chains) return renderChains(chains); else return <div>Loading...</div>;
};

<Note>
  LI.FI Diamond 入口合约地址在大多数支持的网络上是 `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE`。请注意，在某些网络上地址有所不同。您可以在 [Github](https://github.com/lifinance/lifi-contract-types/blob/main/dist/diamond.json) 上找到 ABI。
</Note>

<ContractAddresses />

有关每个切面合约的更多信息和开源代码，请访问我们的 [GitHub](https://github.com/lifinance/contracts/blob/main/docs/README.md)。

每个切面的合约地址和部署信息可以在我们的 [GitHub 仓库](https://github.com/lifinance/contracts/tree/main/deployments)中找到。
