Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 0864022</samp> ### Summary 🌐🥞🚀 <!-- 1. 🌐 - This emoji represents the addition of a new blockchain network, which is a major feature for the web app and the packages. 2. 🥞 - This emoji represents the integration with PancakeSwap, which is a popular decentralized exchange on the Linea chain and enables V2 features. 3. 🚀 - This emoji represents the improvement of the cross-chain and cross-protocol swap functionality, which is enabled by the v3 router and the smart router packages. --> This pull request adds support for the Linea chain, a new blockchain network, to the PancakeSwap web app and smart router packages. It defines the Linea chain parameters, contract addresses, tokens, pools, and subgraph URL in various files. It also enables V2 and V3 features for the Linea chain, such as cross-chain and cross-protocol swaps, gas model, and multicall. > _Sing, O Muse, of the valiant developers who dared_ > _To add support for the Linea chain, a new network fair_ > _They updated the web app and the packages with skill and care_ > _And defined the tokens, contracts, and queries with `chains.ts` as their lair_ ### Walkthrough * Add Linea chain support to the web app and the smart router packages ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-5b02b946734e39568c018763a8445fe22e5633c04fa393f78eaec1947165713dR146), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-870705bc610c873933b2d04d9a57db54345cab8d9ad2af707454ac577b21f6e4R29), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-870705bc610c873933b2d04d9a57db54345cab8d9ad2af707454ac577b21f6e4R94-R135), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-870705bc610c873933b2d04d9a57db54345cab8d9ad2af707454ac577b21f6e4R148), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-870705bc610c873933b2d04d9a57db54345cab8d9ad2af707454ac577b21f6e4R160), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ccab19ffbec70686dc2221f7b79432ece4302c36067c91063d258209c09ec07R197), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ccab19ffbec70686dc2221f7b79432ece4302c36067c91063d258209c09ec07R211), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-7238357db46da6bb48ca41841457ac0e832ee21fb8fd76a6b3c9dbf701ce8c62R76), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR16), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR38), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR54), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR70), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR93), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-17218d64565ce12e09953351575126053d6b30541c3605f7ee38a34374a7daecR4), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-17218d64565ce12e09953351575126053d6b30541c3605f7ee38a34374a7daecR36), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-17218d64565ce12e09953351575126053d6b30541c3605f7ee38a34374a7daecR73), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ddce95e802c6a0d90c11aede57b78c496812dc5c4b41ad90624e555af6bde95R15), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ddce95e802c6a0d90c11aede57b78c496812dc5c4b41ad90624e555af6bde95R31), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ddce95e802c6a0d90c11aede57b78c496812dc5c4b41ad90624e555af6bde95R46), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-d8d2e80f999905e1bd9986d3e969db239634d3022e41fc1471625e64ec294a54R48-R51), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-8678467f9c5f232cf1e8d50d56227b3901ce30af399e575a2d1b39ef99eebf8dR219), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-dfa0d43a8db000e0c6466316afa72d83e8ce626238b0960dae8ecdf2de43bfc3R53), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-49573f110ec3a7b2c18b2aec89dcca7184192e3187731aaed499af0da5ae3c08R23), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R17), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R33), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R48), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R63), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R87), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-24d3b14038aadecce9558c47648b19363b226e949e3580a1381f1b4eb5af9bdfR11), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-24d3b14038aadecce9558c47648b19363b226e949e3580a1381f1b4eb5af9bdfR28), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-811cce7aeac21c9b1e6aceba276b6f1c541076dbf4722a255a0c1c7c40b9c3ccR83), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-b61d8bdd98a286c72deb45821a4ec9c7f76e5d799076e05a8f094a0ca72f79c2R21), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-b61d8bdd98a286c72deb45821a4ec9c7f76e5d799076e05a8f094a0ca72f79c2R36), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-f6944a0f19cabcd660c00c460c8db3a84157604fd85ec718e2530b2bf300e952R26), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-9ee18cb7fa7b08aada0e9a3c92dede9202fb872ba10bd8f230843faef707f463R31), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-9ee18cb7fa7b08aada0e9a3c92dede9202fb872ba10bd8f230843faef707f463R48), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R16), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R38), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R56), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R141-R148), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R197), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R226), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-e19e37172da9e6ea69624bbf503812c8bf3999c4bc79c78a9fe7288219c0de7eR1-R7), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-8dce334490b3aef54ec2484deec6ef79b4438828dc1ee3324cfa3b2a5244251bR210), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-8dce334490b3aef54ec2484deec6ef79b4438828dc1ee3324cfa3b2a5244251bR272)) * Define the chain id, name, network, native currency, rpc urls, block explorers, contracts, and testnet flag for the Linea chain in `chains.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-870705bc610c873933b2d04d9a57db54345cab8d9ad2af707454ac577b21f6e4R94-R135), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-870705bc610c873933b2d04d9a57db54345cab8d9ad2af707454ac577b21f6e4R160)) * Add the Linea chain name and query name to the network switcher component and the chain explorer URL in `NetworkSwitcher.tsx` and `chains.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-5b02b946734e39568c018763a8445fe22e5633c04fa393f78eaec1947165713dR146), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-870705bc610c873933b2d04d9a57db54345cab8d9ad2af707454ac577b21f6e4R29)) * Add the Linea rpc urls for the server and public nodes in `nodes.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-17218d64565ce12e09953351575126053d6b30541c3605f7ee38a34374a7daecR4), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-17218d64565ce12e09953351575126053d6b30541c3605f7ee38a34374a7daecR36), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-17218d64565ce12e09953351575126053d6b30541c3605f7ee38a34374a7daecR73)) * Add the Linea addresses for the PancakeSwap V2 factory and router contracts in `contracts.ts` and `exchange.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ccab19ffbec70686dc2221f7b79432ece4302c36067c91063d258209c09ec07R197), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ccab19ffbec70686dc2221f7b79432ece4302c36067c91063d258209c09ec07R211), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R48)) * Add the Linea subgraph URL for the Uniswap V3 pools in `endpoints.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-7238357db46da6bb48ca41841457ac0e832ee21fb8fd76a6b3c9dbf701ce8c62R76)) * Add the Linea chain refresh time, suggested bases, bases to track liquidity, and pairs to track liquidity in `exchange.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR38), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR54), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR70), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6c1ab0c7f31ca2b1900f09bca08f47eb81d6df582ebc368bdcc1000dbf59659fR93)) * Add the Linea revalidation time for the fast, normal, and slow pools in `pools.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ddce95e802c6a0d90c11aede57b78c496812dc5c4b41ad90624e555af6bde95R15), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ddce95e802c6a0d90c11aede57b78c496812dc5c4b41ad90624e555af6bde95R31), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-6ddce95e802c6a0d90c11aede57b78c496812dc5c4b41ad90624e555af6bde95R46)) * Add the Linea default token and pool list in `useInfoUserSavedTokensAndPoolsList.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-d8d2e80f999905e1bd9986d3e969db239634d3022e41fc1471625e64ec294a54R48-R51)) * Add the Linea chain to the combineMaps function in `lists/hooks.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-8678467f9c5f232cf1e8d50d56227b3901ce30af399e575a2d1b39ef99eebf8dR219)) * Add the Linea swap data to the SWAP_INFO_BY_CHAIN object in `fetchDerivedPriceData.ts` ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-dfa0d43a8db000e0c6466316afa72d83e8ce626238b0960dae8ecdf2de43bfc3R53)) * Add the Linea chain name to the CHAIN_ID_TO_CHAIN_NAME object in `common.ts` for the smart router package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-49573f110ec3a7b2c18b2aec89dcca7184192e3187731aaed499af0da5ae3c08R23)) * Add the Linea address for the smart router contract in `exchange.ts` for the smart router package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R33)) * Add the Linea address for the stable swap info contract in `exchange.ts` for the smart router package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R63)) * Add the Linea bases to check trades against in `exchange.ts` for the smart router package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-78ce9cd83b6e1807ee9752c395d004a76077b4df666c24beafa7932c76193b02R87)) * Add the Linea usd gas tokens in `gasModel/index.ts` for the gas model package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-24d3b14038aadecce9558c47648b19363b226e949e3580a1381f1b4eb5af9bdfR28)) * Add the Linea chain to the BATCH_MULTICALL_CONFIGS object in `multicall.ts` for the multicall package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-811cce7aeac21c9b1e6aceba276b6f1c541076dbf4722a255a0c1c7c40b9c3ccR83)) * Add the Linea address for the mixed route quoter contract and the Uniswap V3 quoter contract in `v3.ts` for the v3 router package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-b61d8bdd98a286c72deb45821a4ec9c7f76e5d799076e05a8f094a0ca72f79c2R21), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-b61d8bdd98a286c72deb45821a4ec9c7f76e5d799076e05a8f094a0ca72f79c2R36)) * Add the Linea address for the PancakeSwap multicall contract in `multicallSwapProvider.ts` for the multicall swap provider package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-f6944a0f19cabcd660c00c460c8db3a84157604fd85ec718e2530b2bf300e952R26)) * Add the Linea success rate config and block conflict tolerance in `onChainQuoteProvider.ts` for the on chain quote provider package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-9ee18cb7fa7b08aada0e9a3c92dede9202fb872ba10bd8f230843faef707f463R31), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-9ee18cb7fa7b08aada0e9a3c92dede9202fb872ba10bd8f230843faef707f463R48)) * Add the Linea chain id, factory address, init code hash, wrapped ether token, wrapped native token, and native token in `constants.ts` for the swap sdk package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R16), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R38), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R56), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R141-R148), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R197), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-47643406d29b8598e2ec7264a59eca0794e0b4f77eded976f680d8dc5c145595R226)) * Add the Linea tokens in `59144.ts` and `common.ts` for the tokens package ([link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-e19e37172da9e6ea69624bbf503812c8bf3999c4bc79c78a9fe7288219c0de7eR1-R7), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-8dce334490b3aef54ec2484deec6ef79b4438828dc1ee3324cfa3b2a5244251bR210), [link](https://github.com/pancakeswap/pancake-frontend/pull/7547/files?diff=unified&w=0#diff-8dce334490b3aef54ec2484deec6ef79b4438828dc1ee3324cfa3b2a5244251bR272)) --------- Co-authored-by: chefjackson <[email protected]>
- Loading branch information