From b62c7a541136657f81fb590229911f9f426670b4 Mon Sep 17 00:00:00 2001 From: icodezjb <8869892+icodezjb@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:42:15 +0800 Subject: [PATCH] Add Celer bridge (#18) * Improve stargate and wormhole * Add celer bridge * Add celer swap test(goerli -> avax-test) * Refactor LibSoFeeCelerV1 to support oracle * Fix estCelerMessageFeeAndExecutorFee * Format codes * Format codes * Add trace info in CelerFacet.sol * Impl executeMessageWithTransferRefund to refund the token to the user * Add comments * Refactor estCelerMessageFeeAndExecutorFee * Split celer scripts * Revert swap.py * Fix RefundCelerToken event * Add test files * Add celer mainnet chain path * Fix CelerFacet.sol * Prepare mainnet config * Add comments * Check celer mainnet oracles * Format codes * Add set_celer_bnb_price_on_avax * Remove unused config * Revert "Improve stargate and wormhole" This reverts commit 1b6459833ca93d977920c2ebda4bbec0b87ddbf8. * Add setExecutorFeeTo * Update config and abi of celer * Update config file * Redeploy celer faucet for test --------- Co-authored-by: icodezjb Co-authored-by: AAweidai --- ethereum/brownie-config.yaml | 347 +- ethereum/contracts/Facets/CelerFacet.sol | 827 ++++ .../Helpers/CelerMessageReceiver.sol | 84 + .../contracts/Interfaces/ICelerBridge.sol | 74 + .../contracts/Interfaces/ICelerMessageBus.sol | 133 + .../Interfaces/ICelerMessageReceiver.sol | 89 + ethereum/contracts/Interfaces/ILibPriceV2.sol | 13 + .../Libraries/LibCelerMessageSender.sol | 102 + .../Libraries/LibCelerMsgDataTypes.sol | 93 + .../contracts/Libraries/LibSoFeeCelerV1.sol | 178 + ethereum/export/ContractDeployed.json | 183 +- ethereum/export/OmniSwapInfo.json | 3996 +---------------- ethereum/export/StargateInfo.json | 267 +- ethereum/export/abi/ICelerBridge.json | 314 ++ ethereum/export/abi/SoDiamond.json | 1429 ++++++ ethereum/export/mainnet/CelerChainPath.json | 602 +++ ethereum/export/mainnet/ContractDeployed.json | 143 +- .../export/mainnet/TmpCelerBridgeToken.json | 86 + ethereum/requirements.txt | 2 +- ethereum/scripts/celer.py | 1003 +++++ ethereum/scripts/celer_tx_status.py | 107 + ethereum/scripts/deploy.py | 13 +- ethereum/scripts/export.py | 246 +- ethereum/scripts/export_celer.py | 400 ++ ethereum/scripts/helpful_scripts.py | 55 +- ethereum/scripts/initialize.py | 119 +- ethereum/scripts/publish.py | 1 + ethereum/scripts/relayer/oracle_evm.py | 16 + ethereum/scripts/uniswap.py | 43 +- 29 files changed, 6602 insertions(+), 4363 deletions(-) create mode 100644 ethereum/contracts/Facets/CelerFacet.sol create mode 100644 ethereum/contracts/Helpers/CelerMessageReceiver.sol create mode 100644 ethereum/contracts/Interfaces/ICelerBridge.sol create mode 100644 ethereum/contracts/Interfaces/ICelerMessageBus.sol create mode 100644 ethereum/contracts/Interfaces/ICelerMessageReceiver.sol create mode 100644 ethereum/contracts/Interfaces/ILibPriceV2.sol create mode 100644 ethereum/contracts/Libraries/LibCelerMessageSender.sol create mode 100644 ethereum/contracts/Libraries/LibCelerMsgDataTypes.sol create mode 100644 ethereum/contracts/Libraries/LibSoFeeCelerV1.sol create mode 100644 ethereum/export/abi/ICelerBridge.json create mode 100644 ethereum/export/mainnet/CelerChainPath.json create mode 100644 ethereum/export/mainnet/TmpCelerBridgeToken.json create mode 100644 ethereum/scripts/celer.py create mode 100644 ethereum/scripts/celer_tx_status.py create mode 100644 ethereum/scripts/export_celer.py diff --git a/ethereum/brownie-config.yaml b/ethereum/brownie-config.yaml index 943174cd..0bdb9b9e 100644 --- a/ethereum/brownie-config.yaml +++ b/ethereum/brownie-config.yaml @@ -89,8 +89,10 @@ networks: goerli: omnibtc_chainid: 30002 chainid: 5 - SoDiamond: "0x12479EEF3EF33687f6b79d59aC6E387C7bc75A3F" + SoDiamond: "0x43bBc3Be3FD1a26F62CA319E2eDEB5aB40d0e1D8" stargate: +# https://stargateprotocol.gitbook.io/stargate/developers/contract-addresses/testnet + router: "0x7612aE2a34E5A363E137De748801FB4c86499152" # Will be deployed soon chainid: 10121 poolid: @@ -122,6 +124,7 @@ networks: oracle: eth: chainid: 2 + celer_chainid: 5 currency: USD address: "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e" token: @@ -162,6 +165,24 @@ networks: # wormhole aptos wrapped coin. todo! need to fix address: "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78" decimal: 8 + bridges: + celer: + chainid: 5 + message_bus: "0xF25170F86E4291a99a9A560032Fe9948b8BcFBB2" + token: + usdc: + address: "0xCbE56b00d173A26a5978cE90Db2E33622fD95A28" + decimal: 6 + weth: + address: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6" + decimal: 18 + gas: + base_gas: 700000 + dst_chainid: + - 5 # goerli + - 43113 # avax-test + oracle: + # manual set avax/eth ratio swap: ISwapRouter: name: UniswapV3 @@ -271,7 +292,7 @@ networks: avax-test: omnibtc_chainid: 30004 chainid: 43113 - SoDiamond: "0xBb032459B39547908eDB8E690c030Dc4F31DA673" + SoDiamond: "0xE68508c61c4f979B828cd1c8383676d93583Cae5" wormhole: chainid: 6 token_bridge: "0x61E44E506Ca5659E6c0bba9b678586fA2d729756" @@ -298,17 +319,50 @@ networks: oracle: avax: chainid: 6 + celer_chainid: 43113 currency: USD address: "0x5498BB86BC934c8D34FDA08E81D444153d0D06aD" matic: chainid: 5 + celer_chainid: 80001 currency: USD address: "0xB0924e98CAFC880ed81F6A4cA63FD61006D1f8A0" + eth: + celer_chainid: 5 + currency: USD + address: "0x86d67c3D38D2bCeE722E601025C25a575021c6EA" stargate: router: "0x13093E05Eb890dfA6DacecBdE51d24DabAb2Faa1" chainid: 10106 poolid: usdc: 1 + bridges: + celer: + chainid: 43113 + message_bus: "0xE9533976C590200E32d95C53f06AE12d292cFc47" + token: + usdc: + address: "0x2979a1cb90EEB9e75d7fB4f9813FCC40E4a7fD8b" + decimal: 6 + weth: + # Different from DexLot's weth + # Just for celer test + address: "0xd00ae08403B9bbb9124bB305C09058E32C39A48c" + decimal: 18 + gas: + base_gas: 700000 + dst_chainid: + - 5 # goerli + - 43113 # avax-test + oracle: + avax: + chainid: 43113 + pair: AVAXUSD + address: "0x5498BB86BC934c8D34FDA08E81D444153d0D06aD" + eth: + chainid: 5 + pair: ETHUSD + address: "0x86d67c3D38D2bCeE722E601025C25a575021c6EA" token: usdc: address: "0x4A0D1092E9df255cf95D72834Ea9255132782318" @@ -592,6 +646,54 @@ networks: # dst_chainid: 10 # base_gas: 700000 # per_byte_gas: 68 + bridges: + celer: + chainid: 1 + message_bus: "0x4066d196a423b2b3b8b054f4f40efb47a74e200c" + token: + usdc: + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" + decimal: 6 + usdt: + address: "0xdAC17F958D2ee523a2206206994597C13D831ec7" + decimal: 6 + weth: + address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" + decimal: 18 + gas: + base_gas: 700000 + dst_chainid: + - 1 # mainnet + - 10 # optimism-main + - 56 # bsc-main + - 137 # polygon-main + - 42161 # arbitrum-main + - 43114 # avax-main + oracle: + eth: + chainid: 1 + pair: ETHUSD + address: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419" + optimism: + chainid: 10 + pair: ETHUSD + address: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419" + arbitrum: + chainid: 42161 + pair: ETHUSD + address: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419" + avax: + chainid: 43114 + pair: AVAXUSD + address: "0xFF3EEb22B5E3dE6e705b44749C2559d704923FD7" + bsc: + chainid: 56 + pair: BNBUSD + address: "0x14e613AC84a31f709eadbdF89C6CC390fDc9540A" + polygon: + chainid: 137 + pair: MATICUSD + address: "0x7bAC85A8a13A4BcD8abb3eB7d6b4d632c5a57676" oracle: eth: chainid: 2 @@ -676,6 +778,54 @@ networks: # dst_chainid: 10 # base_gas: 700000 # per_byte_gas: 68 + bridges: + celer: + chainid: 56 + message_bus: "0x95714818fdd7a5454f73da9c777b3ee6ebaeea6b" + token: + usdc: + address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d" + decimal: 18 + usdt: + address: "0x55d398326f99059fF775485246999027B3197955" + decimal: 18 + weth: + address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8" + decimal: 18 + gas: + base_gas: 700000 + dst_chainid: + - 1 # mainnet + - 10 # optimism-main + - 56 # bsc-main + - 137 # polygon-main + - 42161 # arbitrum-main + - 43114 # avax-main + oracle: + eth: + chainid: 1 + pair: ETHUSD + address: "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e" + optimism: + chainid: 10 + pair: ETHUSD + address: "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e" + arbitrum: + chainid: 42161 + pair: ETHUSD + address: "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e" + avax: + chainid: 43114 + pair: AVAXUSD + address: "0x5974855ce31EE8E1fff2e76591CbF83D7110F151" + bsc: + chainid: 56 + pair: BNBUSD + address: "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE" + polygon: + chainid: 137 + pair: MATICUSD + address: "0x7CA57b0cA6367191c94C8914d7Df09A57655905f" oracle: eth: chainid: 2 @@ -752,6 +902,53 @@ networks: # dst_chainid: 10 # base_gas: 700000 # per_byte_gas: 68 + bridges: + celer: + chainid: 43114 + message_bus: "0x5a926eeeafc4d217add17e9641e8ce23cd01ad57" + token: + usdc: + address: "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664" + decimal: 6 + usdt: + address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118" + decimal: 6 + weth: + address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB" + decimal: 18 + gas: + base_gas: 700000 + dst_chainid: + - 1 # mainnet + - 10 # optimism-main + - 56 # bsc-main + - 137 # polygon-main + - 42161 # arbitrum-main + - 43114 # avax-main + oracle: + eth: + chainid: 1 + pair: ETHUSD + address: "0x976B3D034E162d8bD72D6b9C989d545b839003b0" + optimism: + chainid: 10 + pair: ETHUSD + address: "0x976B3D034E162d8bD72D6b9C989d545b839003b0" + arbitrum: + chainid: 42161 + pair: ETHUSD + address: "0x976B3D034E162d8bD72D6b9C989d545b839003b0" + avax: + chainid: 43114 + pair: AVAXUSD + address: "0x0A77230d17318075983913bC2145DB16C7366156" + + # BNBUSD by manual + + polygon: + chainid: 137 + pair: MATICUSD + address: "0x1db18D41E4AD2403d9f52b5624031a2D9932Fd73" oracle: eth: chainid: 2 @@ -825,6 +1022,54 @@ networks: # dst_chainid: 10 # base_gas: 700000 # per_byte_gas: 68 + bridges: + celer: + chainid: 137 + message_bus: "0xaFDb9C40C7144022811F034EE07Ce2E110093fe6" + token: + usdc: + address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" + decimal: 6 + usdt: + address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F" + decimal: 6 + weth: + address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619" + decimal: 18 + gas: + base_gas: 700000 + dst_chainid: + - 1 # mainnet + - 10 # optimism-main + - 56 # bsc-main + - 137 # polygon-main + - 42161 # arbitrum-main + - 43114 # avax-main + oracle: + eth: + chainid: 1 + pair: ETHUSD + address: "0xF9680D99D6C9589e2a93a78A04A279e509205945" + optimism: + chainid: 10 + pair: ETHUSD + address: "0xF9680D99D6C9589e2a93a78A04A279e509205945" + arbitrum: + chainid: 42161 + pair: ETHUSD + address: "0xF9680D99D6C9589e2a93a78A04A279e509205945" + avax: + chainid: 43114 + pair: AVAXUSD + address: "0xe01eA2fbd8D76ee323FbEd03eB9a8625EC981A10" + bsc: + chainid: 56 + pair: BNBUSD + address: "0x82a6c4AF830caa6c97bb504425f6A66165C2c26e" + polygon: + chainid: 137 + pair: MATICUSD + address: "0xAB594600376Ec9fD91F8e885dADF0CE036862dE0" oracle: eth: chainid: 2 @@ -881,6 +1126,56 @@ networks: poolid: usdc: 1 weth: 13 + bridges: + celer: + chainid: 42161 + message_bus: "0x3ad9d0648cdaa2426331e894e980d0a5ed16257f" + token: + usdc: + address: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8" + decimal: 6 + usdt: + address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9" + decimal: 6 + weth: + address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" + decimal: 18 + actual_reserve: 1.1 + estimate_reserve: 1.2 + gas: + base_gas: 700000 + dst_chainid: + - 1 # mainnet + - 10 # optimism-main + - 56 # bsc-main + - 137 # polygon-main + - 42161 # arbitrum-main + - 43114 # avax-main + oracle: + eth: + chainid: 1 + pair: ETHUSD + address: "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612" + optimism: + chainid: 10 + pair: ETHUSD + address: "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612" + arbitrum: + chainid: 42161 + pair: ETHUSD + address: "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612" + avax: + chainid: 43114 + pair: AVAXUSD + address: "0x8bf61728eeDCE2F32c456454d87B5d6eD6150208" + bsc: + chainid: 56 + pair: BNBUSD + address: "0x6970460aabF80C5BE983C6b74e5D06dEDCA95D4A" + polygon: + chainid: 137 + pair: MATICUSD + address: "0x52099D4523531f678Dfc568a7B1e5038aadcE1d6" token: usdt: address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9" @@ -910,6 +1205,54 @@ networks: poolid: usdc: 1 weth: 13 + bridges: + celer: + chainid: 10 + message_bus: "0x0D71D18126E03646eb09FEc929e2ae87b7CAE69d" + token: + usdc: + address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607" + decimal: 6 + usdt: + address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58" + decimal: 6 + weth: + address: "0x4200000000000000000000000000000000000006" + decimal: 18 + gas: + base_gas: 700000 + dst_chainid: + - 1 # mainnet + - 10 # optimism-main + - 56 # bsc-main + - 137 # polygon-main + - 42161 # arbitrum-main + - 43114 # avax-main + oracle: + eth: + chainid: 1 + pair: ETHUSD + address: "0x13e3Ee699D1909E989722E753853AE30b17e08c5" + optimism: + chainid: 10 + pair: ETHUSD + address: "0x13e3Ee699D1909E989722E753853AE30b17e08c5" + arbitrum: + chainid: 42161 + pair: ETHUSD + address: "0x13e3Ee699D1909E989722E753853AE30b17e08c5" + avax: + chainid: 43114 + pair: AVAXUSD + address: "0x5087Dc69Fd3907a016BD42B38022F7f024140727" + bsc: + chainid: 56 + pair: BNBUSD + address: "0xD38579f7cBD14c22cF1997575eA8eF7bfe62ca2c" + polygon: + chainid: 137 + pair: MATICUSD + address: "0x0ded608AFc23724f614B76955bbd9dFe7dDdc828" token: weth: address: "0x4200000000000000000000000000000000000006" diff --git a/ethereum/contracts/Facets/CelerFacet.sol b/ethereum/contracts/Facets/CelerFacet.sol new file mode 100644 index 00000000..bea43930 --- /dev/null +++ b/ethereum/contracts/Facets/CelerFacet.sol @@ -0,0 +1,827 @@ +// SPDX-License-Identifier: GPLv3 +pragma solidity 0.8.13; + +import "@openzeppelin/contracts/utils/math/SafeMath.sol"; +import "../Errors/GenericErrors.sol"; +import "../Libraries/LibDiamond.sol"; +import "../Libraries/LibBytes.sol"; +import "../Libraries/LibCross.sol"; +import "../Libraries/LibCelerMessageSender.sol"; +import "../Interfaces/ISo.sol"; +import "../Interfaces/ICelerMessageBus.sol"; +import "../Interfaces/ICelerBridge.sol"; +import "../Interfaces/ILibSoFee.sol"; +import "../Interfaces/ILibPriceV2.sol"; +import "../Helpers/Swapper.sol"; +import "../Helpers/ReentrancyGuard.sol"; +import "../Helpers/CelerMessageReceiver.sol"; + +/// @title Celer Facet +/// @author OmniBTC +/// @notice Provides functionality for bridging through Celer +contract CelerFacet is Swapper, ReentrancyGuard, CelerMessageReceiver { + using SafeMath for uint256; + using LibBytes for bytes; + + /// Storage /// + + bytes32 internal constant NAMESPACE = + hex"5a7c277686f4a9ab3396ccbfbeac4866fb97785944f0661a3f0935d16bc9848b"; // keccak256("com.so.facets.celer") + + uint256 public constant RAY = 1e27; + uint256 public constant GasPerByte = 68; + + struct Storage { + address messageBus; // The Celer MessageBus address + address executorFeeTo; // The receiver of the executor fee. + uint64 nextNonce; // The next nonce for celer bridge + uint64 srcCelerChainId; // The Celer chain id of the source/current chain + uint256 actualReserve; // [RAY] + uint256 estimateReserve; // [RAY] + mapping(uint64 => uint256) dstBaseGas; // For estimate destination chain execute gas + mapping(address => bool) allowedList; // Permission to allow calls to executeMessageWithTransfer + } + + /// Types /// + + struct CelerData { + address sender; + uint32 maxSlippage; // The max slippage accepted + uint64 dstCelerChainId; // The celer chain id of the destination chain + address bridgeToken; // The bridge token address + uint256 dstMaxGasPriceInWeiForExecutor; // The gas price on destination chain + uint256 estimateCost; // The msg.value = message fee(for SGN) + executor fee(for executor) + native_gas(optional) + address payable dstSoDiamond; // The destination SoDiamond address + } + + struct CacheSrcSoSwap { + bool flag; + uint256 srcMessageFee; + uint256 srcExecutorFee; + uint256 srcMaybeInput; + uint256 dstMaxGasForExecutor; + uint256 bridgeAmount; + bytes payload; + } + + struct CacheCheck { + bool flag; + uint256 srcExecutorFee; + uint256 userInput; + uint256 dstMaxGasForExecutor; + uint256 srsMessageFee; + uint256 consumeValue; + } + + struct CacheEstimate { + ILibPriceV2 oracle; + uint256 ratio; + bytes message; + uint256 srcMessageFee; + uint256 dstExecutorGas; + uint256 dstExecutorFee; + uint256 srcExecutorFee; + uint256 reserve; + } + + struct CachePayload { + address sender; + ISo.NormalizedSoData soDataNo; + LibSwap.NormalizedSwapData[] swapDataDstNo; + } + + /// Events /// + + event CelerInitialized(address indexed messageBus, uint256 chainId); + event SetMessageBus(address indexed messageBus); + event SetAllowedList(address indexed messageBus, bool isAllowed); + event UpdateCelerReserve(uint256 actualReserve, uint256 estimateReserve); + event TransferFromCeler( + bytes32 indexed celerTransferId, + uint64 srcCelerChainId, + uint64 dstCelerChainId, + address bridgeToken, + uint256 bridgeAmount, + uint64 nonce + ); + event RefundCelerToken( + address indexed token, + address sender, + uint256 amount, + bytes32 srcTxId + ); + + /// Init /// + + /// @notice Initializes local variables for the Celer MessgeBus + /// @param messageBus: address of the Celer messageBus contract + /// @param chainId: chainId of this deployed contract + function initCeler(address messageBus, uint64 chainId) external { + LibDiamond.enforceIsContractOwner(); + if (messageBus == address(0)) revert InvalidConfig(); + + Storage storage s = getStorage(); + + s.nextNonce = 1; + s.messageBus = messageBus; + s.executorFeeTo = LibDiamond.contractOwner(); + s.srcCelerChainId = chainId; + s.actualReserve = (RAY).mul(11).div(10); // 110% + s.estimateReserve = (RAY).mul(12).div(10); // 120% + s.allowedList[messageBus] = true; + s.allowedList[msg.sender] = true; + + emit CelerInitialized(messageBus, chainId); + } + + /// @dev Set permissions to control calls to executeMessageWithTransfer + function setAllowedAddress(address messageBus, bool isAllowed) external { + LibDiamond.enforceIsContractOwner(); + + Storage storage s = getStorage(); + s.allowedList[messageBus] = isAllowed; + + emit SetAllowedList(messageBus, isAllowed); + } + + /// @dev Set new nonce + /// Avoid celer revert "transfer exists" after redeploy this contract + function setNonce(uint64 nonce) external + { + LibDiamond.enforceIsContractOwner(); + + Storage storage s = getStorage(); + s.nextNonce = nonce; + } + + /// @dev Set new receiver of the executor fee + function setExecutorFeeTo(address feeTo) external + { + LibDiamond.enforceIsContractOwner(); + + Storage storage s = getStorage(); + s.executorFeeTo = feeTo; + } + + /// @dev Sets the scale to be used when calculating executor fees + /// @param actualReserve percentage of actual use of executor fees, expressed as RAY + /// @param estimateReserve estimated percentage of use at the time of call, expressed as RAY + function setCelerReserve(uint256 actualReserve, uint256 estimateReserve) external + { + LibDiamond.enforceIsContractOwner(); + Storage storage s = getStorage(); + + s.actualReserve = actualReserve; + s.estimateReserve = estimateReserve; + + emit UpdateCelerReserve(actualReserve, estimateReserve); + } + + /// @dev Set the minimum gas to be spent on the destination chain + /// @param dstChainIds a batch of destination chain id + /// @param dstBaseGas base gas for destination chain + function setBaseGas( + uint64[] calldata dstChainIds, + uint256 dstBaseGas + ) external { + LibDiamond.enforceIsContractOwner(); + Storage storage s = getStorage(); + + for (uint64 i; i < dstChainIds.length; i++ ) { + s.dstBaseGas[dstChainIds[i]] = dstBaseGas; + } + } + + /// External Methods /// + + /// @notice Bridges tokens via Celer (support chainid [1,65535]) + /// @param soDataNo Data for tracking cross-chain transactions and a + /// portion of the accompanying cross-chain messages + /// @param swapDataSrcNo Contains a set of data required for Swap + /// transactions on the source chain side + /// @param celerData Data used to call Celer Message Bus for swap + /// @param swapDataDstNo Contains a set of Swap transaction data executed + /// on the destination chain. + /// Call on source chain by user + function soSwapViaCeler( + ISo.NormalizedSoData calldata soDataNo, + LibSwap.NormalizedSwapData[] calldata swapDataSrcNo, + CelerData calldata celerData, + LibSwap.NormalizedSwapData[] calldata swapDataDstNo + ) external payable nonReentrant { + require(msg.value == celerData.estimateCost, "FeeErr"); + + CacheSrcSoSwap memory cache; + + // decode soDataNo and swapDataSrcNo + ISo.SoData memory soData = LibCross.denormalizeSoData(soDataNo); + LibSwap.SwapData[] memory swapDataSrc = LibCross.denormalizeSwapData( + swapDataSrcNo + ); + + ( + cache.flag, + cache.srcExecutorFee, + cache.dstMaxGasForExecutor, + cache.srcMaybeInput + ) = checkExecutorFee(soDataNo, celerData, swapDataDstNo); + + require(cache.flag, "CheckFail"); + + if (cache.srcExecutorFee > 0) { + LibAsset.transferAsset( + LibAsset.NATIVE_ASSETID, + payable(getExecutorFeeTo()), + cache.srcExecutorFee + ); + } + + // deposit erc20 tokens to this contract + if (!LibAsset.isNativeAsset(soData.sendingAssetId)) { + LibAsset.depositAsset(soData.sendingAssetId, soData.amount); + } + + // calculate bridgeAmount + if (swapDataSrc.length == 0) { + // direct bridge + cache.bridgeAmount = soData.amount; + transferWrappedAsset( + soData.sendingAssetId, + celerData.bridgeToken, + cache.bridgeAmount + ); + } else { + // bridge after swap + require(soData.amount == swapDataSrc[0].fromAmount, "AmountErr"); + try this.executeAndCheckSwaps(soData, swapDataSrc) returns ( + uint256 bridgeAmount + ) { + cache.bridgeAmount = bridgeAmount; + transferWrappedAsset( + swapDataSrc[swapDataSrc.length - 1].receivingAssetId, + celerData.bridgeToken, + cache.bridgeAmount + ); + } catch (bytes memory lowLevelData) { + // Rethrowing exception + assembly { + let start := add(lowLevelData, 0x20) + let end := add(lowLevelData, mload(lowLevelData)) + revert(start, end) + } + } + } + + cache.payload = encodeCelerPayload( + celerData.sender, + soDataNo, + swapDataDstNo + ); + + cache.srcMessageFee = getCelerMessageFee2(cache.payload); + + startBridge( + celerData, + cache.srcMessageFee, + cache.bridgeAmount, + cache.payload + ); + + uint256 returnValue = msg.value + .sub(cache.srcMessageFee) + .sub(cache.srcExecutorFee) + .sub(cache.srcMaybeInput); + + // return the redundant msg.value + if (returnValue > 0) { + LibAsset.transferAsset( + LibAsset.NATIVE_ASSETID, + payable(msg.sender), + returnValue + ); + } + + emit SoTransferStarted(soData.transactionId); + } + + /// @notice Called by Celer MessageBus to execute a message with an associated token transfer. + /// Call on destination chain by executor + function executeMessageWithTransfer( + address, //sender, + address token, + uint256 amount, + uint64, // srcChainId + bytes calldata message, + address // executor + ) external payable override returns (ExecutionStatus) { + Storage storage s = getStorage(); + require(s.allowedList[msg.sender], "No permission"); + + if (LibAsset.getOwnBalance(token) < amount) { + // judge eth + require(token == this.getNativeWrap(s.messageBus), "TokenErr"); + require( + LibAsset.getOwnBalance(LibAsset.NATIVE_ASSETID) >= amount, + "NotEnough" + ); + + token = LibAsset.NATIVE_ASSETID; + } + + ( + , + ISo.NormalizedSoData memory soDataNo, + LibSwap.NormalizedSwapData[] memory swapDataDstNo + ) = decodeCelerPayload(message); + + ISo.SoData memory soData = LibCross.denormalizeSoData(soDataNo); + LibSwap.SwapData[] memory swapDataDst = LibCross.denormalizeSwapData( + swapDataDstNo + ); + + remoteSoSwap(token, amount, soData, swapDataDst); + + return ExecutionStatus.Success; + } + + /// @notice Called by MessageBus to process refund of the original transfer from this contract. + /// The contract is guaranteed to have received the refund before this function is called. + /// Call on source chain by executor + function executeMessageWithTransferRefund( + address token, + uint256 amount, + bytes calldata message, + address // executor + ) external payable override returns (ExecutionStatus) { + Storage storage s = getStorage(); + require(s.allowedList[msg.sender], "No permission"); + + ( + address sender, + ISo.NormalizedSoData memory soDataNo, + ) = decodeCelerPayload(message); + + ISo.SoData memory soData = LibCross.denormalizeSoData(soDataNo); + + if (sender != address(0)) { + LibAsset.transferAsset( + token, + payable(sender), + amount + ); + } + + emit RefundCelerToken( + token, + sender, + amount, + soData.transactionId + ); + + return ExecutionStatus.Success; + } + /// Public Methods /// + + /// @dev Check if enough value is passed in for payment + function checkExecutorFee( + ISo.NormalizedSoData calldata soData, + CelerData calldata celerData, + LibSwap.NormalizedSwapData[] calldata swapDataDst + ) public returns (bool, uint256, uint256, uint256) + { + CacheCheck memory data; + Storage storage s = getStorage(); + + require(appStorage.gatewaySoFeeSelectors[s.messageBus] != address(0), "SoFeeEmpty"); + ILibPriceV2 oracle = ILibPriceV2(appStorage.gatewaySoFeeSelectors[s.messageBus]); + + oracle.updatePriceRatio(celerData.dstCelerChainId); + + ( + data.srsMessageFee, + data.dstMaxGasForExecutor, + data.srcExecutorFee + ) = estCelerMessageFeeAndExecutorFee( + celerData.dstCelerChainId, + celerData.dstMaxGasPriceInWeiForExecutor, + soData, + swapDataDst, + true + ); + + if (LibAsset.isNativeAsset(soData.sendingAssetId.toAddress(0))) { + data.userInput = soData.amount; + } + + data.consumeValue = data.srsMessageFee.add(data.srcExecutorFee).add(data.userInput); + + if (data.consumeValue <= celerData.estimateCost) { + data.flag = true; + } + + return (data.flag, data.srcExecutorFee, data.dstMaxGasForExecutor, data.userInput); + } + + /// CrossData + // 1. length + sender + // 2. length + transactionId(SoData) + // 3. length + receiver(SoData) + // 4. length + receivingAssetId(SoData) + // 5. length + swapDataLength(u8) + // 6. length + callTo(SwapData) + // 7. length + sendingAssetId(SwapData) + // 8. length + receivingAssetId(SwapData) + // 9. length + callData(SwapData) + function encodeCelerPayload( + address sender, + ISo.NormalizedSoData memory soDataNo, + LibSwap.NormalizedSwapData[] memory swapDataDstNo + ) public pure returns (bytes memory) { + bytes memory senderByte = abi.encodePacked(sender); + + bytes memory encodeData = abi.encodePacked( + uint8(senderByte.length), + senderByte, + uint8(soDataNo.transactionId.length), + soDataNo.transactionId, + uint8(soDataNo.receiver.length), + soDataNo.receiver, + uint8(soDataNo.receivingAssetId.length), + soDataNo.receivingAssetId + ); + + if (swapDataDstNo.length > 0) { + bytes memory swapLenBytes = LibCross.serializeU256WithHexStr( + swapDataDstNo.length + ); + encodeData = encodeData.concat( + abi.encodePacked(uint8(swapLenBytes.length), swapLenBytes) + ); + } + + for (uint256 i = 0; i < swapDataDstNo.length; i++) { + encodeData = encodeData.concat( + abi.encodePacked( + uint8(swapDataDstNo[i].callTo.length), + swapDataDstNo[i].callTo, + uint8(swapDataDstNo[i].sendingAssetId.length), + swapDataDstNo[i].sendingAssetId, + uint8(swapDataDstNo[i].receivingAssetId.length), + swapDataDstNo[i].receivingAssetId, + uint16(swapDataDstNo[i].callData.length), + swapDataDstNo[i].callData + ) + ); + } + return encodeData; + } + + /// CrossData + // 1. length + sender + // 2. length + transactionId(SoData) + // 3. length + receiver(SoData) + // 4. length + receivingAssetId(SoData) + // 5. length + swapDataLength(u8) + // 6. length + callTo(SwapData) + // 7. length + sendingAssetId(SwapData) + // 8. length + receivingAssetId(SwapData) + // 9. length + callData(SwapData) + function decodeCelerPayload( + bytes memory celerPayload + ) public pure returns ( + address, + ISo.NormalizedSoData memory soDataNo, + LibSwap.NormalizedSwapData[] memory swapDataDstNo + ) + { + CachePayload memory data; + uint256 index; + uint256 nextLen; + + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + data.sender = LibCross.tryAddress( + celerPayload.slice(index, nextLen) + ); + index += nextLen; + + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + data.soDataNo.transactionId = celerPayload.slice(index, nextLen); + index += nextLen; + + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + data.soDataNo.receiver = celerPayload.slice(index, nextLen); + index += nextLen; + + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + data.soDataNo.receivingAssetId = celerPayload.slice(index, nextLen); + index += nextLen; + + if (index < celerPayload.length) { + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + uint256 swap_len = LibCross.deserializeU256WithHexStr( + celerPayload.slice(index, nextLen) + ); + index += nextLen; + + data.swapDataDstNo = new LibSwap.NormalizedSwapData[](swap_len); + for (uint256 i = 0; i < swap_len; i++) { + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + data.swapDataDstNo[i].callTo = celerPayload.slice( + index, + nextLen + ); + data.swapDataDstNo[i].approveTo = data.swapDataDstNo[i].callTo; + index += nextLen; + + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + data.swapDataDstNo[i].sendingAssetId = celerPayload.slice( + index, + nextLen + ); + index += nextLen; + + nextLen = uint256(celerPayload.toUint8(index)); + index += 1; + data.swapDataDstNo[i].receivingAssetId = celerPayload.slice( + index, + nextLen + ); + index += nextLen; + + nextLen = uint256(celerPayload.toUint16(index)); + index += 2; + data.swapDataDstNo[i].callData = celerPayload.slice( + index, + nextLen + ); + index += nextLen; + } + } + require(index == celerPayload.length, "LenErr"); + + return ( + data.sender, + data.soDataNo, + data.swapDataDstNo + ); + } + + /// @dev Estimate celer cross-chain message fee and executor fee + function estCelerMessageFeeAndExecutorFee( + uint64 dstCelerChainId, + uint256 dstMaxGasPriceInWeiForExecutor, + ISo.NormalizedSoData calldata soDataNo, + LibSwap.NormalizedSwapData[] calldata swapDataDstNo, + bool is_actual + ) public view returns (uint256, uint256, uint256) { + CacheEstimate memory c; + Storage storage s = getStorage(); + + require(appStorage.gatewaySoFeeSelectors[s.messageBus] != address(0), "SoFeeEmpty"); + c.oracle = ILibPriceV2(appStorage.gatewaySoFeeSelectors[s.messageBus]); + + (c.ratio, ) = c.oracle.getPriceRatio(dstCelerChainId); + + // Only for estimate gas + c.message = encodeCelerPayload( + address(0), + soDataNo, + swapDataDstNo + ); + + c.srcMessageFee = getCelerMessageFee1(s.messageBus, c.message); + + c.dstExecutorGas = s.dstBaseGas[dstCelerChainId] + .add(GasPerByte.mul(c.message.length)); + + c.dstExecutorFee = c.dstExecutorGas.mul(dstMaxGasPriceInWeiForExecutor); + + if (is_actual) { + c.reserve = s.actualReserve; + } else { + c.reserve = s.estimateReserve; + } + + c.srcExecutorFee = c.dstExecutorFee + .mul(c.ratio) + .div(c.oracle.RAY()) + .mul(c.reserve) + .div(RAY); + + return (c.srcMessageFee, c.dstExecutorGas, c.srcExecutorFee); + } + + /// @dev Calculate celer message fee + function getCelerMessageFee1( + address messageBus, + bytes memory message + ) public view returns (uint256) { + return ICelerMessageBus(messageBus).calcFee(message); + } + + /// @dev Calculate celer message fee + function getCelerMessageFee2( + bytes memory message + ) public view returns (uint256) { + Storage storage s = getStorage(); + return getCelerMessageFee1(s.messageBus, message); + } + + /// @dev Get celer native wrap address + function getNativeWrap(address messageBus) public view returns (address) { + address bridge = ICelerMessageBus(messageBus).liquidityBridge(); + + return ICelerBridge(bridge).nativeWrap(); + } + + /// @dev Get so fee + function getCelerSoFee(uint256 amount) public view returns (uint256) { + Storage storage s = getStorage(); + address soFee = appStorage.gatewaySoFeeSelectors[s.messageBus]; + if (soFee == address(0x0)) { + return 0; + } else { + return ILibSoFee(soFee).getFees(amount); + } + } + + /// @dev Get nonce + function getNonce() public view returns (uint64) { + Storage storage s = getStorage(); + return s.nextNonce; + } + + /// @dev Get base gas of destination chain + function getBaseGas(uint64 dstChainId) public view returns(uint256) { + Storage storage s = getStorage(); + return s.dstBaseGas[dstChainId]; + } + + /// @dev Get the receiver of the executor fee + function getExecutorFeeTo() public view returns(address) { + Storage storage s = getStorage(); + return s.executorFeeTo; + } + + /// Private Methods /// + + /// @dev swap on destination chain + function remoteSoSwap( + address token, + uint256 amount, + ISo.SoData memory soData, + LibSwap.SwapData[] memory swapDataDst + ) private { + uint256 soFee = getCelerSoFee(amount); + if (soFee < amount) { + amount = amount.sub(soFee); + } + + if (swapDataDst.length == 0) { + require(token == soData.receivingAssetId, "TokenErr"); + + if (soFee > 0) { + transferUnwrappedAsset( + token, + soData.receivingAssetId, + soFee, + LibDiamond.contractOwner() + ); + } + transferUnwrappedAsset( + token, + soData.receivingAssetId, + amount, + soData.receiver + ); + emit SoTransferCompleted(soData.transactionId, amount); + } else { + require(token == swapDataDst[0].sendingAssetId, "TokenErr"); + + if (soFee > 0) { + transferUnwrappedAsset( + token, + swapDataDst[0].sendingAssetId, + soFee, + LibDiamond.contractOwner() + ); + } + transferUnwrappedAsset( + token, + swapDataDst[0].sendingAssetId, + amount, + address(this) + ); + + swapDataDst[0].fromAmount = amount; + + address correctSwap = appStorage.correctSwapRouterSelectors; + + if (correctSwap != address(0)) { + swapDataDst[0].callData = ICorrectSwap(correctSwap).correctSwap( + swapDataDst[0].callData, + swapDataDst[0].fromAmount + ); + } + + try this.executeAndCheckSwaps(soData, swapDataDst) returns ( + uint256 amountFinal + ) { + // may swap to weth + transferUnwrappedAsset( + swapDataDst[swapDataDst.length - 1].receivingAssetId, + soData.receivingAssetId, + amountFinal, + soData.receiver + ); + emit SoTransferCompleted(soData.transactionId, amountFinal); + } catch Error(string memory revertReason) { + LibAsset.transferAsset( + swapDataDst[0].sendingAssetId, + soData.receiver, + amount + ); + emit SoTransferFailed(soData.transactionId, revertReason, bytes("")); + } catch (bytes memory returnData) { + LibAsset.transferAsset( + swapDataDst[0].sendingAssetId, + soData.receiver, + amount + ); + emit SoTransferFailed(soData.transactionId, "", returnData); + } + } + } + + /// @dev Checks for celer pool-based bridge + function checkBridge( + CelerData memory celerData, + address messageBus, + uint256 bridgeAmount + ) private view { + address bridge = ICelerMessageBus(messageBus).liquidityBridge(); + uint256 minSend = ICelerBridge(bridge).minSend(celerData.bridgeToken); + uint256 maxSend = ICelerBridge(bridge).maxSend(celerData.bridgeToken); + uint256 minMaxSlippage = ICelerBridge(bridge).minimalMaxSlippage(); + + require(minSend < bridgeAmount && bridgeAmount <= maxSend, "bridgeAmountErr"); + require(celerData.maxSlippage > minMaxSlippage, "maxSlippageErr"); + } + + /// @dev Conatains the business logic for the bridge via Celer + function startBridge( + CelerData memory celerData, + uint256 messageFee, + uint256 bridgeAmount, + bytes memory payload + ) private { + Storage storage s = getStorage(); + address messageBus = s.messageBus; + + if (s.srcCelerChainId == celerData.dstCelerChainId) + revert CannotBridgeToSameNetwork(); + + checkBridge(celerData, messageBus, bridgeAmount); + + // 2023.02: only evm chains + bytes32 transferId = LibCelerMessageSender.sendMessageWithTransfer( + celerData.dstSoDiamond, + celerData.bridgeToken, + bridgeAmount, + celerData.dstCelerChainId, + s.nextNonce, + celerData.maxSlippage, + payload, + messageBus, + messageFee + ); + + emit TransferFromCeler( + transferId, + s.srcCelerChainId, + celerData.dstCelerChainId, + celerData.bridgeToken, + bridgeAmount, + s.nextNonce + ); + + // Update nonce + s.nextNonce = s.nextNonce + 1; + } + + /// @dev fetch local storage + function getStorage() private pure returns (Storage storage s) { + bytes32 namespace = NAMESPACE; + // solhint-disable-next-line no-inline-assembly + assembly { + s.slot := namespace + } + } +} diff --git a/ethereum/contracts/Helpers/CelerMessageReceiver.sol b/ethereum/contracts/Helpers/CelerMessageReceiver.sol new file mode 100644 index 00000000..873dd18d --- /dev/null +++ b/ethereum/contracts/Helpers/CelerMessageReceiver.sol @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: GPLv3 +pragma solidity 0.8.13; + +import "../Interfaces/ICelerMessageReceiver.sol"; + +abstract contract CelerMessageReceiver is ICelerMessageReceiver { + /** + * @notice Called by MessageBus to execute a message + * @param _sender The address of the source app contract + * @param _srcChainId The source chain ID where the transfer is originated from + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _executor Address who called the MessageBus execution function + */ + function executeMessage( + address _sender, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable virtual override returns (ExecutionStatus) {} + + // execute message from non-evm chain with bytes for sender address, + // otherwise same as above. + function executeMessage( + bytes calldata _sender, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable virtual override returns (ExecutionStatus) {} + + /** + * @notice Called by MessageBus to execute a message with an associated token transfer. + * The contract is guaranteed to have received the right amount of tokens before this function is called. + * @param _sender The address of the source app contract + * @param _token The address of the token that comes out of the bridge + * @param _amount The amount of tokens received at this contract through the cross-chain bridge. + * @param _srcChainId The source chain ID where the transfer is originated from + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _executor Address who called the MessageBus execution function + */ + function executeMessageWithTransfer( + address _sender, + address _token, + uint256 _amount, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable virtual override returns (ExecutionStatus) {} + + /** + * @notice Only called by MessageBus if + * 1. executeMessageWithTransfer reverts, or + * 2. executeMessageWithTransfer returns ExecutionStatus.Fail + * The contract is guaranteed to have received the right amount of tokens before this function is called. + * @param _sender The address of the source app contract + * @param _token The address of the token that comes out of the bridge + * @param _amount The amount of tokens received at this contract through the cross-chain bridge. + * @param _srcChainId The source chain ID where the transfer is originated from + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _executor Address who called the MessageBus execution function + */ + function executeMessageWithTransferFallback( + address _sender, + address _token, + uint256 _amount, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable virtual override returns (ExecutionStatus) {} + + /** + * @notice Called by MessageBus to process refund of the original transfer from this contract. + * The contract is guaranteed to have received the refund before this function is called. + * @param _token The token address of the original transfer + * @param _amount The amount of the original transfer + * @param _message The same message associated with the original transfer + * @param _executor Address who called the MessageBus execution function + */ + function executeMessageWithTransferRefund( + address _token, + uint256 _amount, + bytes calldata _message, + address _executor + ) external payable virtual override returns (ExecutionStatus) {} +} diff --git a/ethereum/contracts/Interfaces/ICelerBridge.sol b/ethereum/contracts/Interfaces/ICelerBridge.sol new file mode 100644 index 00000000..97ccebc3 --- /dev/null +++ b/ethereum/contracts/Interfaces/ICelerBridge.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity 0.8.13; + +interface ICelerBridge { + // liquidity events + event Send( + bytes32 transferId, + address sender, + address receiver, + address token, + uint256 amount, + uint64 dstChainId, + uint64 nonce, + uint32 maxSlippage + ); + + function send( + address _receiver, + address _token, + uint256 _amount, + uint64 _dstChainId, + uint64 _nonce, + uint32 _maxSlippage + ) external; + + function sendNative( + address _receiver, + uint256 _amount, + uint64 _dstChainId, + uint64 _nonce, + uint32 _maxSlippage + ) external payable; + + function relay( + bytes calldata _relayRequest, + bytes[] calldata _sigs, + address[] calldata _signers, + uint256[] calldata _powers + ) external; + + function transfers(bytes32 transferId) external view returns (bool); + + function withdraws(bytes32 withdrawId) external view returns (bool); + + function minSend(address _token) external view returns (uint256); + + function maxSend(address _token) external view returns (uint256); + + function minimalMaxSlippage() external view returns (uint32); + + function nativeWrap() external view returns (address); + + function withdraw( + bytes calldata _wdmsg, + bytes[] calldata _sigs, + address[] calldata _signers, + uint256[] calldata _powers + ) external; + + /** + * @notice Verifies that a message is signed by a quorum among the signers. + * @param _msg signed message + * @param _sigs list of signatures sorted by signer addresses in ascending order + * @param _signers sorted list of current signers + * @param _powers powers of current signers + */ + function verifySigs( + bytes memory _msg, + bytes[] calldata _sigs, + address[] calldata _signers, + uint256[] calldata _powers + ) external view; +} diff --git a/ethereum/contracts/Interfaces/ICelerMessageBus.sol b/ethereum/contracts/Interfaces/ICelerMessageBus.sol new file mode 100644 index 00000000..87cff039 --- /dev/null +++ b/ethereum/contracts/Interfaces/ICelerMessageBus.sol @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity 0.8.13; + +import "../Libraries/LibCelerMsgDataTypes.sol"; + +interface ICelerMessageBus { + /** + * @notice Send a message to a contract on another chain. + * Sender needs to make sure the uniqueness of the message Id, which is computed as + * hash(type.MessageOnly, sender, receiver, srcChainId, srcTxHash, dstChainId, message). + * If messages with the same Id are sent, only one of them will succeed at dst chain.. + * A fee is charged in the native gas token. + * @param _receiver The address of the destination app contract. + * @param _dstChainId The destination chain ID. + * @param _message Arbitrary message bytes to be decoded by the destination app contract. + */ + function sendMessage( + address _receiver, + uint256 _dstChainId, + bytes calldata _message + ) external payable; + + // same as above, except that receiver is an non-evm chain address, + function sendMessage( + bytes calldata _receiver, + uint256 _dstChainId, + bytes calldata _message + ) external payable; + + /** + * @notice Send a message associated with a token transfer to a contract on another chain. + * If messages with the same srcTransferId are sent, only one of them will succeed at dst chain.. + * A fee is charged in the native token. + * @param _receiver The address of the destination app contract. + * @param _dstChainId The destination chain ID. + * @param _srcBridge The bridge contract to send the transfer with. + * @param _srcTransferId The transfer ID. + * @param _dstChainId The destination chain ID. + * @param _message Arbitrary message bytes to be decoded by the destination app contract. + */ + function sendMessageWithTransfer( + address _receiver, + uint256 _dstChainId, + address _srcBridge, + bytes32 _srcTransferId, + bytes calldata _message + ) external payable; + + /** + * @notice Execute a message not associated with a transfer. + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _sigs The list of signatures sorted by signing addresses in ascending order. A relay must be signed-off by + * +2/3 of the sigsVerifier's current signing power to be delivered. + * @param _signers The sorted list of signers. + * @param _powers The signing powers of the signers. + */ + function executeMessage( + bytes calldata _message, + LibCelerMsgDataTypes.RouteInfo calldata _route, + bytes[] calldata _sigs, + address[] calldata _signers, + uint256[] calldata _powers + ) external payable; + + /** + * @notice Execute a message with a successful transfer. + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _transfer The transfer info. + * @param _sigs The list of signatures sorted by signing addresses in ascending order. A relay must be signed-off by + * +2/3 of the sigsVerifier's current signing power to be delivered. + * @param _signers The sorted list of signers. + * @param _powers The signing powers of the signers. + */ + function executeMessageWithTransfer( + bytes calldata _message, + LibCelerMsgDataTypes.TransferInfo calldata _transfer, + bytes[] calldata _sigs, + address[] calldata _signers, + uint256[] calldata _powers + ) external payable; + + /** + * @notice Execute a message with a refunded transfer. + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _transfer The transfer info. + * @param _sigs The list of signatures sorted by signing addresses in ascending order. A relay must be signed-off by + * +2/3 of the sigsVerifier's current signing power to be delivered. + * @param _signers The sorted list of signers. + * @param _powers The signing powers of the signers. + */ + function executeMessageWithTransferRefund( + bytes calldata _message, // the same message associated with the original transfer + LibCelerMsgDataTypes.TransferInfo calldata _transfer, + bytes[] calldata _sigs, + address[] calldata _signers, + uint256[] calldata _powers + ) external payable; + + /** + * @notice Withdraws message fee in the form of native gas token. + * @param _account The address receiving the fee. + * @param _cumulativeFee The cumulative fee credited to the account. Tracked by SGN. + * @param _sigs The list of signatures sorted by signing addresses in ascending order. A withdrawal must be + * signed-off by +2/3 of the sigsVerifier's current signing power to be delivered. + * @param _signers The sorted list of signers. + * @param _powers The signing powers of the signers. + */ + function withdrawFee( + address _account, + uint256 _cumulativeFee, + bytes[] calldata _sigs, + address[] calldata _signers, + uint256[] calldata _powers + ) external; + + /** + * @notice Calculates the required fee for the message. + * @param _message Arbitrary message bytes to be decoded by the destination app contract. + @ @return The required fee. + */ + function calcFee(bytes calldata _message) external view returns (uint256); + + function liquidityBridge() external view returns (address); + + function pegBridge() external view returns (address); + + function pegBridgeV2() external view returns (address); + + function pegVault() external view returns (address); + + function pegVaultV2() external view returns (address); +} diff --git a/ethereum/contracts/Interfaces/ICelerMessageReceiver.sol b/ethereum/contracts/Interfaces/ICelerMessageReceiver.sol new file mode 100644 index 00000000..865c7696 --- /dev/null +++ b/ethereum/contracts/Interfaces/ICelerMessageReceiver.sol @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity 0.8.13; + +interface ICelerMessageReceiver { + enum ExecutionStatus { + Fail, // execution failed, finalized + Success, // execution succeeded, finalized + Retry // execution rejected, can retry later + } + + /** + * @notice Called by MessageBus to execute a message + * @param _sender The address of the source app contract + * @param _srcChainId The source chain ID where the transfer is originated from + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _executor Address who called the MessageBus execution function + */ + function executeMessage( + address _sender, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable returns (ExecutionStatus); + + // same as above, except that sender is an non-evm chain address, + // otherwise same as above. + function executeMessage( + bytes calldata _sender, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable returns (ExecutionStatus); + + /** + * @notice Called by MessageBus to execute a message with an associated token transfer. + * The contract is guaranteed to have received the right amount of tokens before this function is called. + * @param _sender The address of the source app contract + * @param _token The address of the token that comes out of the bridge + * @param _amount The amount of tokens received at this contract through the cross-chain bridge. + * @param _srcChainId The source chain ID where the transfer is originated from + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _executor Address who called the MessageBus execution function + */ + function executeMessageWithTransfer( + address _sender, + address _token, + uint256 _amount, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable returns (ExecutionStatus); + + /** + * @notice Only called by MessageBus if + * 1. executeMessageWithTransfer reverts, or + * 2. executeMessageWithTransfer returns ExecutionStatus.Fail + * The contract is guaranteed to have received the right amount of tokens before this function is called. + * @param _sender The address of the source app contract + * @param _token The address of the token that comes out of the bridge + * @param _amount The amount of tokens received at this contract through the cross-chain bridge. + * @param _srcChainId The source chain ID where the transfer is originated from + * @param _message Arbitrary message bytes originated from and encoded by the source app contract + * @param _executor Address who called the MessageBus execution function + */ + function executeMessageWithTransferFallback( + address _sender, + address _token, + uint256 _amount, + uint64 _srcChainId, + bytes calldata _message, + address _executor + ) external payable returns (ExecutionStatus); + + /** + * @notice Called by MessageBus to process refund of the original transfer from this contract. + * The contract is guaranteed to have received the refund before this function is called. + * @param _token The token address of the original transfer + * @param _amount The amount of the original transfer + * @param _message The same message associated with the original transfer + * @param _executor Address who called the MessageBus execution function + */ + function executeMessageWithTransferRefund( + address _token, + uint256 _amount, + bytes calldata _message, + address _executor + ) external payable returns (ExecutionStatus); +} diff --git a/ethereum/contracts/Interfaces/ILibPriceV2.sol b/ethereum/contracts/Interfaces/ILibPriceV2.sol new file mode 100644 index 00000000..110d062a --- /dev/null +++ b/ethereum/contracts/Interfaces/ILibPriceV2.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity 0.8.13; + +// Celer chain id is u64, stargate and wormhole are u16 +// ILibPriceV2 for Celer bridge +interface ILibPriceV2 { + function getPriceRatio(uint64 _chainId) external view returns (uint256, bool); + + function updatePriceRatio(uint64 _chainId) external returns (uint256); + + function RAY() external view returns (uint256); +} diff --git a/ethereum/contracts/Libraries/LibCelerMessageSender.sol b/ethereum/contracts/Libraries/LibCelerMessageSender.sol new file mode 100644 index 00000000..85896733 --- /dev/null +++ b/ethereum/contracts/Libraries/LibCelerMessageSender.sol @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity 0.8.13; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import "../Interfaces/ICelerMessageBus.sol"; +import "../Interfaces/ICelerBridge.sol"; + +library LibCelerMessageSender { + using SafeERC20 for IERC20; + + // ============== Internal library functions called by apps ============== + + /** + * @notice Sends a message to an app on another chain via MessageBus with an associated transfer. + * @param _receiver The address of the destination app contract. + * @param _token The address of the token to be sent. + * @param _amount The amount of tokens to be sent. + * @param _dstChainId The destination chain ID. + * @param _nonce A number input to guarantee uniqueness of transferId. Can be timestamp in practice. + * @param _maxSlippage The max slippage accepted, given as percentage in point (pip). Eg. 5000 means 0.5%. + * Must be greater than minimalMaxSlippage. Receiver is guaranteed to receive at least (100% - max slippage percentage) * amount or the + * transfer can be refunded. + * @param _message Arbitrary message bytes to be decoded by the destination app contract. + * @param _messageBus The address of the MessageBus on this chain. + * @param _fee The fee amount to pay to MessageBus. + * @return The transfer ID. + */ + function sendMessageWithTransfer( + address _receiver, + address _token, + uint256 _amount, + uint64 _dstChainId, + uint64 _nonce, + uint32 _maxSlippage, + bytes memory _message, + address _messageBus, + uint256 _fee + ) internal returns (bytes32) { + (bytes32 transferId, address bridge) = sendTokenTransfer( + _receiver, + _token, + _amount, + _dstChainId, + _nonce, + _maxSlippage, + _messageBus + ); + if (_message.length > 0) { + ICelerMessageBus(_messageBus).sendMessageWithTransfer{value: _fee}( + _receiver, + _dstChainId, + bridge, + transferId, + _message + ); + } + return transferId; + } + + /** + * @notice Sends a token transfer via a bridge. + * @param _receiver The address of the destination app contract. + * @param _token The address of the token to be sent. + * @param _amount The amount of tokens to be sent. + * @param _dstChainId The destination chain ID. + * @param _nonce A number input to guarantee uniqueness of transferId. Can be timestamp in practice. + * @param _maxSlippage The max slippage accepted, given as percentage in point (pip). Eg. 5000 means 0.5%. + * Must be greater than minimalMaxSlippage. Receiver is guaranteed to receive at least (100% - max slippage percentage) * amount or the + * transfer can be refunded. + */ + function sendTokenTransfer( + address _receiver, + address _token, + uint256 _amount, + uint64 _dstChainId, + uint64 _nonce, + uint32 _maxSlippage, + address _messageBus + ) internal returns (bytes32 transferId, address bridge) { + // Only applicable to the {MsgDataTypes.BridgeSendType.Liquidity} + bridge = ICelerMessageBus(_messageBus).liquidityBridge(); + IERC20(_token).safeIncreaseAllowance(bridge, _amount); + ICelerBridge(bridge).send(_receiver, _token, _amount, _dstChainId, _nonce, _maxSlippage); + transferId = computeLiqBridgeTransferId(_receiver, _token, _amount, _dstChainId, _nonce); + } + + function computeLiqBridgeTransferId( + address _receiver, + address _token, + uint256 _amount, + uint64 _dstChainId, + uint64 _nonce + ) internal view returns (bytes32) { + return + keccak256( + abi.encodePacked(address(this), _receiver, _token, _amount, _dstChainId, _nonce, uint64(block.chainid)) + ); + } + +} diff --git a/ethereum/contracts/Libraries/LibCelerMsgDataTypes.sol b/ethereum/contracts/Libraries/LibCelerMsgDataTypes.sol new file mode 100644 index 00000000..9d9aff6c --- /dev/null +++ b/ethereum/contracts/Libraries/LibCelerMsgDataTypes.sol @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity 0.8.13; + +library LibCelerMsgDataTypes { + string constant ABORT_PREFIX = "MSG::ABORT:"; + + // bridge operation type at the sender side (src chain) + enum BridgeSendType { + Null, + Liquidity, + PegDeposit, + PegBurn, + PegV2Deposit, + PegV2Burn, + PegV2BurnFrom + } + + // bridge operation type at the receiver side (dst chain) + enum TransferType { + Null, + LqRelay, // relay through liquidity bridge + LqWithdraw, // withdraw from liquidity bridge + PegMint, // mint through pegged token bridge + PegWithdraw, // withdraw from original token vault + PegV2Mint, // mint through pegged token bridge v2 + PegV2Withdraw // withdraw from original token vault v2 + } + + enum MsgType { + MessageWithTransfer, + MessageOnly + } + + enum TxStatus { + Null, + Success, + Fail, + Fallback, + Pending // transient state within a transaction + } + + struct TransferInfo { + TransferType t; + address sender; + address receiver; + address token; + uint256 amount; + uint64 wdseq; // only needed for LqWithdraw (refund) + uint64 srcChainId; + bytes32 refId; + bytes32 srcTxHash; // src chain msg tx hash + } + + struct RouteInfo { + address sender; + address receiver; + uint64 srcChainId; + bytes32 srcTxHash; // src chain msg tx hash + } + + // used for msg from non-evm chains with longer-bytes address + struct RouteInfo2 { + bytes sender; + address receiver; + uint64 srcChainId; + bytes32 srcTxHash; + } + + // combination of RouteInfo and RouteInfo2 for easier processing + struct Route { + address sender; // from RouteInfo + bytes senderBytes; // from RouteInfo2 + address receiver; + uint64 srcChainId; + bytes32 srcTxHash; + } + + struct MsgWithTransferExecutionParams { + bytes message; + TransferInfo transfer; + bytes[] sigs; + address[] signers; + uint256[] powers; + } + + struct BridgeTransferParams { + bytes request; + bytes[] sigs; + address[] signers; + uint256[] powers; + } +} diff --git a/ethereum/contracts/Libraries/LibSoFeeCelerV1.sol b/ethereum/contracts/Libraries/LibSoFeeCelerV1.sol new file mode 100644 index 00000000..54913a00 --- /dev/null +++ b/ethereum/contracts/Libraries/LibSoFeeCelerV1.sol @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity 0.8.13; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/utils/math/SafeMath.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {ILibSoFee} from "../Interfaces/ILibSoFee.sol"; +import {ILibPriceV2} from "../Interfaces/ILibPriceV2.sol"; +import {IAggregatorV3Interface} from "../Interfaces/IAggregatorV3Interface.sol"; +import {ReentrancyGuard} from "../Helpers/ReentrancyGuard.sol"; + +// Celer +contract LibSoFeeCelerV1 is ILibSoFee, ILibPriceV2, Ownable, ReentrancyGuard { + using SafeMath for uint256; + + //--------------------------------------------------------------------------- + // VARIABLES + + struct ChainlinkConfig { + address router; + // Countdown flag + bool flag; + } + + struct PriceConfig { + ChainlinkConfig[] chainlink; + // Update time interval + uint256 interval; + } + + struct PriceData { + // The currnet price ratio of native coins + uint256 currentPriceRatio; + // Last update timestamp + uint256 lastUpdateTimestamp; + } + + uint256 public constant RAY = 1e27; + + uint256 public soFee; + + // Destination celer chain id => Oracle config + mapping(uint64 => PriceConfig) public priceConfig; + mapping(uint64 => PriceData) public priceData; + + //--------------------------------------------------------------------------- + // EVENT + event UpdatePriceConfig( + uint64 chainId, + ChainlinkConfig[] chainlink, + uint256 interval + ); + event UpdatePriceInterval(uint64 chainId, uint256 interval); + event UpdatePriceRatio(address sender, uint256 currentRatio); + + constructor(uint256 _soFee) { + soFee = _soFee; + } + + function setFee(uint256 _soFee) external onlyOwner { + soFee = _soFee; + } + + function setPriceConfig( + uint64 _chainId, + ChainlinkConfig[] memory _chainlink, + uint256 _interval + ) external onlyOwner { + delete priceConfig[_chainId].chainlink; + for (uint256 i = 0; i < _chainlink.length; i++) { + priceConfig[_chainId].chainlink.push( + ChainlinkConfig(_chainlink[i].router, _chainlink[i].flag) + ); + } + priceConfig[_chainId].interval = _interval; + emit UpdatePriceConfig(_chainId, _chainlink, _interval); + } + + function setPriceInterval( + uint64 _chainId, + uint256 _interval + ) external onlyOwner { + priceConfig[_chainId].interval = _interval; + emit UpdatePriceInterval(_chainId, _interval); + } + + function getPriceRatioByChainlink( + uint64 _chainId, + PriceConfig memory _config + ) external view returns (uint256) { + uint256 _ratio = RAY; + for (uint256 i = 0; i < _config.chainlink.length; i++) { + IAggregatorV3Interface _aggregator = IAggregatorV3Interface( + _config.chainlink[i].router + ); + (, int256 _price, , , ) = _aggregator.latestRoundData(); + uint8 _decimals = _aggregator.decimals(); + if (_price <= 0) { + return priceData[_chainId].currentPriceRatio; + } + if (_config.chainlink[i].flag) { + _ratio = _ratio.mul(10**_decimals).div(uint256(_price)); + } else { + _ratio = _ratio.mul(uint256(_price)).div(10**_decimals); + } + } + return _ratio; + } + + function getPriceRatio(uint64 _chainId) public view returns (uint256, bool) { + PriceConfig memory _config = priceConfig[_chainId]; + + if (_config.chainlink.length == 0) { + return (priceData[_chainId].currentPriceRatio, false); + } + if ( + priceData[_chainId].lastUpdateTimestamp.add(_config.interval) >= + block.timestamp + ) { + return (priceData[_chainId].currentPriceRatio, false); + } + + try this.getPriceRatioByChainlink(_chainId, _config) returns ( + uint256 _result + ) { + return (_result, true); + } catch { + return (priceData[_chainId].currentPriceRatio, false); + } + } + + function updatePriceRatio(uint64 _chainId) external returns (uint256) { + (uint256 _ratio, bool _flag) = getPriceRatio(_chainId); + if (_flag) { + priceData[_chainId].currentPriceRatio = _ratio; + priceData[_chainId].lastUpdateTimestamp = block.timestamp; + emit UpdatePriceRatio(msg.sender, _ratio); + } + return _ratio; + } + + function setPriceRatio(uint64 _chainId, uint256 _ratio) external onlyOwner { + priceData[_chainId].currentPriceRatio = _ratio; + priceData[_chainId].lastUpdateTimestamp = block.timestamp; + emit UpdatePriceRatio(msg.sender, _ratio); + } + + function getRestoredAmount(uint256 _amountIn) + external + view + override + returns (uint256 r) + { + // calculate the amount to be restored + r = _amountIn.mul(RAY).div((RAY - soFee)); + return r; + } + + function getFees(uint256 _amountIn) + external + view + override + returns (uint256 s) + { + // calculate the so fee + s = _amountIn.mul(soFee).div(RAY); + return s; + } + + function getTransferForGas() external view override returns (uint256) { + return 0; + } + + function getVersion() external pure override returns (string memory) { + return "CelerV1"; + } +} diff --git a/ethereum/export/ContractDeployed.json b/ethereum/export/ContractDeployed.json index 83f155d2..98dabf4c 100644 --- a/ethereum/export/ContractDeployed.json +++ b/ethereum/export/ContractDeployed.json @@ -1,161 +1,34 @@ { - "arbitrum-main": { - "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", - "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", - "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0xe37890304741ced9daEbcEe614810f9848df8c39", - "LibCorrectSwapV1": "0xa19d570d65Ff031331dFD453faC2F94bF2bdE405", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xDbcF392931212Bfd303d75046B88fD9b026cdaEA", - "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04" - }, - "optimism-main": { - "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", - "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", - "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0xDBA05e1Bf0c027Ab59eA0f166C941C2D55ae8440", - "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0x68aEcD6f5b0Df5b85c55BE8b0563f788dC8b9AF0", - "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04" - }, - "avax-main": { - "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", - "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", - "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0x26bda683F874e7AE3e3A5d3fad44Bcb82a7c107C", - "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "LibSoFeeWormholeV1": "0xd3e0550D3e4Bc3E02C89377B1586261904F5E1db", - "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", - "SerdeFacet": "0x73bdB15AAa8797a37cdfa236ca4FC9d6E5a223aD", - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0x68aEcD6f5b0Df5b85c55BE8b0563f788dC8b9AF0", - "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0xA7Bfb2449036DEeFC06c1Bf960A820F87f79738e" - }, "avax-test": { - "DexManagerFacet": "0x247Ef9D9221e05F5fFEa81e22e5fdd295668f2c4", - "DiamondCutFacet": "0x43C37D2F0Df9302e39e545E7C3e2598251f563aB", - "DiamondLoupeFacet": "0xe5DDd6b5d104c3aC9671277108107813D9Fe75A0", - "GenericSwapFacet": "0x575Aaba867454C1c39367BcD9B9052353aac9004", - "LibCorrectSwapV1": "0x1763C19701Ad4171472c21e9764343Eb097ED1ba", - "LibSoFeeStargateV1": "0x0549B67d255a751958d1075743A121c027146C33", - "LibSoFeeWormholeV1": "0xF845891F46655244dEB3deb651D8fb1E2e4f006a", - "OwnershipFacet": "0x1917d93A69f6A1F83821011414f8aAFaA64795B6", - "SerdeFacet": "0xF08729b93b97E0fA05895e90F1E42F4eE0620071", - "SoDiamond": "0x802e05b91769342af3F0d13f9DC6Df03a54C2ac7", - "StargateFacet": "0x4A665F39C236a29CdE4b9859E8882E41DC7FcA2D", - "WithdrawFacet": "0x24DEeDaC97FdC08752228E64bB8b2201E370f3d4", - "WormholeFacet": "0xeE6EBDf4263701fB700dBc48A2088d23c5Df8a88" - }, - "bsc-main": { - "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", - "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", - "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0xc92C35cb3958c44b36173B4CD278BB81794870e0", - "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "LibSoFeeWormholeV1": "0xda7bc7A71142b6283BEE9206FE2B13c5faF5193B", - "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", - "SerdeFacet": "0x99e010315c78FC03451352A4766243D163fC0e6A", - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xa19d570d65Ff031331dFD453faC2F94bF2bdE405", - "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0x01c49cF47dCF62769466738a179F94d51ea8BDdB" - }, - "bsc-test": { - "DexManagerFacet": "0x098D26E4d2E98C1Dde14C543Eb6804Fd98Af9CB4", - "DiamondCutFacet": "0x2B9aD416b22f19c93292E1Fd890C0a6B684C8F69", - "DiamondLoupeFacet": "0xAb937e03354a941d723feB715Fb73C28F2E30Fbe", - "GenericSwapFacet": "0xc80aF1c8ec82C975910e00fb3a466c6A925A6553", - "LibCorrectSwapV1": "0xfdA7DC4Dd75672d3142fCF8b1DE952e33edcb65b", - "LibSoFeeStargateV1": "0xE38226293E17D4944B4929967DfD3aB4647a7E0A", - "LibSoFeeWormholeV1": "0xc8DF0654252B27Ccd3Aa73f683306902920446Ac", - "OwnershipFacet": "0xBD1930dd4cd4e18737c7BcDACACFe450f1D231ba", - "SerdeFacet": "0xA2c78CAB334E3D78096bFF71A817FB472DD21A55", - "SoDiamond": "0xEe05F9e2651EBC5dbC66aD54241C6AB24E361228", - "StargateFacet": "0xEBb6a1d17Ae9A276EdE95bF6B8fC6527fa2dF737", - "WithdrawFacet": "0xF30456B67444f20d1D35aCC1280E165c43262442", - "WormholeFacet": "0x6F5b4Bc793aE7213564501aB22c714e39f5D2BAC" - }, - "ftm-test": { - "DexManagerFacet": "0xd6bAA4d4F5E78FB5314476Df8D023b35676C0f9A", - "DiamondCutFacet": "0xDf0aFC545A3E819a7B69cD2D92df69Fa64606748", - "DiamondLoupeFacet": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "GenericSwapFacet": "0x53e2d8F6591C0eA280cCf4869122AE308e677026", - "LibCorrectSwapV1": "0xf704E4FCA4Ed2c45270Ef1a3bEFb14f71d1fa56b", - "LibSoFeeStargateV1": "0x2967e56c9406E680f7A6bf37E963aD4954Fe58D7", - "LibSoFeeWormholeV1": "0xE5E43f7284345d0eB6965134079451137138F81f", - "OwnershipFacet": "0x0b0Bf3269Ff6E234b06Ca25bfAfd29e46e3924A7", - "SerdeFacet": "0x8180f2E7c6f61eCb664Cd8619957a0C059F335F6", - "SoDiamond": "0x0fC43efF06af401aD4D553B715c6C52766135706", - "StargateFacet": "0x65d63d0025174380aA49bDFb87FF2E294Eedf6EE", - "WithdrawFacet": "0xb4Ede7c21291737289081cfA1D6a75D1F3770ae5", - "WormholeFacet": "0xe30CE8062cCA6475648BcfB067af57dA0A545829" + "CelerFacet": "0xD8E26a63fabCCfCDA45a0693bd88e369887F1280", + "DexManagerFacet": "0x748E69591Fe651f7a8564577fB0A8A6DC294C663", + "DiamondCutFacet": "0x66a820c5e74d935785AcCFcC0Cb90e9823756ddc", + "DiamondLoupeFacet": "0x8D2c8173f35F49a196D003207AB67235eA0DD2Df", + "GenericSwapFacet": "0x3b3a6bE42b8eeF544FB61555D02d44fc3487562F", + "LibCorrectSwapV1": "0x5052CfBfEc1fbbF12613de12319716e1f3a1990c", + "LibSoFeeCelerV1": "0x0a5926E5C279eB21130214092d835c7BBFa18dF9", + "LibSoFeeWormholeV1": "0xD9a4ae73A2A5C684cd64f8204bc93BCd0C730253", + "OwnershipFacet": "0x6A146B07AaA86925B5aec255C5C914a5Fd940C54", + "SerdeFacet": "0x65430554edE8609aFb6bE7b89d9dC61E8D7F1AAb", + "SoDiamond": "0xE68508c61c4f979B828cd1c8383676d93583Cae5", + "StargateFacet": "0xD3996303C9d4E1a55f3b8e9C6824839eF8141bd4", + "WithdrawFacet": "0xa6c137990B1607E964fac5751671F675f0117781", + "WormholeFacet": "0xB1BC748cF66C5DD6613D5Db2De8a42232cd3484d" }, "goerli": { - "DexManagerFacet": "0x78B9C9e53DD688251a3B2CeF25957804Bb94575c", - "DiamondCutFacet": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "DiamondLoupeFacet": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "GenericSwapFacet": "0x135E6130E3f33e7735DcE35dCc14D32423cAE1ed", - "LibCorrectSwapV1": "0xa19d570d65Ff031331dFD453faC2F94bF2bdE405", - "LibSoFeeStargateV1": "0xf59E065d16767f934e48DFfFE35c69402082c9BB", - "LibSoFeeWormholeV1": "0x68aEcD6f5b0Df5b85c55BE8b0563f788dC8b9AF0", - "OwnershipFacet": "0xfBA94Cf31f47966D89EF689edF59bc37fC84ca9c", - "SerdeFacet": "0xbD4713c1A5F7136b3B6Bc606353f1F71c47bA239", - "SoDiamond": "0x12479EEF3EF33687f6b79d59aC6E387C7bc75A3F", - "StargateFacet": "0xfDa613cb7366b1812F2d33fC95D1d4DD3896aeb8", - "WithdrawFacet": "0xf9d4C04cA77FA71Cf8f2BbA44994cd38107d356E", - "WormholeFacet": "0xacCA63aA138997602b2771E2aF6B7cfc643aa027" - }, - "mainnet": { - "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", - "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", - "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0x26bda683F874e7AE3e3A5d3fad44Bcb82a7c107C", - "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "LibSoFeeWormholeV1": "0x01c49cF47dCF62769466738a179F94d51ea8BDdB", - "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", - "SerdeFacet": "0x3462F4D39DD02848373db75Bc64665DDc3d0895A", - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xba661e8482D62d3B33751961780df04Aab373eA5", - "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0x1061A15dc5b44593cae9fFE7031f396da0970824" - }, - "polygon-main": { - "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", - "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", - "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0x26bda683F874e7AE3e3A5d3fad44Bcb82a7c107C", - "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "LibSoFeeWormholeV1": "0xd3e0550D3e4Bc3E02C89377B1586261904F5E1db", - "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", - "SerdeFacet": "0x1565F02EdFfD282F73FbA8C640ed70b27f91f1Fd", - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xba661e8482D62d3B33751961780df04Aab373eA5", - "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0x0F4aedfB8DA8aF176DefF282DA86EBbe3A0EA19e" - }, - "polygon-test": { - "DexManagerFacet": "0xB658abEd5457103f71B065A76A9Ed3C1fD88c591", - "DiamondCutFacet": "0x83Fb8c9D06CFDF82fdF3414C6BAF956634728755", - "DiamondLoupeFacet": "0x351174D07eAE909aa4b4483D03f8359fFAc3aB9D", - "GenericSwapFacet": "0x62c7bc10E5b4f5eb03fAD828d2C20c1C6269bd5f", - "LibCorrectSwapV1": "0x2ef6665Df2E2a87F610fF46AbA11d69BD3ab5d2e", - "LibSoFeeStargateV1": "0x96Ae044BEdC774669d1AD03D7B33F4241eC5c42C", - "LibSoFeeWormholeV1": "0x472F1c1B51B1e2dC022e9Eb9673c1F2f23df6E72", - "OwnershipFacet": "0xFFC1BC8A516C6B0EF5D3a5652a70e722Acf8f9C9", - "SerdeFacet": "0xb7e02565426d47174fF4231D490Ff6B827306377", - "SoDiamond": "0xBae5BeAdBaa65628eA9DC5A5c7F794b4865c8771", - "StargateFacet": "0x4E218F45E37f940Eb503b3b9F31426110059d672", - "WithdrawFacet": "0x2481c0B9cb3ef571Ea39bc013716d3f4879BA626", - "WormholeFacet": "0x1ac958477e0873D7039B2B71ae89B51d3248fA4F" + "CelerFacet": "0x3848EAEA3Bb66b7202eB5cA940aB27B6d730De39", + "DexManagerFacet": "0xCDCF1cEB666461B78e9EF21221919f214096531a", + "DiamondCutFacet": "0x9bEd1F12eEcCD332962fE43B4599b03AFD8487A1", + "DiamondLoupeFacet": "0xA3D3d2211efaBCDA923be957B54e3D036F29b92A", + "GenericSwapFacet": "0xC5267C7D9413514B97CeC899FdEF5E9b8Ac87b01", + "LibCorrectSwapV1": "0xA3FE86363dD6Cc3fDecF3C55fBF14E9C084bd07b", + "LibSoFeeCelerV1": "0x448c2e298a09BA15aA2921D1340808C8eED7A804", + "LibSoFeeWormholeV1": "0x77b269daB025A0aeBb198D06D3AEB8b56F44E517", + "OwnershipFacet": "0xC7DE1DB2F085388c70F4391B8453183420472EA7", + "SerdeFacet": "0xcE30FABEbe2007857d7Dc47c477f26eDDeb11437", + "SoDiamond": "0x43bBc3Be3FD1a26F62CA319E2eDEB5aB40d0e1D8", + "StargateFacet": "0x0Ab6A79ded3DBFbDF8fBA8F75adF760A9F9561f7", + "WithdrawFacet": "0xF995718cE98CD7838dFA181d96649DCAa7C8F13A", + "WormholeFacet": "0xa5F65F676E4f500735c1ddCc405842E485c09c27" } } \ No newline at end of file diff --git a/ethereum/export/OmniSwapInfo.json b/ethereum/export/OmniSwapInfo.json index e31e897b..03e5a637 100644 --- a/ethereum/export/OmniSwapInfo.json +++ b/ethereum/export/OmniSwapInfo.json @@ -1,3953 +1,191 @@ { - "aptos-mainnet": { - "LiquidSwap": "0x190d44266241744264b964a37b8f09863167a12d3e70cda39376cfb4e3561e12", - "aux": "0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541", - "OmniBtcChainId": 1, - "SoDiamond": "0x0000000000000000000000000000000000000000000000000000000000000002", - "WormholeBridge": "0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f", - "WormholeChainId": 22, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x1::aptos_coin::AptosCoin", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x1::aptos_coin::AptosCoin", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x1::aptos_coin::AptosCoin", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x1::aptos_coin::AptosCoin", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 8, - "NativeToken": true, - "TokenAddress": "0x1::aptos_coin::AptosCoin", - "TokenName": "APT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCeth" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTeth" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "USDTbsc" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCpolygon" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCavax" - } - ] - }, - "aptos-testnet": { - "LiquidSwap": "0x4e9fce03284c0ce0b86c88dd5a46f050cad2f4f33c4cdd29d98f501868558c81", - "aux": "0x8b7311d78d47e37d09435b8dc37c14afd977c5cfa74f974d45f0258d986eef53", - "OmniBtcChainId": 30001, - "SoDiamond": "0x0000000000000000000000000000000000000000000000000000000000000004", - "WormholeBridge": "0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f", - "WormholeChainId": 22, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0x4A7Bd5E135f421057F97BbA8BCeeE5c18334f454", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x1::aptos_coin::AptosCoin", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x226B436043B537BD158e84fA199E2Aa36bf364f8", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x1::aptos_coin::AptosCoin", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 8, - "NativeToken": true, - "TokenAddress": "0x1::aptos_coin::AptosCoin", - "TokenName": "APT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xf9471131e004dcdBF3325d0B9Fef49162739d87D", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::XBTC", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x2baF26A3E7A6dfC3dF6E0aaB0DC8e0274729E35A,", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::XBTC", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 8, - "NativeToken": true, - "TokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::XBTC", - "TokenName": "XBTC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x6A14ccC52d89E0A7817CC65C43630f4D0515dDF9", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDC", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x827e05D82f8f39b767Aca000F843588785dD1dce,", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDC", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 8, - "NativeToken": true, - "TokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDC", - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x48E4508054A82996667e0ca9C3543f57c53FA3C6", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDT", - "SrcWormholeChainId": 22 - }, - { - "DstTokenAddress": "0x49cc9705f1Df944872239d7F04679Cf8841E854A,", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDT", - "SrcWormholeChainId": 22 - } - ], - "Decimal": 8, - "NativeToken": true, - "TokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDT", - "TokenName": "USDT" - } - ] - }, - "arbitrum-main": { - "ChainId": 42161, - "OmniBtcChainId": 6, - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateChainId": 110, - "StargatePool": [ - { - "ChainPath": [ - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", - "TokenName": "USDC" - }, - { - "ChainPath": [ - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", - "TokenName": "USDT" - }, - { - "ChainPath": [ - [ - 101, - 13 - ], - [ - 111, - 13 - ] - ], - "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0x82CbeCF39bEe528B5476FE6d1550af59a9dB6Fc0", - "TokenName": "SGETH" - } - ], - "StargateRouter": "0x53Bf833A5d6c4ddA888F69c22C88C9f356a41614", - "UniswapRouter": [ - { - "Name": "UniswapV3", - "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", - "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "TokenList": "", - "Type": "ISwapRouter" - }, - { - "Name": "SushiswapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", - "TokenList": "", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" - }, - "arbitrum-test": { - "ChainId": 421611, - "OmniBtcChainId": 30006, - "SoDiamond": "0x96568bF35abeeb6C39910f6672f8e3fbEB1dB303", - "StargateChainId": 10010, - "StargatePool": [ - { - "ChainPath": [ - [ - 10006, - 1 - ], - [ - 10006, - 2 - ], - [ - 10002, - 2 - ], - [ - 10002, - 5 - ], - [ - 10012, - 1 - ], - [ - 10011, - 1 - ], - [ - 10009, - 1 - ], - [ - 10009, - 2 - ], - [ - 10001, - 1 - ], - [ - 10001, - 2 - ] - ], - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x1EA8Fb2F671620767f41559b663b86B1365BBc3d", - "TokenName": "USDC" - }, - { - "ChainPath": [ - [ - 10006, - 1 - ], - [ - 10006, - 2 - ], - [ - 10002, - 2 - ], - [ - 10002, - 5 - ], - [ - 10012, - 1 - ], - [ - 10011, - 1 - ], - [ - 10009, - 1 - ], - [ - 10009, - 2 - ], - [ - 10001, - 1 - ], - [ - 10001, - 2 - ] - ], - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0x385182a81b05Be437416e100F4b7fAB2C2e9a8Ed", - "TokenName": "USDT" - }, - { - "ChainPath": [ - [ - 10011, - 10 - ], - [ - 10001, - 10 - ] - ], - "Decimal": 18, - "PoolId": 10, - "TokenAddress": "0xbC2b378C03f86BBC4523B05e1343751d635b0FBA", - "TokenName": "WETH" - }, - { - "ChainPath": [ - [ - 10011, - 12 - ], - [ - 10001, - 12 - ] - ], - "Decimal": 18, - "PoolId": 12, - "TokenAddress": "0x7279cbFcE0420d7Eb9C64F8C0d4454E4801baaC0", - "TokenName": "ETH" - }, - { - "ChainPath": [ - [ - 10011, - 13 - ], - [ - 10001, - 13 - ] - ], - "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0x1450e45e7345c4f6967b2A7DD91d9b0D3f65ff83", - "TokenName": "SGETH" - } - ], - "StargateRouter": "0x6701D9802aDF674E524053bd44AA83ef253efc41", - "UniswapRouter": [ - { - "Name": "UniswapV3", - "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", - "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "TokenList": "", - "Type": "ISwapRouter" - }, - { - "Name": "UniswapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0xb5a35165047fed7440D3a75909c0949bf1943696", - "TokenList": "", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681" - }, - "avax-main": { - "ChainId": 43114, - "OmniBtcChainId": 4, - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateChainId": 106, - "StargatePool": [ - { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "TokenName": "USDC" - }, - { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "TokenName": "USDt" - } - ], - "StargateRouter": "0x45A01E4e04F14f7A4a6702c74187c5F6222033cd", - "UniswapRouter": [ - { - "Name": "PangolinV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106", - "TokenList": "https://raw.githubusercontent.com/pangolindex/tokenlists/main/pangolin.swap_tokenlist.json", - "Type": "IUniswapV2Router02AVAX" - }, - { - "Name": "TraderJoeV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x60aE616a2155Ee3d9A68541Ba4544862310933d4", - "TokenList": "", - "Type": "IUniswapV2Router02AVAX" - } - ], - "WETH": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7", - "WormholeBridge": "0x0e082F06FF657D94310cB8cE8B0D9a04541d8052", - "WormholeChainId": 6, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x32279A16358B5B1EfE1b3412d3aab9CFEbC54B4d", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x4a618Df8E3e6f2E94D1F9bed94722e43b9fD97D5", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x72B2095361926E72692DFd5986C5B0d2bc18bF1e", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x96412902aa9aFf61E13f085e70D3152C6ef2a817", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x85f138bfEE4ef8e540890CFb48F620571d67Eda3", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "AVAX" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCeth" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTeth" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x1::aptos_coin::AptosCoin", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "WAPT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "USDTbsc" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x442F7f22b1EE2c842bEAFf52880d4573E9201158", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x442F7f22b1EE2c842bEAFf52880d4573E9201158", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x418D75f65a02b3D53B2418FB8E1fe493759c7605", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x442F7f22b1EE2c842bEAFf52880d4573E9201158", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WBNB" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCpolygon" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x038627d23Dacdc967087A57309F8139aeb99D8e4", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xD343968e46690D6C89A88a36a5B8CE5Fb5D65AC4", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x038627d23Dacdc967087A57309F8139aeb99D8e4", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x9024B09C1C6D33221F6AeA9571821a2062B88eEf", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x038627d23Dacdc967087A57309F8139aeb99D8e4", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTpolygon" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WMATIC" - } - ] - }, - "avax-test": { - "ChainId": 43113, - "OmniBtcChainId": 30004, - "SoDiamond": "0x802e05b91769342af3F0d13f9DC6Df03a54C2ac7", - "StargateChainId": 10106, - "StargatePool": [ - { - "ChainPath": [ - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "TokenName": "USDC" - }, - { - "ChainPath": [ - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0x134Dc38AE8C853D1aa2103d5047591acDAA16682", - "TokenName": "USDT" - } - ], - "StargateRouter": "0x13093E05Eb890dfA6DacecBdE51d24DabAb2Faa1", - "UniswapRouter": [ - { - "Name": "DexLotV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x6D481b9F59b22B6eB097b986fC06E438d585c039", - "TokenList": "", - "Type": "IUniswapV2Router02AVAX" - } - ], - "WETH": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", - "WormholeBridge": "0x61E44E506Ca5659E6c0bba9b678586fA2d729756", - "WormholeChainId": 6, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0xAC6331db5C84602F2F8dc4592bdeafE602C2a994", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x71b7E25BE7879E042E55FBabD4037De116ae07e0", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x4Eef687C481CcBa613Dbf6b3245281C6f91aEc62", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x10F1053bF2884b28ee0Bd7a2dDBa237Af3511d29", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WBNB" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x78554394273957d7e55afC841aeA27Cce469AEd4", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WMATIC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xbB5A2dC896Ec4E2fa77F40FA630582ed9c6D0172", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x4C1b727f6df3B075E682C41a25687A69846aaC04", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x6cE9E2c8b59bbcf65dA375D3d8AB503c8524caf7", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x51f3D34651523dD8CC4872ee261A1B0B3f73AceF", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "AVAX" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x8337e5eF98af25012e1B39CD996772143f6c5fDf", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x52019f6ad6b15739Ec083A1e54EaF294a2dDfD6B", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xF18BfDa8071eB9dc51aE47F46349cB98695E42C3", - "SrcWormholeChainId": 6 - }, - { - "DstTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "DstWormholeChainId": 10, - "SrcTokenAddress": "0xF0df323AEAeB85bbC1e08177C4ED1c57FaD76D84", - "SrcWormholeChainId": 6 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDC" - } - ] - }, - "bsc-main": { - "ChainId": 56, - "OmniBtcChainId": 3, - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateChainId": 102, - "StargatePool": [ - { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 18, - "PoolId": 2, - "TokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "TokenName": "USDT" - }, - { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 18, - "PoolId": 5, - "TokenAddress": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", - "TokenName": "BUSD" - }, - { - "ChainPath": [ - [ - 101, - 11 - ] - ], - "Decimal": 18, - "PoolId": 11, - "TokenAddress": "0xd17479997F34dd9156Deef8F95A52D81D265be9c", - "TokenName": "USDD" - } - ], - "StargateRouter": "0x4a364f8c717cAAD9A442737Eb7b8A55cc6cf18D8", - "UniswapRouter": [ - { - "Name": "PancakeSwapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x10ED43C718714eb63d5aA57B78B54704E256024E", - "TokenList": "https://tokens.pancakeswap.finance/pancakeswap-top-100.json", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", - "WormholeBridge": "0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7", - "WormholeChainId": 4, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x442F7f22b1EE2c842bEAFf52880d4573E9201158", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x418D75f65a02b3D53B2418FB8E1fe493759c7605", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "BNB" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCeth" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTeth" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x1::aptos_coin::AptosCoin", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "WAPT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCpolygon" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xD343968e46690D6C89A88a36a5B8CE5Fb5D65AC4", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x038627d23Dacdc967087A57309F8139aeb99D8e4", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xD343968e46690D6C89A88a36a5B8CE5Fb5D65AC4", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x9024B09C1C6D33221F6AeA9571821a2062B88eEf", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xD343968e46690D6C89A88a36a5B8CE5Fb5D65AC4", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTpolygon" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WMATIC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCavax" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x4a618Df8E3e6f2E94D1F9bed94722e43b9fD97D5", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x32279A16358B5B1EfE1b3412d3aab9CFEbC54B4d", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x4a618Df8E3e6f2E94D1F9bed94722e43b9fD97D5", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x72B2095361926E72692DFd5986C5B0d2bc18bF1e", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x4a618Df8E3e6f2E94D1F9bed94722e43b9fD97D5", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTavax" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x96412902aa9aFf61E13f085e70D3152C6ef2a817", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x96412902aa9aFf61E13f085e70D3152C6ef2a817", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x85f138bfEE4ef8e540890CFb48F620571d67Eda3", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x96412902aa9aFf61E13f085e70D3152C6ef2a817", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WAVAX" - } - ] - }, - "bsc-test": { - "ChainId": 97, - "OmniBtcChainId": 30003, - "SoDiamond": "0xEe05F9e2651EBC5dbC66aD54241C6AB24E361228", - "StargateChainId": 10102, - "StargatePool": [ - { - "ChainPath": [ - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ] - ], - "Decimal": 18, - "PoolId": 2, - "TokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "TokenName": "USDT" - }, - { - "ChainPath": [ - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10112, - 1 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ] - ], - "Decimal": 18, - "PoolId": 5, - "TokenAddress": "0x1010Bb1b9Dff29e6233E7947e045e0ba58f6E92e", - "TokenName": "BUSD" - }, - { - "Decimal": 18, - "PoolId": 11, - "TokenAddress": "0x8467C2439BC4C593aC8AAf0df4879b89F7Ab8a61", - "TokenName": "USDD" - } - ], - "StargateRouter": "0xbB0f1be1E9CE9cB27EA5b0c3a85B7cc3381d8176", - "UniswapRouter": [ - { - "Name": "UniswapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0xD99D1c33F9fC3444f8101754aBC46c52416550D1", - "TokenList": "", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0xae13d989dac2f0debff460ac112a837c89baa7cd", - "WormholeBridge": "0x9dcF9D205C9De35334D646BeE44b2D2859712A09", - "WormholeChainId": 4, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0xa512c06d85004930526b1Ab0452fDD3F5F0fC665", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x8337e5eF98af25012e1B39CD996772143f6c5fDf", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0xa14f18f74580F9A7A23e2B66262af8b1500d293E", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x6cE9E2c8b59bbcf65dA375D3d8AB503c8524caf7", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WAVAX" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x064a85eac6b4Bd7190BCAd3458dBD9459989c37B", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xB19693FEB013Bab65866dE0a845a9511064230cE", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x10F1053bF2884b28ee0Bd7a2dDBa237Af3511d29", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "BNB" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x71b7E25BE7879E042E55FBabD4037De116ae07e0", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x55Ff5acCE2f2751A5C5Af91fa7e9f1c00F283cFb", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "DstWormholeChainId": 10, - "SrcTokenAddress": "0xc95CEe06CF296479eBfA379e62D79C491fEc875D", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDC", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x6A14ccC52d89E0A7817CC65C43630f4D0515dDF9", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x51Bc652471dd4B236b278B6E98EC5dB8f020B934", - "SrcWormholeChainId": 4 - }, - { - "DstTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDT", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x48E4508054A82996667e0ca9C3543f57c53FA3C6", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x51Bc652471dd4B236b278B6E98EC5dB8f020B934", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "XBTC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::XBTC", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xf9471131e004dcdBF3325d0B9Fef49162739d87D", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "XBTC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x1::aptos_coin::AptosCoin", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x4A7Bd5E135f421057F97BbA8BCeeE5c18334f454", - "SrcWormholeChainId": 4 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "WAPT" - } - ] - }, - "ftm-test": { - "ChainId": 4002, - "SoDiamond": "0x0fC43efF06af401aD4D553B715c6C52766135706", - "StargateChainId": 10112, - "StargatePool": [ - { - "ChainPath": [ - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10109, - 1 - ], - [ - 10109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "TokenName": "USDC" - } - ], - "StargateRouter": "0xa73b0a56B29aD790595763e71505FCa2c1abb77f", - "UniswapRouter": [ - { - "Name": "UniswapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x6D481b9F59b22B6eB097b986fC06E438d585c039", - "TokenList": "", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0xf1277d1Ed8AD466beddF92ef448A132661956621", - "WormholeBridge": "0x599CEa2204B4FaECd584Ab1F2b6aCA137a0afbE8", - "WormholeChainId": 10, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0xc014D91f2843F111371e2fDEf519EB1fDE10751C", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "SrcWormholeChainId": 10 - }, - { - "DstTokenAddress": "0xc95CEe06CF296479eBfA379e62D79C491fEc875D", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "SrcWormholeChainId": 10 - }, - { - "DstTokenAddress": "0xF0df323AEAeB85bbC1e08177C4ED1c57FaD76D84", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "SrcWormholeChainId": 10 - }, - { - "DstTokenAddress": "0xd337379dEA1f5ea9cD4692668ffD3FD22F4910BE", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "SrcWormholeChainId": 10 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0d7A9Cdbb7C21E64825cF81750A5081a32aFb5d4", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 10 - }, - { - "DstTokenAddress": "0x84aa9100a36D6c3514605F62342abF3cE77D5b97", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 10 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "FTM" - } - ] - }, - "goerli": { - "ChainId": 5, - "OmniBtcChainId": 30002, - "SoDiamond": "0x12479EEF3EF33687f6b79d59aC6E387C7bc75A3F", - "StargateChainId": 10121, - "StargatePool": [], - "StargateRouter": "", - "UniswapRouter": [ - { - "Name": "UniswapV3", - "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", - "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "TokenList": "", - "Type": "ISwapRouter" - }, - { - "Name": "UniswapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", - "TokenList": "", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", - "WormholeBridge": "0xF890982f9310df57d00f659cf4fd87e65adEd8d7", - "WormholeChainId": 2, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0x51Bc652471dd4B236b278B6E98EC5dB8f020B934", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x52019f6ad6b15739Ec083A1e54EaF294a2dDfD6B", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x50c3f7B8ac1324A562c6532E30f516C5FBB9A20a", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x4C1b727f6df3B075E682C41a25687A69846aaC04", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WAVAX" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xB19693FEB013Bab65866dE0a845a9511064230cE", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WBNB" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 10, - "SrcTokenAddress": "0x0d7A9Cdbb7C21E64825cF81750A5081a32aFb5d4", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WFTM" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x064a85eac6b4Bd7190BCAd3458dBD9459989c37B", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xbB5A2dC896Ec4E2fa77F40FA630582ed9c6D0172", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xc6735cc74553Cc2caeB9F5e1Ea0A4dAe12ef4632", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "ETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xAC6331db5C84602F2F8dc4592bdeafE602C2a994", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x4e8c50d7c76991f8E058b58fA6C243670CeB1eda", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "DstWormholeChainId": 10, - "SrcTokenAddress": "0xc014D91f2843F111371e2fDEf519EB1fDE10751C", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xa512c06d85004930526b1Ab0452fDD3F5F0fC665", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "USDT" - } - ] - }, - "mainnet": { - "ChainId": 1, - "OmniBtcChainId": 2, - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateChainId": 101, - "StargatePool": [ - { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "TokenName": "USDC" - }, - { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 111, - 1 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "TokenName": "USDT" - }, - { - "ChainPath": [ - [ - 102, - 11 - ] - ], - "Decimal": 18, - "PoolId": 11, - "TokenAddress": "0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6", - "TokenName": "USDD" - }, - { - "ChainPath": [ - [ - 110, - 13 - ], - [ - 111, - 13 - ] - ], - "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0x72E2F4830b9E45d52F80aC08CB2bEC0FeF72eD9c", - "TokenName": "SGETH" - } - ], - "StargateRouter": "0x8731d54E9D02c286767d56ac03e8037C07e01e98", - "UniswapRouter": [ - { - "Name": "UniswapV3", - "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", - "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "TokenList": "", - "Type": "ISwapRouter" - }, - { - "Name": "UniswapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", - "TokenList": "https://tokens.uniswap.org/", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0xf1277d1Ed8AD466beddF92ef448A132661956621", - "WormholeBridge": "0x3ee18B2214AFF97000D974cf647E7C347E8fa585", - "WormholeChainId": 2, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "ETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x1::aptos_coin::AptosCoin", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "WAPT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "USDTbsc" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x418D75f65a02b3D53B2418FB8E1fe493759c7605", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x418D75f65a02b3D53B2418FB8E1fe493759c7605", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x442F7f22b1EE2c842bEAFf52880d4573E9201158", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x418D75f65a02b3D53B2418FB8E1fe493759c7605", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WBNB" - }, + "avax-test": { + "Bridges": { + "Celer": { + "Bridge": "0xe95E3a9f1a45B5EDa71781448F6047d7B7e31cbF", + "MessageBus": "0xE9533976C590200E32d95C53f06AE12d292cFc47", + "CelerChainId": 43113, + "SupportToken": { + "USDC": { + "Address": "0x2979a1cb90EEB9e75d7fB4f9813FCC40E4a7fD8b", + "ChainPath": [], + "Decimal": 6 + }, + "WETH": { + "Address": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "ChainPath": [], + "Decimal": 18 + } + } + } + }, + "ChainId": 43113, + "OmniBtcChainId": 30004, + "SoDiamond": "0xE68508c61c4f979B828cd1c8383676d93583Cae5", + "StargateChainId": 10106, + "StargatePool": [ { - "ChainPath": [ - { - "DstTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "SrcWormholeChainId": 2 - } - ], "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCpolygon" + "PoolId": 1, + "TokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", + "TokenName": "USDC" }, { - "ChainPath": [ - { - "DstTokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x9024B09C1C6D33221F6AeA9571821a2062B88eEf", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x038627d23Dacdc967087A57309F8139aeb99D8e4", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x9024B09C1C6D33221F6AeA9571821a2062B88eEf", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xD343968e46690D6C89A88a36a5B8CE5Fb5D65AC4", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x9024B09C1C6D33221F6AeA9571821a2062B88eEf", - "SrcWormholeChainId": 2 - } - ], "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTpolygon" + "PoolId": 2, + "TokenAddress": "0x134Dc38AE8C853D1aa2103d5047591acDAA16682", + "TokenName": "USDT" }, { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43", - "SrcWormholeChainId": 2 - } - ], "Decimal": 18, - "NativeToken": false, - "TokenName": "WMATIC" + "PoolId": 18, + "TokenAddress": "0xBA0E59ea011dD0d2C4A0B278Dd4D87932462AABb", + "TokenName": "USDT.m" }, { - "ChainPath": [ - { - "DstTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCavax" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x72B2095361926E72692DFd5986C5B0d2bc18bF1e", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x32279A16358B5B1EfE1b3412d3aab9CFEbC54B4d", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x72B2095361926E72692DFd5986C5B0d2bc18bF1e", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x4a618Df8E3e6f2E94D1F9bed94722e43b9fD97D5", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x72B2095361926E72692DFd5986C5B0d2bc18bF1e", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTavax" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x85f138bfEE4ef8e540890CFb48F620571d67Eda3", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a", - "DstWormholeChainId": 5, - "SrcTokenAddress": "0x85f138bfEE4ef8e540890CFb48F620571d67Eda3", - "SrcWormholeChainId": 2 - }, - { - "DstTokenAddress": "0x96412902aa9aFf61E13f085e70D3152C6ef2a817", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x85f138bfEE4ef8e540890CFb48F620571d67Eda3", - "SrcWormholeChainId": 2 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WAVAX" - } - ] - }, - "optimism-main": { - "ChainId": 10, - "OmniBtcChainId": 7, - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateChainId": 111, - "StargatePool": [ - { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 109, - 1 - ], - [ - 109, - 2 - ] - ], "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "TokenName": "USDC" + "PoolId": 19, + "TokenAddress": "0x134Dc38AE8C853D1aa2103d5047591acDAA16682", + "TokenName": "USDT" }, { - "ChainPath": [ - [ - 110, - 13 - ], - [ - 101, - 13 - ] - ], "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0xb69c8CBCD90A39D8D3d3ccf0a3E968511C3856A0", - "TokenName": "SGETH" + "PoolId": 20, + "TokenAddress": "0xB9926EC179A8c41De947d2b8db7034EC3FD727FF", + "TokenName": "WOO" } ], - "StargateRouter": "0xB0D502E938ed5f4df2E681fE6E419ff29631d62b", + "StargateRouter": "0x13093E05Eb890dfA6DacecBdE51d24DabAb2Faa1", "UniswapRouter": [ { - "Name": "UniswapV3", - "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", - "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "TokenList": "https://static.optimism.io/optimism.swap_tokenlist.json", - "Type": "ISwapRouter" - }, - { - "Name": "ZipSwapV2", + "Name": "DexLotV2", "QuoterAddressForUniswapV3": "", - "RouterAddress": "0xE6Df0BB08e5A97b40B21950a0A51b94c4DbA0Ff6", + "RouterAddress": "0x6D481b9F59b22B6eB097b986fC06E438d585c039", "TokenList": "", - "Type": "IUniswapV2Router02" + "Type": "IUniswapV2Router02AVAX" } ], - "WETH": "0x4200000000000000000000000000000000000006" - }, - "optimism-test": { - "ChainId": 69, - "OmniBtcChainId": 30007, - "SoDiamond": "0xC4bDB9667679a5ECD339Ac47e0C1CE0139D50b5b", - "StargateChainId": 10011, - "StargatePool": [ + "WETH": "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + "WormholeBridge": "0x61E44E506Ca5659E6c0bba9b678586fA2d729756", + "WormholeChainId": 6, + "WormholeSupportToken": [ { - "ChainPath": [ - [ - 10010, - 1 - ], - [ - 10010, - 2 - ], - [ - 10006, - 1 - ], - [ - 10006, - 2 - ], - [ - 10002, - 2 - ], - [ - 10002, - 5 - ], - [ - 10012, - 1 - ], - [ - 10009, - 1 - ], - [ - 10009, - 2 - ], - [ - 10001, - 1 - ], - [ - 10001, - 2 - ] - ], + "ChainPath": [], "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x567f39d9e6d02078F357658f498F80eF087059aa", + "NativeToken": true, + "TokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", "TokenName": "USDC" - }, - { - "ChainPath": [ - [ - 10010, - 10 - ], - [ - 10001, - 10 - ] - ], - "Decimal": 18, - "PoolId": 10, - "TokenAddress": "0xF8Ac33Bf8Ebf07722253514afAE0a0db73b9F033", - "TokenName": "WETH" - }, - { - "ChainPath": [ - [ - 10010, - 12 - ], - [ - 10001, - 12 - ] - ], - "Decimal": 18, - "PoolId": 12, - "TokenAddress": "0x54ab08953765079890B7d1ECE2701d5B8D5fa384", - "TokenName": "ETH" - }, - { - "ChainPath": [ - [ - 10010, - 13 - ], - [ - 10001, - 13 - ] - ], - "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0x8b299936aa5e0eEA763f55267ACcE7394F0d83C0", - "TokenName": "SGETH" - } - ], - "StargateRouter": "0xCC68641528B948642bDE1729805d6cf1DECB0B00", - "UniswapRouter": [ - { - "Name": "UniswapV3", - "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", - "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "TokenList": "", - "Type": "ISwapRouter" } - ], - "WETH": "0x4200000000000000000000000000000000000006" + ] }, - "polygon-main": { - "ChainId": 137, - "OmniBtcChainId": 5, - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateChainId": 109, + "goerli": { + "Bridges": { + "Celer": { + "Bridge": "0x358234B325EF9eA8115291A8b81b7d33A2Fa762D", + "MessageBus": "0xF25170F86E4291a99a9A560032Fe9948b8BcFBB2", + "CelerChainId": 5, + "SupportToken": { + "USDC": { + "Address": "0xCbE56b00d173A26a5978cE90Db2E33622fD95A28", + "ChainPath": [ + { + "DstChainId": 43113, + "DstAddress": "0x2979a1cb90EEB9e75d7fB4f9813FCC40E4a7fD8b", + "DstDecimal": 6 + } + ], + "Decimal": 6 + }, + "WETH": { + "Address": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", + "ChainPath": [], + "Decimal": 18 + } + } + } + }, + "ChainId": 5, + "OmniBtcChainId": 30002, + "SoDiamond": "0x43bBc3Be3FD1a26F62CA319E2eDEB5aB40d0e1D8", + "StargateChainId": 10121, "StargatePool": [ { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ] - ], "Decimal": 6, "PoolId": 1, - "TokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "TokenAddress": "0xDf0360Ad8C5ccf25095Aa97ee5F2785c8d848620", "TokenName": "USDC" }, { - "ChainPath": [ - [ - 110, - 1 - ], - [ - 110, - 2 - ], - [ - 106, - 1 - ], - [ - 106, - 2 - ], - [ - 102, - 2 - ], - [ - 102, - 5 - ], - [ - 101, - 1 - ], - [ - 101, - 2 - ], - [ - 111, - 1 - ] - ], "Decimal": 6, "PoolId": 2, - "TokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "TokenName": "USDT" - } - ], - "StargateRouter": "0x45A01E4e04F14f7A4a6702c74187c5F6222033cd", - "UniswapRouter": [ - { - "Name": "UniswapV3", - "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", - "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "TokenList": "", - "Type": "ISwapRouter" - }, - { - "Name": "QuickswapV2", - "QuoterAddressForUniswapV3": "", - "RouterAddress": "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", - "TokenList": "https://unpkg.com/quickswap-default-token-list@1.2.38/build/quickswap-default.swap_tokenlist.json", - "Type": "IUniswapV2Router02" - } - ], - "WETH": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", - "WormholeBridge": "0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE", - "WormholeChainId": 5, - "WormholeSupportToken": [ - { - "ChainPath": [ - { - "DstTokenAddress": "0x543672E9CBEC728CBBa9C3Ccd99ed80aC3607FA8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x672147dD47674757C457eB155BAA382cc10705Dd", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x566957eF80F9fd5526CD2BEF8BE67035C0b81130", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xc7160b1c2415d19a88add188ec726e62aab0045f0aed798106a2ef2994a9101e::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x038627d23Dacdc967087A57309F8139aeb99D8e4", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xD343968e46690D6C89A88a36a5B8CE5Fb5D65AC4", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x9024B09C1C6D33221F6AeA9571821a2062B88eEf", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "TokenAddress": "0x5BCc22abEC37337630C0E0dd41D64fd86CaeE951", "TokenName": "USDT" }, { - "ChainPath": [ - { - "DstTokenAddress": "0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xc836d8dC361E44DbE64c4862D55BA041F88Ddd39", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 5 - } - ], "Decimal": 18, - "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "MATIC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xB24CA28D4e2742907115fECda335b40dbda07a4C", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xB04906e95AB5D797aDA81508115611fee694c2b3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x4318CB63A2b8edf2De971E2F17F77097e499459D", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCeth" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x9d228444FC4B7E15A2C481b48E10247A03351FD8", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x9417669fBF23357D2774e9D421307bd5eA1006d2", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTeth" + "PoolId": 11, + "TokenAddress": "0x011eA8b05Fb53b0cfA1ED92F4862963290157553", + "TokenName": "USDD" }, { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x4db5a66e937a9f4473fa95b1caf1d1e1d62e29ea", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x8b82A291F83ca07Af22120ABa21632088fC92931", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x11cd37bb86f65419713f30673a480ea33c826872", - "SrcWormholeChainId": 5 - } - ], "Decimal": 18, - "NativeToken": false, - "TokenName": "WETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x1::aptos_coin::AptosCoin", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x2Ba98cf7Edd2c5C794e21bc3Dc6973D3C2585eE3", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x8CDf7AF57E4c8B930e1B23c477c22f076530585e", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x43c588459b3243fA541B98CC4B2E995b3de553A2", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xa4ef199d3ad524E9C3C51Ac46B303B103A307Cef", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "WAPT" + "PoolId": 13, + "TokenAddress": "0xCf1F9cD3789Fc6296f4abB11dc460067Ae1a2673", + "TokenName": "SGETH" }, { - "ChainPath": [ - { - "DstTokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xA67BCC0D06d7d13A13A2AE30bF30f1B434f5a28B", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xDe60aDfDdAAbaAAC3dAFa57B26AcC91Cb63728c4", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xacd014e8bdf395fa8497b6d585b164547a9d45269377bdf67c96c541b7fec9ed::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x07365017e2436b5C3553028DB2a98d7672fb75Eb", - "SrcWormholeChainId": 5 - } - ], "Decimal": 18, - "NativeToken": false, - "TokenName": "USDTbsc" + "PoolId": 17, + "TokenAddress": "0x9874A71b976DAA037741d18B86bC6b2F9957FC8A", + "TokenName": "METIS" }, { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x442F7f22b1EE2c842bEAFf52880d4573E9201158", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x418D75f65a02b3D53B2418FB8E1fe493759c7605", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xeCDCB5B88F8e3C15f95c720C51c71c9E2080525d", - "SrcWormholeChainId": 5 - } - ], "Decimal": 18, - "NativeToken": false, - "TokenName": "WBNB" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xc88Dc63bf0c8c8198C97Db0945E3eF25Ca89A8e4", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x39d84c2af3b0c9895b45d4da098049e382c451ba63bec0ce0396ff7af4bb5dff::coin::T", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0xAEA5CC14DefbC1b845FDE729E563B717Ee6825ae", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDCavax" + "PoolId": 18, + "TokenAddress": "0xde298b809Faeb82660933828B0c52BC329586765", + "TokenName": "USDT.m" }, { - "ChainPath": [ - { - "DstTokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x32279A16358B5B1EfE1b3412d3aab9CFEbC54B4d", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x4a618Df8E3e6f2E94D1F9bed94722e43b9fD97D5", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x32279A16358B5B1EfE1b3412d3aab9CFEbC54B4d", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x72B2095361926E72692DFd5986C5B0d2bc18bF1e", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x32279A16358B5B1EfE1b3412d3aab9CFEbC54B4d", - "SrcWormholeChainId": 5 - } - ], "Decimal": 6, - "NativeToken": false, - "TokenName": "USDTavax" + "PoolId": 19, + "TokenAddress": "0x5BCc22abEC37337630C0E0dd41D64fd86CaeE951", + "TokenName": "USDT" }, { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x96412902aa9aFf61E13f085e70D3152C6ef2a817", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x85f138bfEE4ef8e540890CFb48F620571d67Eda3", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x7Bb11E7f8b10E9e571E5d8Eace04735fDFB2358a", - "SrcWormholeChainId": 5 - } - ], "Decimal": 18, - "NativeToken": false, - "TokenName": "WAVAX" - } - ] - }, - "polygon-test": { - "ChainId": 80001, - "OmniBtcChainId": 30005, - "SoDiamond": "0xBae5BeAdBaa65628eA9DC5A5c7F794b4865c8771", - "StargateChainId": 10109, - "StargatePool": [ - { - "ChainPath": [ - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ] - ], - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "TokenName": "USDC" - }, - { - "ChainPath": [ - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ], - [ - 10106, - 1 - ], - [ - 10106, - 2 - ], - [ - 10102, - 2 - ], - [ - 10102, - 5 - ], - [ - 10112, - 1 - ] - ], - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0x6Fc340be8e378c2fF56476409eF48dA9a3B781a0", - "TokenName": "USDT" + "PoolId": 20, + "TokenAddress": "0xC9BA30be110864264577AD091C47F986318B213e", + "TokenName": "WOO" } ], - "StargateRouter": "0x817436a076060D158204d955E5403b6Ed0A5fac0", + "StargateRouter": "0x7612aE2a34E5A363E137De748801FB4c86499152", "UniswapRouter": [ + { + "Name": "UniswapV3", + "QuoterAddressForUniswapV3": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", + "RouterAddress": "0xE592427A0AEce92De3Edee1F18E0157C05861564", + "TokenList": "", + "Type": "ISwapRouter" + }, { "Name": "UniswapV2", "QuoterAddressForUniswapV3": "", - "RouterAddress": "0x8954AfA98594b838bda56FE4C12a09D7739D179b", + "RouterAddress": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", "TokenList": "", "Type": "IUniswapV2Router02" } ], - "WETH": "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889", - "WormholeBridge": "0x377D55a7928c046E18eEbb61977e714d2a76472a", - "WormholeChainId": 5, + "WETH": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", + "WormholeBridge": "0xF890982f9310df57d00f659cf4fd87e65adEd8d7", + "WormholeChainId": 2, "WormholeSupportToken": [ { - "ChainPath": [ - { - "DstTokenAddress": "0x4e8c50d7c76991f8E058b58fA6C243670CeB1eda", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x55Ff5acCE2f2751A5C5Af91fa7e9f1c00F283cFb", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0xF18BfDa8071eB9dc51aE47F46349cB98695E42C3", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 6, - "NativeToken": true, - "TokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x51f3D34651523dD8CC4872ee261A1B0B3f73AceF", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WAVAX" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0xc6735cc74553Cc2caeB9F5e1Ea0A4dAe12ef4632", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WETH" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x0000000000000000000000000000000000000000", - "DstWormholeChainId": 10, - "SrcTokenAddress": "0x84aa9100a36D6c3514605F62342abF3cE77D5b97", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 18, - "NativeToken": false, - "TokenName": "WFTM" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x78554394273957d7e55afC841aeA27Cce469AEd4", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x0000000000000000000000000000000000000000", - "SrcWormholeChainId": 5 - } - ], + "ChainPath": [], "Decimal": 18, "NativeToken": true, - "TokenAddress": "0x0000000000000000000000000000000000000000", - "TokenName": "MATIC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x4A0D1092E9df255cf95D72834Ea9255132782318", - "DstWormholeChainId": 6, - "SrcTokenAddress": "0x4Eef687C481CcBa613Dbf6b3245281C6f91aEc62", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", - "DstWormholeChainId": 10, - "SrcTokenAddress": "0xd337379dEA1f5ea9cD4692668ffD3FD22F4910BE", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDC", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x827e05D82f8f39b767Aca000F843588785dD1dce,", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 6, - "NativeToken": false, - "TokenName": "USDC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", - "DstWormholeChainId": 4, - "SrcTokenAddress": "0xa14f18f74580F9A7A23e2B66262af8b1500d293E", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "DstWormholeChainId": 2, - "SrcTokenAddress": "0x50c3f7B8ac1324A562c6532E30f516C5FBB9A20a", - "SrcWormholeChainId": 5 - }, - { - "DstTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::USDT", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x49cc9705f1Df944872239d7F04679Cf8841E854A,", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 18, - "NativeToken": false, + "TokenAddress": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", "TokenName": "USDT" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b::setup::XBTC", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x2baF26A3E7A6dfC3dF6E0aaB0DC8e0274729E35A,", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "XBTC" - }, - { - "ChainPath": [ - { - "DstTokenAddress": "0x1::aptos_coin::AptosCoin", - "DstWormholeChainId": 22, - "SrcTokenAddress": "0x226B436043B537BD158e84fA199E2Aa36bf364f8", - "SrcWormholeChainId": 5 - } - ], - "Decimal": 8, - "NativeToken": false, - "TokenName": "WAPT" } ] } -} +} \ No newline at end of file diff --git a/ethereum/export/StargateInfo.json b/ethereum/export/StargateInfo.json index 05f93b31..a68b1762 100644 --- a/ethereum/export/StargateInfo.json +++ b/ethereum/export/StargateInfo.json @@ -1,25 +1,4 @@ { - "avax-main": { - "bridge": "0x9d1B1669c73b033DFe47ae5a0164Ab96df25B944", - "endpoint": "0x3c2269811836af69497E5F486A85D7316753cf62", - "factory": "0x808d7c71ad2ba3FA531b068a2417C63106BC0949", - "pools": [ - { - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - "TokenName": "USDC" - }, - { - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", - "TokenName": "USDt" - } - ], - "router": "0x45A01E4e04F14f7A4a6702c74187c5F6222033cd", - "ultra_light_node": "0x4D73AdB72bC3DD368966edD0f0b2148401A178E2" - }, "avax-test": { "bridge": "0x29fBC4E4092Db862218c62a888a00F9521619230", "endpoint": "0x93f54D755A063cE7bB9e6Ac47Eccc8e33411d706", @@ -36,37 +15,28 @@ "PoolId": 2, "TokenAddress": "0x134Dc38AE8C853D1aa2103d5047591acDAA16682", "TokenName": "USDT" - } - ], - "router": "0x13093E05Eb890dfA6DacecBdE51d24DabAb2Faa1", - "ultra_light_node": "0xfDDAFFa49e71dA3ef0419a303a6888F94bB5Ba18" - }, - "bsc-main": { - "bridge": "0x6694340fc020c5E6B96567843da2df01b2CE1eb6", - "endpoint": "0x3c2269811836af69497E5F486A85D7316753cf62", - "factory": "0xe7Ec689f432f29383f217e36e680B5C855051f25", - "pools": [ + }, { "Decimal": 18, - "PoolId": 2, - "TokenAddress": "0x55d398326f99059fF775485246999027B3197955", - "TokenName": "USDT" + "PoolId": 18, + "TokenAddress": "0xBA0E59ea011dD0d2C4A0B278Dd4D87932462AABb", + "TokenName": "USDT.m" }, { - "Decimal": 18, - "PoolId": 5, - "TokenAddress": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", - "TokenName": "BUSD" + "Decimal": 6, + "PoolId": 19, + "TokenAddress": "0x134Dc38AE8C853D1aa2103d5047591acDAA16682", + "TokenName": "USDT" }, { "Decimal": 18, - "PoolId": 11, - "TokenAddress": "0xd17479997F34dd9156Deef8F95A52D81D265be9c", - "TokenName": "USDD" + "PoolId": 20, + "TokenAddress": "0xB9926EC179A8c41De947d2b8db7034EC3FD727FF", + "TokenName": "WOO" } ], - "router": "0x4a364f8c717cAAD9A442737Eb7b8A55cc6cf18D8", - "ultra_light_node": "0x4D73AdB72bC3DD368966edD0f0b2148401A178E2" + "router": "0x13093E05Eb890dfA6DacecBdE51d24DabAb2Faa1", + "ultra_light_node": "0xfDDAFFa49e71dA3ef0419a303a6888F94bB5Ba18" }, "bsc-test": { "bridge": "0xa1E105511416aEc3200CcE7069548cF332c6DCA2", @@ -90,6 +60,30 @@ "PoolId": 11, "TokenAddress": "0x8467C2439BC4C593aC8AAf0df4879b89F7Ab8a61", "TokenName": "USDD" + }, + { + "Decimal": 18, + "PoolId": 17, + "TokenAddress": "0x8362Af3426E6c7a77438f29bDc81C8f27CD541aB", + "TokenName": "METIS" + }, + { + "Decimal": 18, + "PoolId": 18, + "TokenAddress": "0xd3c17551966D63b7be839B7407861804c6D76b1a", + "TokenName": "USDT.m" + }, + { + "Decimal": 18, + "PoolId": 19, + "TokenAddress": "0xF49E250aEB5abDf660d643583AdFd0be41464EfD", + "TokenName": "USDT" + }, + { + "Decimal": 18, + "PoolId": 20, + "TokenAddress": "0x6Df6dB769dD1c845596F7E65a1c86c98d6147Cc3", + "TokenName": "WOO" } ], "router": "0xbB0f1be1E9CE9cB27EA5b0c3a85B7cc3381d8176", @@ -105,205 +99,72 @@ "PoolId": 1, "TokenAddress": "0x076488D244A73DA4Fa843f5A8Cd91F655CA81a1e", "TokenName": "USDC" + }, + { + "Decimal": 18, + "PoolId": 20, + "TokenAddress": "0x73E9Ad6Bb1dEE7F71d5D503A4d3081c9A12B5dD9", + "TokenName": "WOO" } ], "router": "0xa73b0a56B29aD790595763e71505FCa2c1abb77f", "ultra_light_node": "0x54109D468858d8f460587b7B4C1B950c9aB48CBd" }, - "goerli": [], - "mainnet": { - "bridge": "0x296F55F8Fb28E498B858d0BcDA06D955B2Cb3f97", - "endpoint": "0x66A71Dcef29A0fFBDBE3c6a460a3B5BC225Cd675", - "factory": "0x06D538690AF257Da524f25D0CD52fD85b1c2173E", + "goerli": { + "bridge": "0xE6612eB143e4B350d55aA2E229c80b15CA336413", + "endpoint": "0xbfD2135BFfbb0B5378b56643c2Df8a87552Bfa23", + "factory": "0xB30300c11FF54f8F674a9AA0777D8D5e9fefd652", "pools": [ { "Decimal": 6, "PoolId": 1, - "TokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "TokenAddress": "0xDf0360Ad8C5ccf25095Aa97ee5F2785c8d848620", "TokenName": "USDC" }, { "Decimal": 6, "PoolId": 2, - "TokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "TokenAddress": "0x5BCc22abEC37337630C0E0dd41D64fd86CaeE951", "TokenName": "USDT" }, { "Decimal": 18, "PoolId": 11, - "TokenAddress": "0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6", + "TokenAddress": "0x011eA8b05Fb53b0cfA1ED92F4862963290157553", "TokenName": "USDD" }, { "Decimal": 18, "PoolId": 13, - "TokenAddress": "0x72E2F4830b9E45d52F80aC08CB2bEC0FeF72eD9c", + "TokenAddress": "0xCf1F9cD3789Fc6296f4abB11dc460067Ae1a2673", "TokenName": "SGETH" - } - ], - "router": "0x8731d54E9D02c286767d56ac03e8037C07e01e98", - "ultra_light_node": "0x4D73AdB72bC3DD368966edD0f0b2148401A178E2" - }, - "polygon-main": { - "bridge": "0x9d1B1669c73b033DFe47ae5a0164Ab96df25B944", - "endpoint": "0x3c2269811836af69497E5F486A85D7316753cf62", - "factory": "0x808d7c71ad2ba3FA531b068a2417C63106BC0949", - "pools": [ - { - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "TokenName": "USDC" - }, - { - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "TokenName": "USDT" - } - ], - "router": "0x45A01E4e04F14f7A4a6702c74187c5F6222033cd", - "ultra_light_node": "0x4D73AdB72bC3DD368966edD0f0b2148401A178E2" - }, - "polygon-test": { - "bridge": "0x629B57D89b1739eE1C0c0fD9eab426306e11cF42", - "endpoint": "0xf69186dfBa60DdB133E91E9A4B5673624293d8F8", - "factory": "0x43c3a5348671D868ED9dD9BFDb2859bE984d262e", - "pools": [ - { - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x742DfA5Aa70a8212857966D491D67B09Ce7D6ec7", - "TokenName": "USDC" - }, - { - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0x6Fc340be8e378c2fF56476409eF48dA9a3B781a0", - "TokenName": "USDT" - } - ], - "router": "0x817436a076060D158204d955E5403b6Ed0A5fac0", - "ultra_light_node": "0x9272eE792c995b90a6d619974876BfFB0d7402fF" - }, - "optimism-main": { - "bridge": "0x701a95707A0290AC8B90b3719e8EE5b210360883", - "endpoint": "0x3c2269811836af69497E5F486A85D7316753cf62", - "factory": "0xE3B53AF74a4BF62Ae5511055290838050bf764Df", - "pools": [ - { - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "TokenName": "USDC" - }, - { - "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0xb69c8CBCD90A39D8D3d3ccf0a3E968511C3856A0", - "TokenName": "SGETH" - } - ], - "router": "0xB0D502E938ed5f4df2E681fE6E419ff29631d62b", - "ultra_light_node": "0x4D73AdB72bC3DD368966edD0f0b2148401A178E2" - }, - "optimism-test": { - "bridge": "0x87E8c9E141F896a4bB517e10A3cD6D610d597aaa", - "endpoint": "0x72aB53a133b27Fa428ca7Dc263080807AfEc91b5", - "factory": "0xF22293462b6551C818190F1EC67Ed80c18E4cDb4", - "pools": [ - { - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x567f39d9e6d02078F357658f498F80eF087059aa", - "TokenName": "USDC" }, { "Decimal": 18, - "PoolId": 10, - "TokenAddress": "0xF8Ac33Bf8Ebf07722253514afAE0a0db73b9F033", - "TokenName": "WETH" + "PoolId": 17, + "TokenAddress": "0x9874A71b976DAA037741d18B86bC6b2F9957FC8A", + "TokenName": "METIS" }, { "Decimal": 18, - "PoolId": 12, - "TokenAddress": "0x54ab08953765079890B7d1ECE2701d5B8D5fa384", - "TokenName": "ETH" + "PoolId": 18, + "TokenAddress": "0xde298b809Faeb82660933828B0c52BC329586765", + "TokenName": "USDT.m" }, - { - "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0x8b299936aa5e0eEA763f55267ACcE7394F0d83C0", - "TokenName": "SGETH" - } - ], - "router": "0xCC68641528B948642bDE1729805d6cf1DECB0B00", - "ultra_light_node": "0x5fa09a6E7c86F4c92f925A4e470a7B97759975d1" - }, - "arbitrum-main": { - "bridge": "0x352d8275AAE3e0c2404d9f68f6cEE084B5bEB3DD", - "endpoint": "0x3c2269811836af69497E5F486A85D7316753cf62", - "factory": "0x55bDb4164D28FBaF0898e0eF14a589ac09Ac9970", - "pools": [ { "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", - "TokenName": "USDC" - }, - { - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "PoolId": 19, + "TokenAddress": "0x5BCc22abEC37337630C0E0dd41D64fd86CaeE951", "TokenName": "USDT" }, { "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0x82CbeCF39bEe528B5476FE6d1550af59a9dB6Fc0", - "TokenName": "SGETH" - } - ], - "router": "0x53Bf833A5d6c4ddA888F69c22C88C9f356a41614", - "ultra_light_node": "0x4D73AdB72bC3DD368966edD0f0b2148401A178E2" - }, - "arbitrum-test": { - "bridge": "0x881f70A7d194cE618E0ae493Ae9707B4983Fe3E8", - "endpoint": "0x4D747149A57923Beb89f22E6B7B97f7D8c087A00", - "factory": "0x5f1daEe0Eb4c237635f970f132B28BD71fd618C9", - "pools": [ - { - "Decimal": 6, - "PoolId": 1, - "TokenAddress": "0x1EA8Fb2F671620767f41559b663b86B1365BBc3d", - "TokenName": "USDC" - }, - { - "Decimal": 6, - "PoolId": 2, - "TokenAddress": "0x385182a81b05Be437416e100F4b7fAB2C2e9a8Ed", - "TokenName": "USDT" - }, - { - "Decimal": 18, - "PoolId": 10, - "TokenAddress": "0xbC2b378C03f86BBC4523B05e1343751d635b0FBA", - "TokenName": "WETH" - }, - { - "Decimal": 18, - "PoolId": 12, - "TokenAddress": "0x7279cbFcE0420d7Eb9C64F8C0d4454E4801baaC0", - "TokenName": "ETH" - }, - { - "Decimal": 18, - "PoolId": 13, - "TokenAddress": "0x1450e45e7345c4f6967b2A7DD91d9b0D3f65ff83", - "TokenName": "SGETH" + "PoolId": 20, + "TokenAddress": "0xC9BA30be110864264577AD091C47F986318B213e", + "TokenName": "WOO" } ], - "router": "0x6701D9802aDF674E524053bd44AA83ef253efc41", - "ultra_light_node": "0x19fEe87F426Dcf5446d6e259A1eCED85DF2f2849" + "router": "0x7612aE2a34E5A363E137De748801FB4c86499152", + "ultra_light_node": "0x6f3a314C1279148E53f51AF154817C3EF2C827B1" } } \ No newline at end of file diff --git a/ethereum/export/abi/ICelerBridge.json b/ethereum/export/abi/ICelerBridge.json new file mode 100644 index 00000000..df26acf0 --- /dev/null +++ b/ethereum/export/abi/ICelerBridge.json @@ -0,0 +1,314 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "transferId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "dstChainId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxSlippage", + "type": "uint32" + } + ], + "name": "Send", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "maxSend", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "minSend", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimalMaxSlippage", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeWrap", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_relayRequest", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "_sigs", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "_signers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_powers", + "type": "uint256[]" + } + ], + "name": "relay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "_dstChainId", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "_maxSlippage", + "type": "uint32" + } + ], + "name": "send", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "_dstChainId", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "_maxSlippage", + "type": "uint32" + } + ], + "name": "sendNative", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transferId", + "type": "bytes32" + } + ], + "name": "transfers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_msg", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "_sigs", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "_signers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_powers", + "type": "uint256[]" + } + ], + "name": "verifySigs", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_wdmsg", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "_sigs", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "_signers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_powers", + "type": "uint256[]" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "withdrawId", + "type": "bytes32" + } + ], + "name": "withdraws", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/ethereum/export/abi/SoDiamond.json b/ethereum/export/abi/SoDiamond.json index f332608a..0792edb4 100644 --- a/ethereum/export/abi/SoDiamond.json +++ b/ethereum/export/abi/SoDiamond.json @@ -3971,6 +3971,1435 @@ "stateMutability": "pure", "type": "function" }, + { + "inputs": [], + "name": "CannotBridgeToSameNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "ContractCallNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConfig", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidContract", + "type": "error" + }, + { + "inputs": [], + "name": "NativeAssetTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "NoSwapDataProvided", + "type": "error" + }, + { + "inputs": [], + "name": "NoSwapFromZeroBalance", + "type": "error" + }, + { + "inputs": [], + "name": "NoTransferToNullAddress", + "type": "error" + }, + { + "inputs": [], + "name": "NotSupportedSwapRouter", + "type": "error" + }, + { + "inputs": [], + "name": "NullAddrIsNotAValidSpender", + "type": "error" + }, + { + "inputs": [], + "name": "NullAddrIsNotAnERC20Token", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyError", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "messageBus", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + } + ], + "name": "CelerInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "srcTxId", + "type": "bytes32" + } + ], + "name": "RefundCelerToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "messageBus", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isAllowed", + "type": "bool" + } + ], + "name": "SetAllowedList", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "messageBus", + "type": "address" + } + ], + "name": "SetMessageBus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "receiveAmount", + "type": "uint256" + } + ], + "name": "SoTransferCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "revertReason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "otherReason", + "type": "bytes" + } + ], + "name": "SoTransferFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + } + ], + "name": "SoTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "celerTransferId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "srcCelerChainId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "dstCelerChainId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "bridgeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bridgeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "TransferFromCeler", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "actualReserve", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "estimateReserve", + "type": "uint256" + } + ], + "name": "UpdateCelerReserve", + "type": "event" + }, + { + "inputs": [], + "name": "GasPerByte", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RAY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "transactionId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "sourceChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "destinationChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISo.NormalizedSoData", + "name": "soData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "maxSlippage", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "dstCelerChainId", + "type": "uint64" + }, + { + "internalType": "address", + "name": "bridgeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dstMaxGasPriceInWeiForExecutor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estimateCost", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "dstSoDiamond", + "type": "address" + } + ], + "internalType": "struct CelerFacet.CelerData", + "name": "celerData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "callTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "approveTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "fromAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct LibSwap.NormalizedSwapData[]", + "name": "swapDataDst", + "type": "tuple[]" + } + ], + "name": "checkExecutorFee", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "celerPayload", + "type": "bytes" + } + ], + "name": "decodeCelerPayload", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "transactionId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "sourceChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "destinationChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISo.NormalizedSoData", + "name": "soDataNo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "callTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "approveTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "fromAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct LibSwap.NormalizedSwapData[]", + "name": "swapDataDstNo", + "type": "tuple[]" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "transactionId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "sourceChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "destinationChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISo.NormalizedSoData", + "name": "soDataNo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "callTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "approveTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "fromAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct LibSwap.NormalizedSwapData[]", + "name": "swapDataDstNo", + "type": "tuple[]" + } + ], + "name": "encodeCelerPayload", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "dstCelerChainId", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "dstMaxGasPriceInWeiForExecutor", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "transactionId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "sourceChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "destinationChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISo.NormalizedSoData", + "name": "soDataNo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "callTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "approveTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "fromAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct LibSwap.NormalizedSwapData[]", + "name": "swapDataDstNo", + "type": "tuple[]" + }, + { + "internalType": "bool", + "name": "is_actual", + "type": "bool" + } + ], + "name": "estCelerMessageFeeAndExecutorFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "internalType": "address payable", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint16", + "name": "sourceChainId", + "type": "uint16" + }, + { + "internalType": "address", + "name": "sendingAssetId", + "type": "address" + }, + { + "internalType": "uint16", + "name": "destinationChainId", + "type": "uint16" + }, + { + "internalType": "address", + "name": "receivingAssetId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISo.SoData", + "name": "soData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "callTo", + "type": "address" + }, + { + "internalType": "address", + "name": "approveTo", + "type": "address" + }, + { + "internalType": "address", + "name": "sendingAssetId", + "type": "address" + }, + { + "internalType": "address", + "name": "receivingAssetId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fromAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct LibSwap.SwapData[]", + "name": "swapData", + "type": "tuple[]" + } + ], + "name": "executeAndCheckSwaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_sender", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_srcChainId", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + } + ], + "name": "executeMessage", + "outputs": [ + { + "internalType": "enum ICelerMessageReceiver.ExecutionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_srcChainId", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + } + ], + "name": "executeMessage", + "outputs": [ + { + "internalType": "enum ICelerMessageReceiver.ExecutionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "executeMessageWithTransfer", + "outputs": [ + { + "internalType": "enum ICelerMessageReceiver.ExecutionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "_srcChainId", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + } + ], + "name": "executeMessageWithTransferFallback", + "outputs": [ + { + "internalType": "enum ICelerMessageReceiver.ExecutionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "executeMessageWithTransferRefund", + "outputs": [ + { + "internalType": "enum ICelerMessageReceiver.ExecutionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "dstChainId", + "type": "uint64" + } + ], + "name": "getBaseGas", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "messageBus", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "getCelerMessageFee1", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "getCelerMessageFee2", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "getCelerSoFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getExecutorFeeTo", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "messageBus", + "type": "address" + } + ], + "name": "getNativeWrap", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "messageBus", + "type": "address" + }, + { + "internalType": "uint64", + "name": "chainId", + "type": "uint64" + } + ], + "name": "initCeler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "messageBus", + "type": "address" + }, + { + "internalType": "bool", + "name": "isAllowed", + "type": "bool" + } + ], + "name": "setAllowedAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64[]", + "name": "dstChainIds", + "type": "uint64[]" + }, + { + "internalType": "uint256", + "name": "dstBaseGas", + "type": "uint256" + } + ], + "name": "setBaseGas", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualReserve", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estimateReserve", + "type": "uint256" + } + ], + "name": "setCelerReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeTo", + "type": "address" + } + ], + "name": "setExecutorFeeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "setNonce", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "transactionId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "sourceChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "uint16", + "name": "destinationChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISo.NormalizedSoData", + "name": "soDataNo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "callTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "approveTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "fromAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct LibSwap.NormalizedSwapData[]", + "name": "swapDataSrcNo", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "maxSlippage", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "dstCelerChainId", + "type": "uint64" + }, + { + "internalType": "address", + "name": "bridgeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dstMaxGasPriceInWeiForExecutor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estimateCost", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "dstSoDiamond", + "type": "address" + } + ], + "internalType": "struct CelerFacet.CelerData", + "name": "celerData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "callTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "approveTo", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "sendingAssetId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "receivingAssetId", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "fromAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct LibSwap.NormalizedSwapData[]", + "name": "swapDataDstNo", + "type": "tuple[]" + } + ], + "name": "soSwapViaCeler", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "NoSwapFromZeroBalance", diff --git a/ethereum/export/mainnet/CelerChainPath.json b/ethereum/export/mainnet/CelerChainPath.json new file mode 100644 index 00000000..0af0224f --- /dev/null +++ b/ethereum/export/mainnet/CelerChainPath.json @@ -0,0 +1,602 @@ +{ + "arbitrum-main": { + "Bridge": "0x1619DE6B6B20eD217a58d00f37B9d47C7663feca", + "CelerChainId": "42161", + "MessageBus": "0x3ad9d0648cdaa2426331e894e980d0a5ed16257f", + "SupportToken": { + "USDC": { + "Address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + "ChainPath": [ + { + "Address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "USDT": { + "Address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "ChainPath": [ + { + "Address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x55d398326f99059fF775485246999027B3197955", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "WETH": { + "Address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "ChainPath": [ + { + "Address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "CelerChainId": 1, + "Decimal": 18 + }, + { + "Address": "0x4200000000000000000000000000000000000006", + "CelerChainId": 10, + "Decimal": 18 + }, + { + "Address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + "CelerChainId": 137, + "Decimal": 18 + }, + { + "Address": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + "CelerChainId": 43114, + "Decimal": 18 + }, + { + "Address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 18 + } + } + }, + "avax-main": { + "Bridge": "0xef3c714c9425a8F3697A9C969Dc1af30ba82e5d4", + "CelerChainId": "43114", + "MessageBus": "0x5a926eeeafc4d217add17e9641e8ce23cd01ad57", + "SupportToken": { + "USDC": { + "Address": "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + "ChainPath": [ + { + "Address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "USDT": { + "Address": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + "ChainPath": [ + { + "Address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0x55d398326f99059fF775485246999027B3197955", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "WETH": { + "Address": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + "ChainPath": [ + { + "Address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "CelerChainId": 1, + "Decimal": 18 + }, + { + "Address": "0x4200000000000000000000000000000000000006", + "CelerChainId": 10, + "Decimal": 18 + }, + { + "Address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + "CelerChainId": 137, + "Decimal": 18 + }, + { + "Address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "CelerChainId": 42161, + "Decimal": 18 + }, + { + "Address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 18 + } + } + }, + "bsc-main": { + "Bridge": "0xdd90E5E87A2081Dcf0391920868eBc2FFB81a1aF", + "CelerChainId": "56", + "MessageBus": "0x95714818fdd7a5454f73da9c777b3ee6ebaeea6b", + "SupportToken": { + "USDC": { + "Address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + "ChainPath": [ + { + "Address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + "CelerChainId": 43114, + "Decimal": 6 + } + ], + "Decimal": 18 + }, + "USDT": { + "Address": "0x55d398326f99059fF775485246999027B3197955", + "ChainPath": [ + { + "Address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + "CelerChainId": 43114, + "Decimal": 6 + } + ], + "Decimal": 18 + }, + "WETH": { + "Address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "ChainPath": [ + { + "Address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "CelerChainId": 1, + "Decimal": 18 + }, + { + "Address": "0x4200000000000000000000000000000000000006", + "CelerChainId": 10, + "Decimal": 18 + }, + { + "Address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + "CelerChainId": 137, + "Decimal": 18 + }, + { + "Address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "CelerChainId": 42161, + "Decimal": 18 + }, + { + "Address": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + "CelerChainId": 43114, + "Decimal": 18 + } + ], + "Decimal": 18 + } + } + }, + "mainnet": { + "Bridge": "0x5427FEFA711Eff984124bFBB1AB6fbf5E3DA1820", + "CelerChainId": "1", + "MessageBus": "0x4066d196a423b2b3b8b054f4f40efb47a74e200c", + "SupportToken": { + "USDC": { + "Address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "ChainPath": [ + { + "Address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "USDT": { + "Address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "ChainPath": [ + { + "Address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x55d398326f99059fF775485246999027B3197955", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "WETH": { + "Address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "ChainPath": [ + { + "Address": "0x4200000000000000000000000000000000000006", + "CelerChainId": 10, + "Decimal": 18 + }, + { + "Address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + "CelerChainId": 137, + "Decimal": 18 + }, + { + "Address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "CelerChainId": 42161, + "Decimal": 18 + }, + { + "Address": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + "CelerChainId": 43114, + "Decimal": 18 + }, + { + "Address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 18 + } + } + }, + "optimism-main": { + "Bridge": "0x9D39Fc627A6d9d9F8C831c16995b209548cc3401", + "CelerChainId": "10", + "MessageBus": "0x0D71D18126E03646eb09FEc929e2ae87b7CAE69d", + "SupportToken": { + "USDC": { + "Address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "ChainPath": [ + { + "Address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "USDT": { + "Address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "ChainPath": [ + { + "Address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "CelerChainId": 137, + "Decimal": 6 + }, + { + "Address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x55d398326f99059fF775485246999027B3197955", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "WETH": { + "Address": "0x4200000000000000000000000000000000000006", + "ChainPath": [ + { + "Address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "CelerChainId": 1, + "Decimal": 18 + }, + { + "Address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + "CelerChainId": 137, + "Decimal": 18 + }, + { + "Address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "CelerChainId": 42161, + "Decimal": 18 + }, + { + "Address": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + "CelerChainId": 43114, + "Decimal": 18 + }, + { + "Address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 18 + } + } + }, + "polygon-main": { + "Bridge": "0x88DCDC47D2f83a99CF0000FDF667A468bB958a78", + "CelerChainId": "137", + "MessageBus": "0xaFDb9C40C7144022811F034EE07Ce2E110093fe6", + "SupportToken": { + "USDC": { + "Address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "ChainPath": [ + { + "Address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "USDT": { + "Address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "ChainPath": [ + { + "Address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "CelerChainId": 1, + "Decimal": 6 + }, + { + "Address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "CelerChainId": 10, + "Decimal": 6 + }, + { + "Address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "CelerChainId": 42161, + "Decimal": 6 + }, + { + "Address": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + "CelerChainId": 43114, + "Decimal": 6 + }, + { + "Address": "0x55d398326f99059fF775485246999027B3197955", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 6 + }, + "WETH": { + "Address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + "ChainPath": [ + { + "Address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "CelerChainId": 1, + "Decimal": 18 + }, + { + "Address": "0x4200000000000000000000000000000000000006", + "CelerChainId": 10, + "Decimal": 18 + }, + { + "Address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "CelerChainId": 42161, + "Decimal": 18 + }, + { + "Address": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + "CelerChainId": 43114, + "Decimal": 18 + }, + { + "Address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "CelerChainId": 56, + "Decimal": 18 + } + ], + "Decimal": 18 + } + } + } +} \ No newline at end of file diff --git a/ethereum/export/mainnet/ContractDeployed.json b/ethereum/export/mainnet/ContractDeployed.json index 83f155d2..8bcde667 100644 --- a/ethereum/export/mainnet/ContractDeployed.json +++ b/ethereum/export/mainnet/ContractDeployed.json @@ -1,161 +1,96 @@ { "arbitrum-main": { + "CelerFacet": "0x930b39EcEA81678a5033aa3c9Cc1f804fFEE004e", "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0xe37890304741ced9daEbcEe614810f9848df8c39", - "LibCorrectSwapV1": "0xa19d570d65Ff031331dFD453faC2F94bF2bdE405", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", - "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xDbcF392931212Bfd303d75046B88fD9b026cdaEA", - "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04" - }, - "optimism-main": { - "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", - "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", - "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0xDBA05e1Bf0c027Ab59eA0f166C941C2D55ae8440", + "GenericSwapFacet": "0x6aa49FA53d372329de88160017f9ca7C5d3338bE", "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", + "LibSoFeeCelerV1": "0x937AfcA1bb914405D37D55130184ac900ce5961f", "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0x68aEcD6f5b0Df5b85c55BE8b0563f788dC8b9AF0", + "StargateFacet": "0x96568bF35abeeb6C39910f6672f8e3fbEB1dB303", "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04" }, "avax-main": { + "CelerFacet": "0x13Ee92DFCa712CD3623b2A9ecF3A8f6723674AAA", "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0x26bda683F874e7AE3e3A5d3fad44Bcb82a7c107C", + "GenericSwapFacet": "0x0b6F43c227e7eaE042dd0aCf3F6a46A12FEFC7f3", "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", + "LibSoFeeCelerV1": "0x7e482c0DA0481414311097cF058f0E64B20c9D6C", "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", "LibSoFeeWormholeV1": "0xd3e0550D3e4Bc3E02C89377B1586261904F5E1db", "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", "SerdeFacet": "0x73bdB15AAa8797a37cdfa236ca4FC9d6E5a223aD", "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0x68aEcD6f5b0Df5b85c55BE8b0563f788dC8b9AF0", + "StargateFacet": "0x4293c37140Be04430709cA52790334F56731c166", "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0xA7Bfb2449036DEeFC06c1Bf960A820F87f79738e" - }, - "avax-test": { - "DexManagerFacet": "0x247Ef9D9221e05F5fFEa81e22e5fdd295668f2c4", - "DiamondCutFacet": "0x43C37D2F0Df9302e39e545E7C3e2598251f563aB", - "DiamondLoupeFacet": "0xe5DDd6b5d104c3aC9671277108107813D9Fe75A0", - "GenericSwapFacet": "0x575Aaba867454C1c39367BcD9B9052353aac9004", - "LibCorrectSwapV1": "0x1763C19701Ad4171472c21e9764343Eb097ED1ba", - "LibSoFeeStargateV1": "0x0549B67d255a751958d1075743A121c027146C33", - "LibSoFeeWormholeV1": "0xF845891F46655244dEB3deb651D8fb1E2e4f006a", - "OwnershipFacet": "0x1917d93A69f6A1F83821011414f8aAFaA64795B6", - "SerdeFacet": "0xF08729b93b97E0fA05895e90F1E42F4eE0620071", - "SoDiamond": "0x802e05b91769342af3F0d13f9DC6Df03a54C2ac7", - "StargateFacet": "0x4A665F39C236a29CdE4b9859E8882E41DC7FcA2D", - "WithdrawFacet": "0x24DEeDaC97FdC08752228E64bB8b2201E370f3d4", - "WormholeFacet": "0xeE6EBDf4263701fB700dBc48A2088d23c5Df8a88" + "WormholeFacet": "0xFc6e7902EcDD5C2Ae7502e2F869f2213B4BF2249" }, "bsc-main": { + "CelerFacet": "0xF7231a00E08904b064Af8d9436d37286c36751E1", "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0xc92C35cb3958c44b36173B4CD278BB81794870e0", + "GenericSwapFacet": "0xFc6e7902EcDD5C2Ae7502e2F869f2213B4BF2249", "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", + "LibSoFeeCelerV1": "0xD7eC4E3DaC58e537Eb24fef4c3F7B011aeA50f30", "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", "LibSoFeeWormholeV1": "0xda7bc7A71142b6283BEE9206FE2B13c5faF5193B", "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", "SerdeFacet": "0x99e010315c78FC03451352A4766243D163fC0e6A", "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xa19d570d65Ff031331dFD453faC2F94bF2bdE405", + "StargateFacet": "0x493D322e2Fc4330141658FccEbEFfa77A15e2dDE", "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0x01c49cF47dCF62769466738a179F94d51ea8BDdB" - }, - "bsc-test": { - "DexManagerFacet": "0x098D26E4d2E98C1Dde14C543Eb6804Fd98Af9CB4", - "DiamondCutFacet": "0x2B9aD416b22f19c93292E1Fd890C0a6B684C8F69", - "DiamondLoupeFacet": "0xAb937e03354a941d723feB715Fb73C28F2E30Fbe", - "GenericSwapFacet": "0xc80aF1c8ec82C975910e00fb3a466c6A925A6553", - "LibCorrectSwapV1": "0xfdA7DC4Dd75672d3142fCF8b1DE952e33edcb65b", - "LibSoFeeStargateV1": "0xE38226293E17D4944B4929967DfD3aB4647a7E0A", - "LibSoFeeWormholeV1": "0xc8DF0654252B27Ccd3Aa73f683306902920446Ac", - "OwnershipFacet": "0xBD1930dd4cd4e18737c7BcDACACFe450f1D231ba", - "SerdeFacet": "0xA2c78CAB334E3D78096bFF71A817FB472DD21A55", - "SoDiamond": "0xEe05F9e2651EBC5dbC66aD54241C6AB24E361228", - "StargateFacet": "0xEBb6a1d17Ae9A276EdE95bF6B8fC6527fa2dF737", - "WithdrawFacet": "0xF30456B67444f20d1D35aCC1280E165c43262442", - "WormholeFacet": "0x6F5b4Bc793aE7213564501aB22c714e39f5D2BAC" - }, - "ftm-test": { - "DexManagerFacet": "0xd6bAA4d4F5E78FB5314476Df8D023b35676C0f9A", - "DiamondCutFacet": "0xDf0aFC545A3E819a7B69cD2D92df69Fa64606748", - "DiamondLoupeFacet": "0x3b10Cb8830a10E41A00d41C34beD8C58D5A1De78", - "GenericSwapFacet": "0x53e2d8F6591C0eA280cCf4869122AE308e677026", - "LibCorrectSwapV1": "0xf704E4FCA4Ed2c45270Ef1a3bEFb14f71d1fa56b", - "LibSoFeeStargateV1": "0x2967e56c9406E680f7A6bf37E963aD4954Fe58D7", - "LibSoFeeWormholeV1": "0xE5E43f7284345d0eB6965134079451137138F81f", - "OwnershipFacet": "0x0b0Bf3269Ff6E234b06Ca25bfAfd29e46e3924A7", - "SerdeFacet": "0x8180f2E7c6f61eCb664Cd8619957a0C059F335F6", - "SoDiamond": "0x0fC43efF06af401aD4D553B715c6C52766135706", - "StargateFacet": "0x65d63d0025174380aA49bDFb87FF2E294Eedf6EE", - "WithdrawFacet": "0xb4Ede7c21291737289081cfA1D6a75D1F3770ae5", - "WormholeFacet": "0xe30CE8062cCA6475648BcfB067af57dA0A545829" - }, - "goerli": { - "DexManagerFacet": "0x78B9C9e53DD688251a3B2CeF25957804Bb94575c", - "DiamondCutFacet": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "DiamondLoupeFacet": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", - "GenericSwapFacet": "0x135E6130E3f33e7735DcE35dCc14D32423cAE1ed", - "LibCorrectSwapV1": "0xa19d570d65Ff031331dFD453faC2F94bF2bdE405", - "LibSoFeeStargateV1": "0xf59E065d16767f934e48DFfFE35c69402082c9BB", - "LibSoFeeWormholeV1": "0x68aEcD6f5b0Df5b85c55BE8b0563f788dC8b9AF0", - "OwnershipFacet": "0xfBA94Cf31f47966D89EF689edF59bc37fC84ca9c", - "SerdeFacet": "0xbD4713c1A5F7136b3B6Bc606353f1F71c47bA239", - "SoDiamond": "0x12479EEF3EF33687f6b79d59aC6E387C7bc75A3F", - "StargateFacet": "0xfDa613cb7366b1812F2d33fC95D1d4DD3896aeb8", - "WithdrawFacet": "0xf9d4C04cA77FA71Cf8f2BbA44994cd38107d356E", - "WormholeFacet": "0xacCA63aA138997602b2771E2aF6B7cfc643aa027" + "WormholeFacet": "0x72335F9a83d6468B7Bdf64e25A511D5A719f3Cf2" }, "mainnet": { + "CelerFacet": "0x71834892FE8D818bc892AF4c6D0FecbBF0B46cC2", "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0x26bda683F874e7AE3e3A5d3fad44Bcb82a7c107C", + "GenericSwapFacet": "0x9C2d7582b8515E79EBE33b54B81A2E900e5d3d14", "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", + "LibSoFeeCelerV1": "0xf5110f6211a9202c257602CdFb055B161163a99d", "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", "LibSoFeeWormholeV1": "0x01c49cF47dCF62769466738a179F94d51ea8BDdB", "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", "SerdeFacet": "0x3462F4D39DD02848373db75Bc64665DDc3d0895A", "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xba661e8482D62d3B33751961780df04Aab373eA5", + "StargateFacet": "0x72335F9a83d6468B7Bdf64e25A511D5A719f3Cf2", "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0x1061A15dc5b44593cae9fFE7031f396da0970824" + "WormholeFacet": "0x681bC51FC82bbA792e94e6187B82859f1E982C24" + }, + "optimism-main": { + "CelerFacet": "0xD8dec96b9E22a99f68D48CfB20cd6868a3dcc56b", + "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", + "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", + "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", + "GenericSwapFacet": "0x0Ba1195D53465057d137cf3C62e702c1a518BaC6", + "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", + "LibSoFeeCelerV1": "0x19370bE0D726A88d3e6861301418f3daAe3d798E", + "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", + "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", + "StargateFacet": "0x86E5Be03BAfB585E3e8295fcA717728BB7465898", + "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04" }, "polygon-main": { + "CelerFacet": "0x4E218F45E37f940Eb503b3b9F31426110059d672", "DexManagerFacet": "0x0917923Af85aB3aDab081e3B8825fccEddBB889c", "DiamondCutFacet": "0xDAE4Db475ACA613a5e2DC5fC304dA7e962B3cEaD", "DiamondLoupeFacet": "0xE4D1ebF03742a8238b546980261507FdE0113D37", - "GenericSwapFacet": "0x26bda683F874e7AE3e3A5d3fad44Bcb82a7c107C", + "GenericSwapFacet": "0xE27DF1829Cd5264Fe26A5E5993Eb94FffFF9a9c5", "LibCorrectSwapV1": "0x66F440252fe99454df8F8e1EB7743EA08FE7D8e2", + "LibSoFeeCelerV1": "0xb7e02565426d47174fF4231D490Ff6B827306377", "LibSoFeeStargateV1": "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449", - "LibSoFeeWormholeV1": "0xd3e0550D3e4Bc3E02C89377B1586261904F5E1db", + "LibSoFeeWormholeV1": "0x01c49cF47dCF62769466738a179F94d51ea8BDdB", "OwnershipFacet": "0xAD85421c47e9B830602deb83fCF149c2A1f0e8A9", "SerdeFacet": "0x1565F02EdFfD282F73FbA8C640ed70b27f91f1Fd", "SoDiamond": "0x2967E7Bb9DaA5711Ac332cAF874BD47ef99B3820", - "StargateFacet": "0xba661e8482D62d3B33751961780df04Aab373eA5", + "StargateFacet": "0x8BcD20ad0a171ceF6e4Ac4a64bd590247a8cF141", "WithdrawFacet": "0xa7487A536968Be0D563901aeb3Fc07B099e2fb04", - "WormholeFacet": "0x0F4aedfB8DA8aF176DefF282DA86EBbe3A0EA19e" - }, - "polygon-test": { - "DexManagerFacet": "0xB658abEd5457103f71B065A76A9Ed3C1fD88c591", - "DiamondCutFacet": "0x83Fb8c9D06CFDF82fdF3414C6BAF956634728755", - "DiamondLoupeFacet": "0x351174D07eAE909aa4b4483D03f8359fFAc3aB9D", - "GenericSwapFacet": "0x62c7bc10E5b4f5eb03fAD828d2C20c1C6269bd5f", - "LibCorrectSwapV1": "0x2ef6665Df2E2a87F610fF46AbA11d69BD3ab5d2e", - "LibSoFeeStargateV1": "0x96Ae044BEdC774669d1AD03D7B33F4241eC5c42C", - "LibSoFeeWormholeV1": "0x472F1c1B51B1e2dC022e9Eb9673c1F2f23df6E72", - "OwnershipFacet": "0xFFC1BC8A516C6B0EF5D3a5652a70e722Acf8f9C9", - "SerdeFacet": "0xb7e02565426d47174fF4231D490Ff6B827306377", - "SoDiamond": "0xBae5BeAdBaa65628eA9DC5A5c7F794b4865c8771", - "StargateFacet": "0x4E218F45E37f940Eb503b3b9F31426110059d672", - "WithdrawFacet": "0x2481c0B9cb3ef571Ea39bc013716d3f4879BA626", - "WormholeFacet": "0x1ac958477e0873D7039B2B71ae89B51d3248fA4F" + "WormholeFacet": "0x184b4176aebc4598190aa2FFAFFa86c07D2102C7" } -} \ No newline at end of file +} diff --git a/ethereum/export/mainnet/TmpCelerBridgeToken.json b/ethereum/export/mainnet/TmpCelerBridgeToken.json new file mode 100644 index 00000000..ef87cc84 --- /dev/null +++ b/ethereum/export/mainnet/TmpCelerBridgeToken.json @@ -0,0 +1,86 @@ +{ + "1": { + "USDC": { + "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "decimal": 6 + }, + "USDT": { + "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "decimal": 6 + }, + "WETH": { + "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "decimal": 18 + } + }, + "10": { + "USDC": { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "decimal": 6 + }, + "USDT": { + "address": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + "decimal": 6 + }, + "WETH": { + "address": "0x4200000000000000000000000000000000000006", + "decimal": 18 + } + }, + "137": { + "USDC": { + "address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "decimal": 6 + }, + "USDT": { + "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "decimal": 6 + }, + "WETH": { + "address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + "decimal": 18 + } + }, + "42161": { + "USDC": { + "address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", + "decimal": 6 + }, + "USDT": { + "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + "decimal": 6 + }, + "WETH": { + "address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "decimal": 18 + } + }, + "43114": { + "USDC": { + "address": "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + "decimal": 6 + }, + "USDT": { + "address": "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + "decimal": 6 + }, + "WETH": { + "address": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + "decimal": 18 + } + }, + "56": { + "USDC": { + "address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + "decimal": 18 + }, + "USDT": { + "address": "0x55d398326f99059fF775485246999027B3197955", + "decimal": 18 + }, + "WETH": { + "address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "decimal": 18 + } + } +} \ No newline at end of file diff --git a/ethereum/requirements.txt b/ethereum/requirements.txt index 8bf52f10..bf129ada 100644 --- a/ethereum/requirements.txt +++ b/ethereum/requirements.txt @@ -6,4 +6,4 @@ toml requests eth-brownie aptos-brownie -ccxt==1.72.64 +ccxt diff --git a/ethereum/scripts/celer.py b/ethereum/scripts/celer.py new file mode 100644 index 00000000..1147a9c1 --- /dev/null +++ b/ethereum/scripts/celer.py @@ -0,0 +1,1003 @@ +import json +import os +import time +import urllib +from random import choice + +import requests +from brownie import Contract, web3 +from brownie.project.main import Project + +from scripts.helpful_scripts import ( + get_account, + zero_address, + combine_bytes, + padding_to_bytes, + Session, + get_bridge_token_address, + get_bridge_token_decimal, + get_chain_id, + get_celer_chain_id, + get_account_address, + get_swap_info, + to_hex_str, +) + +from scripts.celer_tx_status import get_celer_transfer_status + +uniswap_v3_fee_decimal = 1e6 + +root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + +src_session: Session = None +dst_session: Session = None + + +def get_contract(contract_name: str, p: Project = None): + return p[contract_name] + + +def get_contract_address(contract_name: str, p: Project = None): + return get_contract(contract_name, p)[-1].address + + +def token_approve( + token_name: str, aprrove_address: str, amount: int, p: Project = None +): + token = Contract.from_abi( + token_name.upper(), + get_bridge_token_address("celer", token_name), + p.interface.IERC20.abi, + ) + token.approve(aprrove_address, amount, {"from": get_account()}) + + +def soSwapViaCeler( + so_data, + src_swap_data, + celer_data, + dst_swap_data, + input_eth_amount: int, + p: Project = None, +): + so_data = so_data.format_to_contract() + if src_swap_data is None: + src_swap_data = [] + else: + src_swap_data = [src_swap_data.format_to_contract()] + if dst_swap_data is None: + dst_swap_data = [] + else: + dst_swap_data = [dst_swap_data.format_to_contract()] + proxy_diamond = Contract.from_abi( + "CelerFacet", p["SoDiamond"][-1].address, p["CelerFacet"].abi + ) + + dst_max_gas_price = celer_data.dstMaxGasPriceInWeiForExecutor + ( + src_message_fee, + dst_executor_gas, + src_executor_fee, + ) = proxy_diamond.estCelerMessageFeeAndExecutorFee( + celer_data.dstCelerChainId, dst_max_gas_price, so_data, dst_swap_data, False + ) + + estimate_cost = src_message_fee + src_executor_fee + input_eth_amount + + celer_data.update_estimate_cost(estimate_cost) + celer_data = celer_data.format_to_contract() + + print( + f"dst_max_gas_price: {dst_max_gas_price}\n" + f"dst_executor_gas: {dst_executor_gas}\n" + f"src_executor_fee: {src_executor_fee / get_bridge_token_decimal('celer','eth')}\n" + f"src_message_fee: {src_message_fee / get_bridge_token_decimal('celer','eth')}\n" + f"estimate_cost: {estimate_cost / get_bridge_token_decimal('celer','eth')}\n" + f"input eth: {input_eth_amount / get_bridge_token_decimal('celer','eth')}\n" + ) + + print(f"CelerData: {celer_data}\n") + tx = proxy_diamond.soSwapViaCeler( + so_data, + src_swap_data, + celer_data, + dst_swap_data, + {"from": get_account(), "value": int(estimate_cost)}, + ) + + print(tx.info()) + + # Contract.from_abi("ICelerBridge", bridge_address, interface.ICelerBridge.abi) + celer_transfer_id = tx.events["Send"]["transferId"].hex() + print("celer transferId: ", celer_transfer_id) + + print("wait 30s for celer gateway") + time.sleep(30) + + get_celer_transfer_status(celer_transfer_id) + + +def swapTokensGeneric(so_data, src_swap_data, input_eth_amount: int, p: Project = None): + so_data = so_data.format_to_contract() + src_swap_data = [src_swap_data.format_to_contract()] + proxy_diamond = Contract.from_abi( + "GenericSwapFacet", p["SoDiamond"][-1].address, p["GenericSwapFacet"].abi + ) + proxy_diamond.swapTokensGeneric( + so_data, src_swap_data, {"from": get_account(), "value": int(input_eth_amount)} + ) + + +class View: + def __repr__(self): + data = vars(self) + for k in list(data.keys()): + if not k.startswith("_"): + continue + del data[k] + return json.dumps(data, sort_keys=True, indent=4, separators=(",", ":")) + + @staticmethod + def from_dict(obj, data: dict): + return obj(**data) + + +class SoData(View): + def __init__( + self, + transactionId, + receiver, + sourceChainId, + sendingAssetId, + destinationChainId, + receivingAssetId, + amount, + ): + # unique identification id + self.transactionId = transactionId + # token receiving account + self.receiver = receiver + # source chain id + self.sourceChainId = sourceChainId + # The starting token address of the source chain + self.sendingAssetId = sendingAssetId + # destination chain id + self.destinationChainId = destinationChainId + # The final token address of the destination chain + self.receivingAssetId = receivingAssetId + # User enters amount + self.amount = amount + + def format_to_contract(self): + """Get the SoData needed for the contract interface + + Returns: + SoData: Information for recording and tracking cross-chain transactions + """ + return [ + to_hex_str(self.transactionId), + to_hex_str(self.receiver), + self.sourceChainId if self.sourceChainId < 65535 else 0, + to_hex_str(self.sendingAssetId), + self.destinationChainId if self.destinationChainId < 65535 else 0, + to_hex_str(self.receivingAssetId), + self.amount, + ] + + @staticmethod + def generate_random_bytes32(): + """Produce random transactions iD for tracking transactions on both chains + + Returns: + result: 32 bytes hex + """ + chars = [str(i) for i in range(10)] + ["a", "b", "c", "d", "e"] + result = "0x" + for _ in range(64): + result += choice(chars) + return result + + @classmethod + def create( + cls, + src_session, + dst_session, + receiver: str, + amount: int, + sendingTokenName: str, + receiveTokenName: str, + ): + """Create SoData class + + Args: + receiver (str): The final recipient of the target token + amount (int): Amount of tokens sent + sendingTokenName (str): The name of the token sent on the source chain side, like usdt etc. + receiveTokenName (str): The name of the token to the target link, like usdt etc. + + Returns: + SoData: SoData class + """ + transactionId = cls.generate_random_bytes32() + return SoData( + transactionId=transactionId, + receiver=receiver, + sourceChainId=src_session.put_task(func=get_chain_id), + sendingAssetId=src_session.put_task( + func=get_bridge_token_address, + args=( + "celer", + sendingTokenName, + ), + ), + destinationChainId=dst_session.put_task(func=get_chain_id), + receivingAssetId=dst_session.put_task( + func=get_bridge_token_address, + args=( + "celer", + receiveTokenName, + ), + ), + amount=amount, + ) + + +class CelerData(View): + def __init__( + self, + sender, + maxSlippage, + dstCelerChainId, + dstSoDiamond, + srcBridgeToken, + srcBridgeTokenDecimal, + estimateCost, + dstBridgeToken, + dstBridgeTokenDecimal, + dstMaxGasPriceInWeiForExecutor, + ): + # slippage tolerance, 10000 -> 1% + self.sender = sender + self.maxSlippage = maxSlippage + # destination chain id + self.dstCelerChainId = dstCelerChainId + # destination SoDiamond address + self.dstSoDiamond = dstSoDiamond + self.srcBridgeToken = srcBridgeToken + self.srcBridgeTokenDecimal = srcBridgeTokenDecimal + self.estimateCost = estimateCost + self.dstBridgeToken = dstBridgeToken + self.dstBridgeTokenDecimal = dstBridgeTokenDecimal + self.dstMaxGasPriceInWeiForExecutor = dstMaxGasPriceInWeiForExecutor + + def update_estimate_cost(self, estimateCost): + self.estimateCost = estimateCost + + def format_to_contract(self): + """Get the Celer data passed into the contract interface""" + return [ + to_hex_str(self.sender), + self.maxSlippage, + self.dstCelerChainId, + self.srcBridgeToken, + self.dstMaxGasPriceInWeiForExecutor, + self.estimateCost, + self.dstSoDiamond, + ] + + @classmethod + def create( + cls, + src_session, + dst_session, + max_slippage: int, + srcBridgeToken: str, + estimateCost: int, + dstBridgeToken: str, + dstMaxGasPriceInWeiForExecutor: int, + ): + """Create CelerData class + + Args: + maxSlippage (int): The celer slippage on the target chain + srcBridgeToken (str): Name of the bridge token on the source chain + estimateCost (int): The estimateCost = message fee(for SGN) + executor fee(for executor) + native_gas(optional) + dstBridgeToken (str): Name of the receive token on the target chain + dstMaxGasPriceInWeiForExecutor (int): The max gas price on destination chain + + Returns: + CelerData: CelerData class + """ + return CelerData( + sender=src_session.put_task(get_account_address), + maxSlippage=max_slippage, + dstCelerChainId=dst_session.put_task(func=get_celer_chain_id), + dstSoDiamond=dst_session.put_task( + get_contract_address, args=("SoDiamond",), with_project=True + ), + srcBridgeToken=src_session.put_task( + func=get_bridge_token_address, + args=( + "celer", + srcBridgeToken, + ), + ), + srcBridgeTokenDecimal=src_session.put_task( + func=get_bridge_token_decimal, + args=( + "celer", + srcBridgeToken, + ), + ), + estimateCost=estimateCost, + dstBridgeToken=dst_session.put_task( + func=get_bridge_token_address, + args=( + "celer", + dstBridgeToken, + ), + ), + dstBridgeTokenDecimal=dst_session.put_task( + func=get_bridge_token_decimal, + args=( + "celer", + dstBridgeToken, + ), + ), + dstMaxGasPriceInWeiForExecutor=dstMaxGasPriceInWeiForExecutor, + ) + + @staticmethod + def estimate_so_fee(amount, p: Project = None): + """Get the processing fee of the target chain Diamond + + Args: + amount (_type_): Amount of tokens acquired from Celer in the target chain + p (Project, optional): Load brownie project config. Defaults to None. + + Returns: + so_fee: Fees charged by Diamond + """ + proxy_diamond = Contract.from_abi( + "CelerFacet", p["SoDiamond"][-1].address, p["CelerFacet"].abi + ) + so_fee = proxy_diamond.getCelerSoFee(amount) + print(f" So fee rate: {so_fee / amount}") + return so_fee + + +class SwapType: + """Interfaces that may be called""" + + IUniswapV2Router02 = "IUniswapV2Router02" + IUniswapV2Router02AVAX = "IUniswapV2Router02AVAX" + ISwapRouter = "ISwapRouter" + + +class SwapFunc: + """Swap functions that may be called""" + + swapExactETHForTokens = "swapExactETHForTokens" + swapExactAVAXForTokens = "swapExactAVAXForTokens" + swapExactTokensForETH = "swapExactTokensForETH" + swapExactTokensForAVAX = "swapExactTokensForAVAX" + swapExactTokensForTokens = "swapExactTokensForTokens" + exactInput = "exactInput" + + +class SwapData(View): + """Constructing data for calling UniswapLike""" + + def __init__( + self, + callTo, + approveTo, + sendingAssetId, + receivingAssetId, + fromAmount, + callData, + swapType: str = None, + swapFuncName: str = None, + swapPath: list = None, + swapEncodePath: list = None, + ): + # The swap address + self.callTo = callTo + # The swap address + self.approveTo = approveTo + # The swap start token address + self.sendingAssetId = sendingAssetId + # The swap final token address + self.receivingAssetId = receivingAssetId + # The swap start token amount + self.fromAmount = fromAmount + # The swap callData + self.callData = callData + self.swapType = swapType + self.swapFuncName = swapFuncName + self.swapPath = swapPath + self.swapEncodePath = swapEncodePath + + def format_to_contract(self): + """Returns the data used to pass into the contract interface""" + return [ + to_hex_str(self.callTo), + to_hex_str(self.approveTo), + to_hex_str(self.sendingAssetId), + to_hex_str(self.receivingAssetId), + self.fromAmount, + to_hex_str(self.callData), + ] + + @classmethod + def create( + cls, + swapType: str, + swapFuncName: str, + fromAmount: int, + swapPath: list, + p: Project = None, + ): + """Create SwapData class + + Args: + swapType (str): Calling the uniswap interface type + swapFuncName (str): Calling a specific function name + fromAmount (int): Input amount for Swap + swapPath (list): Token path for Swap + p (Project, optional): Load brownie project config. Defaults to None. + + Raises: + ValueError: Not support swapFuncName + + Returns: + swap_data: SwapData class + """ + if swapFuncName not in vars(SwapFunc): + raise ValueError("Not support") + swap_info = get_swap_info()[swapType] + swap_contract = Contract.from_abi( + swapType, swap_info["router"], getattr(p.interface, swapType).abi + ) + callTo = swap_contract.address + approveTo = swap_contract.address + minAmount = 0 + + if swapType == SwapType.ISwapRouter: + path = cls.encode_path_for_uniswap_v3(swapPath) + if swapFuncName == "exactInput": + if swapPath[0] == "weth": + sendingAssetId = zero_address() + else: + sendingAssetId = get_bridge_token_address("celer", swapPath[0]) + receivingAssetId = get_bridge_token_address("celer", swapPath[-1]) + else: + raise ValueError("Not support") + else: + path = cls.encode_path_for_uniswap_v2(swapPath) + sendingAssetId = path[0] + receivingAssetId = path[-1] + + if swapFuncName in [ + SwapFunc.swapExactTokensForETH, + SwapFunc.swapExactTokensForAVAX, + SwapFunc.swapExactTokensForTokens, + ]: + callData = getattr(swap_contract, swapFuncName).encode_input( + fromAmount, + minAmount, + path, + p["SoDiamond"][-1].address, + int(time.time() + 3000), + ) + elif swapFuncName == SwapFunc.exactInput: + callData = getattr(swap_contract, swapFuncName).encode_input( + [ + path, + p["SoDiamond"][-1].address, + int(time.time() + 3000), + fromAmount, + minAmount, + ] + ) + elif swapFuncName in [ + SwapFunc.swapExactETHForTokens, + SwapFunc.swapExactAVAXForTokens, + ]: + callData = getattr(swap_contract, swapFuncName).encode_input( + minAmount, path, p["SoDiamond"][-1].address, int(time.time() + 3000) + ) + else: + raise ValueError("Not support") + swap_data = SwapData( + callTo, + approveTo, + sendingAssetId, + receivingAssetId, + fromAmount, + callData, + swapType, + swapFuncName, + swapPath, + path, + ) + return swap_data + + @staticmethod + def reset_min_amount( + callData: str, + swapType: str, + swapFuncName: str, + minAmount: int, + p: Project = None, + ): + """Resetting the min amount of dst swap based on the results of the overall slippage calculation + + Args: + callData (str): Calldata for target chain execution swap + swapType (str): Calling the uniswap interface type + swapFuncName (str): Calling a specific function name + minAmount (int): Min amount + p (Project, optional): Load brownie project config. Defaults to None. + + Raises: + ValueError: not support swapType + + Returns: + callData: Calldata after setting min amount + """ + swap_info = get_swap_info()[swapType] + swap_contract = Contract.from_abi( + swapType, swap_info["router"], getattr(p.interface, swapType).abi + ) + if swapType == SwapType.ISwapRouter and swapFuncName == "exactInput": + [params] = getattr(swap_contract, swapFuncName).decode_input(callData) + params[4] = minAmount + return getattr(swap_contract, swapFuncName).encode_input(params) + elif swapType.startswith("IUniswapV2") and swapFuncName.startswith( + "swapExactTokens" + ): + (fromAmount, _, path, to, deadline) = getattr( + swap_contract, swapFuncName + ).decode_input(callData) + return getattr(swap_contract, swapFuncName).encode_input( + fromAmount, minAmount, path, to, deadline + ) + elif swapType.startswith("IUniswapV2") and ( + swapFuncName.startswith("swapExactETH") + or swapFuncName.startswith("swapExactAVAX") + ): + (_, path, to, deadline) = getattr(swap_contract, swapFuncName).decode_input( + callData + ) + return getattr(swap_contract, swapFuncName).encode_input( + minAmount, path, to, deadline + ) + else: + raise ValueError("Not support") + + @classmethod + def encode_path_for_uniswap_v3_revert(cls, swapPath): + return cls.encode_path_for_uniswap_v3(swapPath[::-1]) + + @staticmethod + def encode_path_for_uniswap_v2(p: list): + return [get_bridge_token_address("celer", v) for v in p] + + @staticmethod + def encode_path_for_uniswap_v3(p: list): + """ + :param p: [token, fee, token, fee, token...] + :return: + """ + assert len(p) > 0 + assert (len(p) - 3) % 2 == 0, "p length not right" + p = [ + padding_to_bytes( + web3.toHex(int(p[i] * uniswap_v3_fee_decimal)), padding="left", length=3 + ) + if (i + 1) % 2 == 0 + else get_bridge_token_address("celer", p[i]) + for i in range(len(p)) + ] + return combine_bytes(p) + + @classmethod + def estimate_out(cls, amountIn: int, swapType: str, swapPath, p: Project = None): + """Estimate uniswap final output amount + + Args: + amountIn (int): swap input amount + swapType (str): uniswap interface type + swapPath (_type_): swap token path + p (Project, optional): Load brownie project config. Defaults to None. + + Raises: + ValueError: not support swapType + + Returns: + amountOut: final output amount + """ + account = get_account() + swap_info = get_swap_info()[swapType] + if swapType == "ISwapRouter": + swap_contract = Contract.from_abi( + "IQuoter", swap_info["quoter"], getattr(p.interface, "IQuoter").abi + ) + amountOut = swap_contract.quoteExactInput.call( + cls.encode_path_for_uniswap_v3(swapPath), amountIn, {"from": account} + ) + elif swapType.startswith("IUniswapV2"): + swap_contract = Contract.from_abi( + swapType, swap_info["router"], getattr(p.interface, swapType).abi + ) + amountOuts = swap_contract.getAmountsOut( + amountIn, cls.encode_path_for_uniswap_v2(swapPath) + ) + amountOut = amountOuts[-1] + else: + raise ValueError("Not support") + print( + f" Swap estimate out: token {swapPath[0]}, amount {amountIn / get_bridge_token_decimal('celer',swapPath[0])} " + f"-> token {swapPath[-1]}, amount {amountOut / get_bridge_token_decimal('celer',swapPath[-1])}" + ) + return amountOut + + @classmethod + def estimate_in(cls, amountOut: int, swapType: str, swapPath, p: Project = None): + """Estimate uniswap input amount based on output amount + + Args: + amountOut (int): uniswap output amount + swapType (str): uniswap interface type + swapPath (_type_): swap token path + p (Project, optional): load brownie project config. Defaults to None. + + Raises: + ValueError: not support swapType + + Returns: + amountIn: input amount + """ + account = get_account() + swap_info = get_swap_info()[swapType] + if swapType == "ISwapRouter": + swap_contract = Contract.from_abi( + "IQuoter", swap_info["quoter"], getattr(p.interface, "IQuoter").abi + ) + amountIn = swap_contract.quoteExactOutput.call( + cls.encode_path_for_uniswap_v3_revert(swapPath), + amountOut, + {"from": account}, + ) + elif swapType.startswith("IUniswapV2"): + swap_contract = Contract.from_abi( + swapType, swap_info["router"], getattr(p.interface, swapType).abi + ) + amountIns = swap_contract.getAmountsIn( + amountOut, cls.encode_path_for_uniswap_v2(swapPath) + ) + amountIn = amountIns[0] + else: + raise ValueError("Not support") + print( + f" Swap estimate in: token {swapPath[0]}, amount {amountIn / get_bridge_token_decimal('celer',swapPath[0])} " + f"<- token {swapPath[-1]}, amount {amountOut / get_bridge_token_decimal('celer',swapPath[-1])}" + ) + return amountIn + + +def celer_estimate_amount( + amount: int, slippage_tolerance=10000 # 1%, follow maxSlippage +): + src_chain_id = 5 + dst_chain_id = 43113 + token_symbol = "USDC" + test_base_url = "https://cbridge-v2-test.celer.network/v2/estimateAmt" + # main_base_url = "https://cbridge-prod2.celer.app/v2/estimateAmt" + + params = { + "src_chain_id": src_chain_id, + "dst_chain_id": dst_chain_id, + "token_symbol": token_symbol, + "usr_addr": 0x0, + "slippage_tolerance": slippage_tolerance, + "amt": amount, + "is_pegged": "false", + } + + url = test_base_url + "?" + urllib.parse.urlencode(params) + + print(f"\n {url}\n") + + response = requests.get(url) + data = json.loads(response.text) + + estimated_amount = int(data["estimated_receive_amt"]) + max_slippage = int(data["max_slippage"]) + + return estimated_amount, max_slippage + + +def celer_estimate_final_token_amount( + src_session, + dst_session, + amount: int, + slippage_tolerance, + src_swap_data: SwapData, + dst_swap_data: SwapData, +): + """Estimate source swap output""" + print("Estimate final token amount:") + if src_swap_data is not None: + amount = src_session.put_task( + SwapData.estimate_out, + args=(amount, src_swap_data.swapType, src_swap_data.swapPath), + with_project=True, + ) + + amount, max_slippage = src_session.put_task( + celer_estimate_amount, args=(amount, slippage_tolerance), with_project=False + ) + so_fee = dst_session.put_task( + CelerData.estimate_so_fee, args=(amount,), with_project=True + ) + amount = amount - so_fee + + if dst_swap_data is not None: + amount = dst_session.put_task( + SwapData.estimate_out, + args=(amount, dst_swap_data.swapType, dst_swap_data.swapPath), + with_project=True, + ) + + print(f"Final amount: {amount}, so fee: {so_fee}") + + return amount, max_slippage + + +def cross_swap_via_celer( + src_session, + dst_session, + inputAmount, + sourceTokenName, # celer + destinationTokenName, # celer + sourceSwapType, + sourceSwapFunc, + sourceSwapPath, + sourceBridgeToken, + destinationBridgeToken, + destinationSwapType, + destinationSwapFunc, + destinationSwapPath, + slippage: float, +): + print( + f"{'-' * 100}\nSwap: {sourceTokenName}({src_session.net}) " + f"-> {sourceBridgeToken}({src_session.net}) -> {destinationBridgeToken}({dst_session.net}) " + f"-> {destinationTokenName}({dst_session.net})\n" + ) + src_diamond_address = src_session.put_task( + get_contract_address, args=("SoDiamond",), with_project=True + ) + dst_diamond_address = dst_session.put_task( + get_contract_address, args=("SoDiamond",), with_project=True + ) + print( + f"Source diamond address: {src_diamond_address}. Destination diamond address: {dst_diamond_address}" + ) + + so_data = SoData.create( + src_session, + dst_session, + src_session.put_task(get_account_address), + amount=inputAmount, + sendingTokenName=sourceTokenName, + receiveTokenName=destinationTokenName, + ) + print("SoData\n", so_data) + + if sourceSwapType is not None: + src_swap_data = src_session.put_task( + SwapData.create, + args=(sourceSwapType, sourceSwapFunc, inputAmount, sourceSwapPath), + with_project=True, + ) + print("SourceSwapData:\n", src_swap_data) + else: + src_swap_data = None + + if destinationSwapType is not None: + dst_swap_data: SwapData = dst_session.put_task( + SwapData.create, + args=( + destinationSwapType, + destinationSwapFunc, + inputAmount, + destinationSwapPath, + ), + with_project=True, + ) + else: + dst_swap_data: SwapData = None + + final_amount, max_slippage = celer_estimate_final_token_amount( + src_session, + dst_session, + inputAmount, + int(slippage * 1000000), + src_swap_data, + dst_swap_data, + ) + + dstMaxGasPriceInWeiForExecutor = 25000000000 # todo: get gas price + + celer_data = CelerData.create( + src_session, + dst_session, + max_slippage, # set max_slippage=1 for refund token tests + sourceBridgeToken, + 0, + destinationBridgeToken, + dstMaxGasPriceInWeiForExecutor, + ) + + dst_swap_min_amount = int(final_amount * (1 - slippage)) + + print("CelerData:\n", celer_data) + + if dst_swap_data is not None: + dst_swap_data.callData = dst_session.put_task( + SwapData.reset_min_amount, + args=( + dst_swap_data.callData, + dst_swap_data.swapType, + dst_swap_data.swapFuncName, + dst_swap_min_amount, + ), + with_project=True, + ) + print("DestinationSwapData:\n", dst_swap_data) + + if sourceTokenName != "eth": + src_session.put_task( + token_approve, + args=( + sourceTokenName, + src_session.put_task( + get_contract_address, args=("SoDiamond",), with_project=True + ), + inputAmount, + ), + with_project=True, + ) + input_eth_amount = 0 + else: + input_eth_amount = inputAmount + + src_session.put_task( + soSwapViaCeler, + args=(so_data, src_swap_data, celer_data, dst_swap_data, input_eth_amount), + with_project=True, + ) + + +def single_swap( + src_session, + dst_session, + inputAmount, + sendingTokenName, + receiveTokenName, + sourceSwapType, + sourceSwapFunc, + sourceSwapPath, +): + print( + f"{'-' * 100}\nnetwork {src_session.net}, single swap: token {sendingTokenName} -> {receiveTokenName}" + ) + so_data = SoData.create( + src_session, + dst_session, + src_session.put_task(get_account_address), + amount=inputAmount, + sendingTokenName=sendingTokenName, + receiveTokenName=receiveTokenName, + ) + print("SoData\n", so_data) + src_swap_data = src_session.put_task( + SwapData.create, + args=(sourceSwapType, sourceSwapFunc, inputAmount, sourceSwapPath), + with_project=True, + ) + print("SourceSwapData:\n", src_swap_data) + if sendingTokenName != "eth": + src_session.put_task( + token_approve, + args=( + sendingTokenName, + src_session.put_task( + get_contract_address, args=("SoDiamond",), with_project=True + ), + inputAmount, + ), + with_project=True, + ) + input_eth_amount = 0 + else: + input_eth_amount = inputAmount + src_session.put_task( + swapTokensGeneric, + args=(so_data, src_swap_data, input_eth_amount), + with_project=True, + ) + + +def main(src_net="goerli", dst_net="avax-test", bridge="celer"): + global src_session + global dst_session + src_session = Session( + net=src_net, project_path=root_path, name=src_net, daemon=False + ) + dst_session = Session( + net=dst_net, project_path=root_path, name=dst_net, daemon=False + ) + + if bridge == "celer": + # celer swap + cross_swap_via_celer( + src_session=src_session, + dst_session=dst_session, + inputAmount=int( + # 0.01 * src_session.put_task(get_bridge_token_decimal, args=("celer","weth",)) + 10 + * src_session.put_task( + get_bridge_token_decimal, + args=( + "celer", + "usdc", + ), + ) + ), + # sourceTokenName="weth", + sourceTokenName="usdc", + destinationTokenName="usdc", + # sourceSwapType=SwapType.IUniswapV2Router02, + sourceSwapType=None, + sourceSwapFunc=SwapFunc.swapExactTokensForTokens, + sourceSwapPath=("weth", "usdc"), + sourceBridgeToken="usdc", + destinationBridgeToken="usdc", + destinationSwapType=None, + destinationSwapFunc=SwapFunc.swapExactTokensForTokens, + destinationSwapPath=("usdc", "weth"), + slippage=0.01, + ) + + else: + # single swap + single_swap( + src_session=src_session, + dst_session=src_session, + inputAmount=int( + 0.001 + * src_session.put_task( + get_bridge_token_decimal, + args=( + "celer", + "weth", + ), + ) + ), + sendingTokenName="weth", + receiveTokenName="usdc", + sourceSwapType=SwapType.IUniswapV2Router02, + sourceSwapFunc=SwapFunc.swapExactTokensForTokens, + sourceSwapPath=("weth", "usdc"), + ) + + src_session.terminate() + dst_session.terminate() + + +if __name__ == "__main__": + main() diff --git a/ethereum/scripts/celer_tx_status.py b/ethereum/scripts/celer_tx_status.py new file mode 100644 index 00000000..ef0a9c0c --- /dev/null +++ b/ethereum/scripts/celer_tx_status.py @@ -0,0 +1,107 @@ +import json +import polling +import requests +import base64 + +from brownie.convert import to_address, to_uint + +SUCCESS_CODE = 200 +TRANSFER_COMPLETED = 5 +TRANSFER_REFUND_TO_BE_CONFIRMED = 8 +TRANSFER_REFUNDED = 10 + +# main https://cbridge-prod2.celer.app/v2/getTransferStatus +# test "https://cbridge-v2-test.celer.network/v2/getTransferStatus" +CELER_URL = "https://cbridge-v2-test.celer.network/v2/getTransferStatus" +HEADERS = {"Content-Type": "application/json"} + +TransferHistoryStatus = [ + "TRANSFER_UNKNOWN", + "TRANSFER_SUBMITTING", + "TRANSFER_FAILED", + "TRANSFER_WAITING_FOR_SGN_CONFIRMATION", + "TRANSFER_WAITING_FOR_FUND_RELEASE", + "TRANSFER_COMPLETED", + "TRANSFER_TO_BE_REFUNDED", + "TRANSFER_REQUESTING_REFUND", + "TRANSFER_REFUND_TO_BE_CONFIRMED", + "TRANSFER_CONFIRMING_YOUR_REFUND", + "TRANSFER_REFUNDED", +] + +XferStatus = [ + "UNKNOWN", + "OK_TO_RELAY", + "SUCCESS", + "BAD_LIQUIDITY", + "BAD_SLIPPAGE", + "BAD_TOKEN", + "REFUND_REQUESTED", + "REFUND_DONE", + "BAD_XFER_DISABLED", + "BAD_DEST_CHAIN", +] + +# https://cbridge-docs.celer.network/developer/api-reference/contract-pool-based-transfer-refund +def convert_parameters(data): + print("wd_onchain:", data["wd_onchain"]) + print("sorted_sigs:", data["sorted_sigs"]) + print("signers:", data["signers"]) + print("powers:", data["powers"]) + + print("=================================") + + wd_onchain = base64.b64decode(data["wd_onchain"]) + sigs = list(map(lambda p: base64.b64decode(p), data["sorted_sigs"])) + signers = list( + map(lambda p: to_address(base64.b64decode(p).hex()), data["signers"]) + ) + powers = list(map(lambda p: to_uint(base64.b64decode(p)), data["powers"])) + + print("wd_onchain:", wd_onchain.hex()) + print("signs:", list(map(lambda p: p.hex(), sigs))) + print("signers:", signers) + print("powers:", powers) + + return wd_onchain, sigs, signers, powers + + +def is_correct_response(response): + """Check celer tx status""" + + if response.status_code != SUCCESS_CODE: + print(f"\nstatus code: {response.status_code}\n") + return False + + data = json.loads(response.text) + + if data["err"] is not None: + print(data["err"]) + return False + + print("tx status: ", TransferHistoryStatus[data["status"]]) + print("refund_reason:", XferStatus[data["refund_reason"]]) + + if data["status"] == TRANSFER_COMPLETED or data["status"] == TRANSFER_REFUNDED: + src_tx = data["src_block_tx_link"] + dst_tx = data["dst_block_tx_link"] + print(f"src_block_tx_link: {src_tx}\ndst_block_tx_link: {dst_tx}") + return True + + return False + + +def get_celer_transfer_status(transfer_id): + payload = json.dumps({"transfer_id": transfer_id}) + polling.poll( + lambda: requests.request("POST", CELER_URL, headers=HEADERS, data=payload), + check_success=is_correct_response, + step=10, + max_tries=30, + ) + + +if __name__ == "__main__": + get_celer_transfer_status( + "0xa9e4ca82b2ccff7506fe13eae3cbb8066d28fb8f23010ee8d58383d826ab2107" + ) diff --git a/ethereum/scripts/deploy.py b/ethereum/scripts/deploy.py index 8237bcdb..acff3923 100755 --- a/ethereum/scripts/deploy.py +++ b/ethereum/scripts/deploy.py @@ -13,6 +13,8 @@ WormholeFacet, SerdeFacet, network, + LibSoFeeCelerV1, + CelerFacet, ) from brownie.network import priority_fee @@ -32,6 +34,7 @@ def deploy_contracts(account): DiamondLoupeFacet, DexManagerFacet, StargateFacet, + CelerFacet, WormholeFacet, WithdrawFacet, OwnershipFacet, @@ -45,13 +48,19 @@ def deploy_contracts(account): print("deploy SoDiamond.sol...") SoDiamond.deploy(account, DiamondCutFacet[-1], {"from": account}) - print("deploy LibSoFeeStargateV1.sol...") so_fee = 1e-3 + + print("deploy LibSoFeeStargateV1.sol...") transfer_for_gas = 30000 LibSoFeeStargateV1.deploy(int(so_fee * 1e18), transfer_for_gas, {"from": account}) - print("deploy LibSoFeeWormholeV1.sol...") ray = 1e27 + + print("deploy LibSoFeeCelerV1.sol...") + LibSoFeeCelerV1.deploy(int(so_fee * ray), {"from": account}) + + print("deploy LibSoFeeWormholeV1.sol...") + LibSoFeeWormholeV1.deploy(int(so_fee * ray), {"from": account}) print("deploy LibCorrectSwapV1...") diff --git a/ethereum/scripts/export.py b/ethereum/scripts/export.py index f063719b..7a8f1d2c 100644 --- a/ethereum/scripts/export.py +++ b/ethereum/scripts/export.py @@ -4,7 +4,7 @@ import contextlib import json import os -from pprint import pp, pprint +import traceback from brownie import ( DiamondCutFacet, @@ -26,6 +26,8 @@ LibSoFeeWormholeV1, SerdeFacet, network, + CelerFacet, + LibSoFeeCelerV1, ) from scripts.helpful_scripts import ( @@ -38,6 +40,8 @@ get_token_address, get_swap_info, get_stargate_chain_id, + get_celer_chain_id, + get_celer_message_bus, ) from scripts.wormhole import ( get_all_warpped_token, @@ -57,6 +61,7 @@ def write_file(file: str, data): + print("save to:", file) with open(file, "w") as f: json.dump(data, f, indent=4, sort_keys=True) @@ -80,7 +85,8 @@ def fit_mainnet_stargate_chain_path(): def get_stragate_pool_infos(): stargate_router_address = get_stargate_router() if stargate_router_address == "": - return [] + return [], [] + stargate_router = Contract.from_abi( "IStargate", stargate_router_address, interface.IStargate.abi ) @@ -285,9 +291,18 @@ def get_wormhole_chain_path(net, wormhole_chain_path): return net_support_token -def export_wormhole_chain_path(arg, wormhole_chain_path): +def export_wormhole_chain_path(networks): + wormhole_chain_path = [] + for net in networks: + print(f"[export_wormhole_chain_path] current net: {net}") + try: + change_network(net) + wormhole_chain_path.extend(get_all_warpped_token()) + except Exception: + continue + omni_swap_infos = read_json(omni_swap_file) - for net in arg: + for net in networks: if "aptos" in net: continue net_support_token = get_wormhole_chain_path(net, wormhole_chain_path) @@ -397,6 +412,7 @@ def export_deployed(): DiamondLoupeFacet, DexManagerFacet, StargateFacet, + CelerFacet, WormholeFacet, WithdrawFacet, OwnershipFacet, @@ -404,6 +420,7 @@ def export_deployed(): SoDiamond, LibSoFeeStargateV1, LibSoFeeWormholeV1, + LibSoFeeCelerV1, LibCorrectSwapV1, SerdeFacet, ] @@ -418,7 +435,10 @@ def export_deployed(): ]: out[v._name] = "0x4AF9bE5A3464aFDEFc80700b41fcC4d9713E7449" continue - out[v._name] = v[-1].address + try: + out[v._name] = v[-1].address + except: + continue return out @@ -449,10 +469,7 @@ def export(*arg): continue deployed_contracts[net] = export_deployed() - if get_stragate_pool_infos() == []: - pool_info, stargate_info = ([], []) - else: - pool_info, stargate_info = get_stragate_pool_infos() + pool_info, stargate_info = get_stragate_pool_infos() stargate_infos[net] = stargate_info try: weth = get_token_address("weth") @@ -509,6 +526,7 @@ def export(*arg): GenericSwapFacet, WormholeFacet, SerdeFacet, + CelerFacet, ] libs = [LibSwap] so_diamond_abi = [] @@ -516,11 +534,211 @@ def export(*arg): so_diamond_abi += f.abi write_file(deployed_file, deployed_contracts) - write_file(omni_swap_file, omni_swap_infos) - write_file(stragate_file, stargate_infos) + + +def new_export(*args): + networks = select_networks(args) + + export_so_diamond_abi() + export_stargate_abi() + export_celer_abi() + export_swap_abi(networks) + export_deployed_contracts(networks) + + # export_stargate_info(networks) + # export_omniswap_info(networks) + + +def export_so_diamond_abi(): + contrats = [ + # facets + DiamondCutFacet, + DiamondLoupeFacet, + DexManagerFacet, + StargateFacet, + WithdrawFacet, + OwnershipFacet, + GenericSwapFacet, + WormholeFacet, + SerdeFacet, + CelerFacet, + # libs + LibSwap, + ] + + so_diamond_abi = [] + for c in contrats: + so_diamond_abi += c.abi + + write_file(os.path.join(root_path, "export/abi/SoDiamond.json"), so_diamond_abi) + + +def export_stargate_abi(): write_file( os.path.join(root_path, "export/abi/IStargate.json"), interface.IStargate.abi ) - write_file(os.path.join(root_path, "export/abi/SoDiamond.json"), so_diamond_abi) - export_wormhole_chain_path(arg, wormhole_chain_path) - get_stargate_chain_path() + + +def export_celer_abi(): + write_file( + os.path.join(root_path, "export/abi/ICelerBridge.json"), + interface.ICelerBridge.abi, + ) + + +def export_swap_abi(networks): + swap_types = {} + + for net in networks: + print(f"[export_swap_abi] current net: {net}") + + try: + change_network(net) + except: + continue + + with contextlib.suppress(Exception): + swap_info = get_swap_info() + + for swap_type in swap_info: + if swap_type not in swap_types: + write_file( + os.path.join(root_path, f"export/abi/{swap_type}.json"), + getattr(interface, swap_type).abi, + ) + swap_types[swap_type] = True + + write_file( + os.path.join(root_path, "export/abi/IQuoter.json"), + getattr(interface, "IQuoter").abi, + ) + + +def export_deployed_contracts(networks): + deployed_contracts = {} + + for net in networks: + print(f"[export_deployed_contracts] current net: {net}") + + try: + change_network(net) + deployed_contracts[net] = export_deployed() + except: + traceback.print_exc() + + write_file(deployed_file, deployed_contracts) + + +def export_stargate_info(networks): + stargate_infos = {} + for net in networks: + print(f"[export_stargate_info] current net: {net}") + + try: + change_network(net) + _pool_info, stargate_info = get_stragate_pool_infos() + stargate_infos[net] = stargate_info + except: + continue + + write_file(stragate_file, stargate_infos) + + +def export_omniswap_info(networks): + omni_swap_infos = {} + + for net in networks: + print(f"[export_omniswap_info] current net: {net}") + + try: + change_network(net) + so_diamond = SoDiamond[-1] + pool_info, _stargate_info = get_stragate_pool_infos() + except: + continue + + try: + weth = get_token_address("weth") + except: + weth = "" + + swap_router = [] + with contextlib.suppress(Exception): + swap_info = get_swap_info() + for swap_type in swap_info: + cur_swap = swap_info[swap_type] + swap_router_address = cur_swap["router"] + swap_token_list = cur_swap.get("token_list", "") + quoter_address = cur_swap.get("quoter", "") + swap_name = cur_swap.get("name", "") + + swap_router.append( + { + "Name": swap_name, + "RouterAddress": swap_router_address, + "Type": swap_type, + "TokenList": swap_token_list, + "QuoterAddressForUniswapV3": quoter_address, + } + ) + + omni_swap_infos[net] = { + "OmniBtcChainId": config["networks"][net]["omnibtc_chainid"], + "SoDiamond": so_diamond.address, + "ChainId": config["networks"][net]["chainid"], + "WormholeBridge": get_wormhole_bridge(), + "WormholeChainId": get_wormhole_chainid(), + "WormholeSupportToken": get_wormhole_support_token(net), + "StargateRouter": get_stargate_router(), + "StargateChainId": get_stargate_chain_id(), + "StargatePool": pool_info, + "WETH": weth, + "UniswapRouter": swap_router, + } + + write_file(omni_swap_file, omni_swap_infos) + + +def export_celer(): + deployed_contracts = {} + for net in ["goerli", "avax-test"]: + change_network(net) + deployed_contracts[net] = export_deployed() + write_file("celer_test_contracts.json", deployed_contracts) + + +def select_networks(args): + main_networks = [ + # "aptos-mainnet", + "mainnet", + "bsc-main", + "avax-main", + "polygon-main", + "arbitrum-main", + "optimism-main", + # "ftm-main", + ] + + test_networks = [ + # "aptos-testnet", + "goerli", + # "bsc-test", + "avax-test", + # "polygon-test", + # "arbitrum-test", + # "optimism-test", + # "ftm-test", + ] + + export_networks = [] + + if len(args) != 0 and args[0] == "main": + export_networks.extend(main_networks) + elif len(args) != 0 and args[0] == "test": + export_networks.extend(test_networks) + else: + export_networks.extend(test_networks) + + print(export_networks) + + return export_networks diff --git a/ethereum/scripts/export_celer.py b/ethereum/scripts/export_celer.py new file mode 100644 index 00000000..ddc57db1 --- /dev/null +++ b/ethereum/scripts/export_celer.py @@ -0,0 +1,400 @@ +import json +import os +import urllib +import requests + +from brownie import Contract, config, interface + +from scripts.helpful_scripts import ( + get_celer_message_bus, + change_network, + get_celer_oracles, +) + +CELER_GATEWAY = "https://cbridge-prod2.celer.app/v2/" + +root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) +tmp_celer_bridge_token = os.path.join(root_path, "export/TmpCelerBridgeToken.json") +celer_chain_path = os.path.join(root_path, "export/CelerChainPath.json") + + +def write_file(file: str, data): + print("save to:", file) + with open(file, "w") as f: + json.dump(data, f, indent=4, sort_keys=True) + + +def read_json(file): + try: + with open(file) as f: + return json.load(f) + except: + return [] + + +def check_bridge_token( + src_chain_id: str, + dst_chain_id: str, + symbol: str, + src_decimal: int, + dst_decimal: int, +): + fixed_amount = 10**src_decimal + pegged_amount = 10**dst_decimal + + if symbol != "WETH": + fixed_amount = 500 * fixed_amount + pegged_amount = 500 * pegged_amount + + params = { + "src_chain_id": src_chain_id, + "dst_chain_id": dst_chain_id, + "token_symbol": symbol, + "usr_addr": 0x0, + "slippage_tolerance": 10000, # 1% + "amt": fixed_amount, + "is_pegged": "false", + } + + url = CELER_GATEWAY + "estimateAmt" + "?" + urllib.parse.urlencode(params) + + print(f"\n {url}\n") + + response = requests.get(url) + data = json.loads(response.text) + + try: + estimated_amount = int(data["estimated_receive_amt"]) + except: + estimated_amount = pegged_amount + + # print("estimated_amount: ", estimated_amount) + + return estimated_amount != pegged_amount + + +def simple_check_bridge_tokens(): + chain_tokens = { + # Ethereum + "1": {"USDC": 6, "USDT": 6, "WETH": 18}, + # Optimism + "10": {"USDC": 6, "USDT": 6, "WETH": 18}, + # BSC + "56": {"USDC": 18, "USDT": 18, "WETH": 18}, + # Polygon + "137": {"USDC": 6, "USDT": 6, "WETH": 18}, + # Arbitrum + "42161": {"USDC": 6, "USDT": 6, "WETH": 18}, + # Avalanche + "43114": {"USDC": 6, "USDT": 6, "WETH": 18}, + } + + for chain1, tokens1 in chain_tokens.items(): + for chain2, tokens2 in chain_tokens.items(): + if chain1 == chain2: + continue + for token, decimal in tokens1.items(): + if check_bridge_token(chain1, chain2, token, decimal, tokens2[token]): + print( + chain1, "===>>===", chain2, ":", token, decimal, tokens2[token] + ) + else: + print( + chain1, + "===/////===", + chain2, + ":", + token, + decimal, + tokens2[token], + ) + + +def check_celer_bridge_tokens(bridge_tokens): + for chain1, tokens1 in bridge_tokens.items(): + for chain2, tokens2 in bridge_tokens.items(): + if chain1 == chain2: + continue + for token in tokens1: + decimal1 = tokens1[token]["decimal"] + decimal2 = tokens2[token]["decimal"] + + if check_bridge_token(chain1, chain2, token, decimal1, decimal2): + print(chain1, "===>>===", chain2, ":", token, decimal1, decimal2) + else: + print(chain1, "===/////===", chain2, ":", token, decimal1, decimal2) + + +def get_celer_bridge_tokens(): + select_chains = [ + "1", # Ethereum + "10", # Optimism + "56", # BSC + "137", # Polygon + "42161", # Arbitrum + "43114", # Avalanche + ] + + select_tokens = ["USDC", "USDT", "WETH"] + + url = CELER_GATEWAY + "getTransferConfigs" + response = requests.get(url) + config = json.loads(response.text) + + bridge_tokens = {} + for (chain, tokens) in config["chain_token"].items(): + if chain not in select_chains: + continue + + filter_tokens = {} + for token in tokens["token"]: + if token["token"]["symbol"] in select_tokens: + del token["token"]["xfer_disabled"] + filter_tokens[token["token"]["symbol"]] = { + "decimal": int(token["token"]["decimal"]), + "address": token["token"]["address"], + } + + bridge_tokens[chain] = filter_tokens + + # print(json.dumps(bridge_tokens)) + + check_celer_bridge_tokens(bridge_tokens) + + write_file(tmp_celer_bridge_token, bridge_tokens) + + return bridge_tokens + + +def export_main_celer_chain_path(): + bridge_tokens = read_json(tmp_celer_bridge_token) + # bridge_tokens = get_celer_bridge_tokens() + + celer_contracts = { + "1": { + "cBridge": "0x5427FEFA711Eff984124bFBB1AB6fbf5E3DA1820", + "MessageBus": "0x4066d196a423b2b3b8b054f4f40efb47a74e200c", + }, + "10": { + "cBridge": "0x9D39Fc627A6d9d9F8C831c16995b209548cc3401", + "MessageBus": "0x0D71D18126E03646eb09FEc929e2ae87b7CAE69d", + }, + "56": { + "cBridge": "0xdd90E5E87A2081Dcf0391920868eBc2FFB81a1aF", + "MessageBus": "0x95714818fdd7a5454f73da9c777b3ee6ebaeea6b", + }, + "137": { + "cBridge": "0x88DCDC47D2f83a99CF0000FDF667A468bB958a78", + "MessageBus": "0xaFDb9C40C7144022811F034EE07Ce2E110093fe6", + }, + "42161": { + "cBridge": "0x1619DE6B6B20eD217a58d00f37B9d47C7663feca", + "MessageBus": "0x3ad9d0648cdaa2426331e894e980d0a5ed16257f", + }, + "43114": { + "cBridge": "0xef3c714c9425a8F3697A9C969Dc1af30ba82e5d4", + "MessageBus": "0x5a926eeeafc4d217add17e9641e8ce23cd01ad57", + }, + } + + chain_names = { + "1": "mainnet", + "10": "optimism-main", + "56": "bsc-main", + "137": "polygon-main", + "42161": "arbitrum-main", + "43114": "avax-main", + } + + chain_paths = {} + for chain1, tokens1 in bridge_tokens.items(): + token_paths = {} + for token, decimal in tokens1.items(): + paths = [] + for chain2, tokens2 in bridge_tokens.items(): + if chain1 == chain2: + continue + + # print(chain1, token, "===>>===", chain2, tokens2[token]["address"], tokens2[token]["decimal"]) + + paths.append( + { + "CelerChainId": int(chain2), + "Address": tokens2[token]["address"], + "Decimal": tokens2[token]["decimal"], + } + ) + token_paths[token] = { + "Address": tokens1[token]["address"], + "Decimal": tokens1[token]["decimal"], + "ChainPath": paths, + } + + chain_paths[chain_names[chain1]] = { + "CelerChainId": chain1, + "Bridge": celer_contracts[chain1]["cBridge"], + "MessageBus": celer_contracts[chain1]["MessageBus"], + "SupportToken": token_paths, + } + + # print(json.dumps(chain_paths)) + + write_file(celer_chain_path, chain_paths) + + +def get_celer_support_token(net): + if "bridges" in config["networks"][net].keys(): + tokens = {} + for token in config["networks"][net]["bridges"]["celer"]["token"]: + if token in ["usdt", "usdc", "weth"]: + tokens[token.upper()] = { + "ChainPath": [], + "Address": config["networks"][net]["bridges"]["celer"]["token"][ + token + ]["address"], + "Decimal": config["networks"][net]["bridges"]["celer"]["token"][ + token + ]["decimal"], + } + + return tokens + + +def check_celer_contracts(net, net_config): + message_bus_address = get_celer_message_bus() + message_bus = Contract.from_abi( + "ICelerMessageBus", message_bus_address, interface.ICelerMessageBus.abi + ) + bridge_address = message_bus.liquidityBridge() + bridge = Contract.from_abi( + "ICelerBridge", bridge_address, interface.ICelerBridge.abi + ) + + assert message_bus_address == net_config["MessageBus"] + assert bridge_address == net_config["Bridge"] + + support_tokens = get_celer_support_token(net) + + # check max_send and min_send + for token, info in support_tokens.items(): + token_address = info["Address"] + decimal = info["Decimal"] + assert token_address == net_config["SupportToken"][token]["Address"] + assert decimal == net_config["SupportToken"][token]["Decimal"] + + min_send = bridge.minSend(token_address) + max_send = bridge.maxSend(token_address) + + print( + net, + ":", + token, + "min=", + min_send / 10**decimal, + "max=", + max_send / 10**decimal, + ) + + +def check_main_celer_config(): + # USDC min= 20.0 max= 3500000.0 + # USDT min= 20.0 max= 3500000.0 + # WETH min= 0.015 max= 950.0 + + networks = [ + "mainnet", + "bsc-main", + "avax-main", + "polygon-main", + "arbitrum-main", + "optimism-main", + ] + + chain_path = read_json(celer_chain_path) + + for net in networks: + print(f"[check_main_celer_config] current net: {net}") + + try: + change_network(net) + except: + continue + + check_celer_contracts(net, chain_path[net]) + + +def get_price(contract): + price_feed = Contract.from_abi( + "IAggregatorV3Interface", contract, interface.IAggregatorV3Interface.abi + ) + + decimals = price_feed.decimals() + print(price_feed.description(), "decimas:", decimals) + + ( + _round_id, + price, + _started, + _updated, + _answeredInRound, + ) = price_feed.latestRoundData() + + print("price:", float(price / 10**decimals)) + print("=====================================") + + +def check_main_oracles(): + main_chain_oracles = { + "mainnet": { + "ETHUSD": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419", + "AVAXUSD": "0xFF3EEb22B5E3dE6e705b44749C2559d704923FD7", + "BNBUSD": "0x14e613AC84a31f709eadbdF89C6CC390fDc9540A", + "MATICUSD": "0x7bAC85A8a13A4BcD8abb3eB7d6b4d632c5a57676", + }, + "optimism-main": { + "ETHUSD": "0x13e3Ee699D1909E989722E753853AE30b17e08c5", + "AVAXUSD": "0x5087Dc69Fd3907a016BD42B38022F7f024140727", + "BNBUSD": "0xD38579f7cBD14c22cF1997575eA8eF7bfe62ca2c", + "MATICUSD": "0x0ded608AFc23724f614B76955bbd9dFe7dDdc828", + }, + "bsc-main": { + "ETHUSD": "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e", + "AVAXUSD": "0x5974855ce31EE8E1fff2e76591CbF83D7110F151", + "BNBUSD": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE", + "MATICUSD": "0x7CA57b0cA6367191c94C8914d7Df09A57655905f", + }, + "polygon-main": { + "ETHUSD": "0xF9680D99D6C9589e2a93a78A04A279e509205945", + "AVAXUSD": "0xe01eA2fbd8D76ee323FbEd03eB9a8625EC981A10", + "BNBUSD": "0x82a6c4AF830caa6c97bb504425f6A66165C2c26e", + "MATICUSD": "0xAB594600376Ec9fD91F8e885dADF0CE036862dE0", + }, + "arbitrum-main": { + "ETHUSD": "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612", + "AVAXUSD": "0x8bf61728eeDCE2F32c456454d87B5d6eD6150208", + "BNBUSD": "0x6970460aabF80C5BE983C6b74e5D06dEDCA95D4A", + "MATICUSD": "0x52099D4523531f678Dfc568a7B1e5038aadcE1d6", + }, + "avax-main": { + "ETHUSD": "0x976B3D034E162d8bD72D6b9C989d545b839003b0", + "AVAXUSD": "0x0A77230d17318075983913bC2145DB16C7366156", + # "BNBUSD": "", + "MATICUSD": "0x1db18D41E4AD2403d9f52b5624031a2D9932Fd73", + }, + } + + for net, oracles in main_chain_oracles.items(): + print(f"[check_oracles] current net: {net}") + + change_network(net) + # from config + chain_oracles = get_celer_oracles() + + for oracle in chain_oracles.values(): + assert oracle["address"] == oracles[oracle["pair"]] + get_price(oracle["address"]) + + +def main(): + check_main_celer_config() + check_main_oracles() diff --git a/ethereum/scripts/helpful_scripts.py b/ethereum/scripts/helpful_scripts.py index 7cbdbf00..f4dad8e3 100644 --- a/ethereum/scripts/helpful_scripts.py +++ b/ethereum/scripts/helpful_scripts.py @@ -98,7 +98,7 @@ def change_network(dst_net): if network.is_connected(): network.disconnect() network.connect(dst_net) - if dst_net in ["rinkeby"]: + if dst_net in ["rinkeby", "goerli"]: priority_fee("2 gwei") @@ -233,6 +233,41 @@ def get_native_oracle_address(): return oracles[oracle]["address"] +def get_celer_info(): + return get_current_net_info()["bridges"]["celer"] + + +def get_celer_message_bus(): + try: + return get_celer_info()["message_bus"] + except: + return "" + + +def get_celer_chain_id(): + return get_celer_info()["chainid"] + + +def get_celer_oracles(): + return get_celer_info()["oracle"] + + +def get_celer_native_oracle_address(): + oracles = get_celer_oracles() + chainid = get_celer_chain_id() + for oracle in oracles: + if chainid == oracles[oracle]["chainid"]: + return oracles[oracle]["address"] + + +def get_celer_actual_reserve(): + return get_celer_info()["actual_reserve"] + + +def get_celer_estimate_reserve(): + return get_celer_info()["estimate_reserve"] + + def get_stargate_info(): return get_current_net_info()["stargate"] @@ -274,5 +309,23 @@ def get_token_decimal(token_name: str): return 10 ** get_token_info(token_name)["decimal"] +def get_bridge_token_info(bridge: str, token_name: str): + return get_current_net_info()["bridges"][bridge]["token"][token_name] + + +def get_bridge_token_address(bridge: str, token_name: str): + if token_name == "eth": + return zero_address() + else: + return get_bridge_token_info(bridge, token_name)["address"] + + +def get_bridge_token_decimal(bridge: str, token_name: str): + if token_name == "eth": + return 10**18 + else: + return 10 ** get_bridge_token_info(bridge, token_name)["decimal"] + + def get_account_address(): return get_account().address diff --git a/ethereum/scripts/initialize.py b/ethereum/scripts/initialize.py index 9adf927c..dbc54c2f 100644 --- a/ethereum/scripts/initialize.py +++ b/ethereum/scripts/initialize.py @@ -18,9 +18,15 @@ SerdeFacet, LibSoFeeWormholeV1, web3, + CelerFacet, + LibSoFeeCelerV1, ) from brownie.network import priority_fee +FacetCutAction_ADD = 0 +FacetCutAction_REPLACE = 1 +FacetCutAction_REMOVE = 2 + from scripts.helpful_scripts import ( get_account, get_method_signature_by_abi, @@ -38,6 +44,12 @@ get_swap_info, get_token_decimal, get_stargate_info, + get_celer_chain_id, + get_celer_oracles, + get_celer_message_bus, + get_celer_actual_reserve, + get_celer_estimate_reserve, + get_celer_info, ) @@ -55,6 +67,14 @@ def main(): initialize_stargate(account, so_diamond) except Exception as e: print(f"initialize_stargate fail:{e}") + try: + initialize_celer(account, so_diamond) + except Exception as e: + print(f"initialize_celer fail:{e}") + try: + initialize_celer_fee(account) + except Exception as e: + print(f"initialize_celer_fee fail: {e}") try: initialize_wormhole(account, so_diamond) except Exception as e: @@ -96,6 +116,37 @@ def initialize_wormhole_fee(account): ) +def initialize_celer_fee(account): + # initialize oracle + chain_oracles = get_celer_oracles() + if chain_oracles is None: + return + + chainid = get_celer_chain_id() + + native_oracle_address = "" + for chain in chain_oracles: + if chainid == chain_oracles[chain]["chainid"]: + native_oracle_address = chain_oracles[chain]["address"] + + for chain in chain_oracles: + if chainid == chain_oracles[chain]["chainid"]: + continue + print(f"initialize_celer_fee destination chain: {chain}") + print("pair:", chain_oracles[chain]["pair"]) + + LibSoFeeCelerV1[-1].setPriceConfig( + chain_oracles[chain]["chainid"], + [[chain_oracles[chain]["address"], False], [native_oracle_address, True]], + 60, + {"from": account}, + ) + + # LibSoFeeCelerV1[-1].updatePriceRatio(5, {'from': account}) + + # LibSoFeeCelerV1[-1].setPriceRatio(5, 10, {'from': account}) + + def initialize_cut(account, so_diamond): proxy_cut = Contract.from_abi( "DiamondCutFacet", so_diamond.address, DiamondCutFacet.abi @@ -105,6 +156,7 @@ def initialize_cut(account, so_diamond): DiamondLoupeFacet, DexManagerFacet, OwnershipFacet, + CelerFacet, StargateFacet, WormholeFacet, WithdrawFacet, @@ -125,7 +177,7 @@ def initialize_cut(account, so_diamond): register_funcs[func_name].append(reg_funcs[func_name]) else: register_funcs[func_name] = [reg_funcs[func_name]] - register_data.append([reg_facet, 0, list(reg_funcs.values())]) + register_data.append([reg_facet, FacetCutAction_ADD, list(reg_funcs.values())]) proxy_cut.diamondCut(register_data, zero_address(), b"", {"from": account}) @@ -140,6 +192,24 @@ def initialize_stargate(account, so_diamond): ) +def initialize_celer(account, so_diamond): + proxy_celer = Contract.from_abi("CelerFacet", so_diamond.address, CelerFacet.abi) + net = network.show_active() + print(f"network:{net}, init celer...") + proxy_celer.initCeler( + get_celer_message_bus(), get_celer_chain_id(), {"from": account} + ) + + # setBaseGas + gas = get_celer_info()["gas"] + base_gas = gas["base_gas"] + dst_chains = gas["dst_chainid"] + + print(f"network:{net}, set base gas: {base_gas}, {dst_chains}") + + proxy_celer.setBaseGas(dst_chains, base_gas, {"from": account}) + + def set_wormhole_gas(): so_diamond = SoDiamond[-1] proxy_stargate = Contract.from_abi( @@ -204,6 +274,10 @@ def initialize_dex_manager(account, so_diamond): get_wormhole_bridge(), LibSoFeeWormholeV1[-1].address, {"from": account} ) + proxy_dex.addFee( + get_celer_message_bus(), LibSoFeeCelerV1[-1].address, {"from": account} + ) + def initialize_little_token_for_stargate(): # Transfer a little to SoDiamond as a handling fee @@ -323,6 +397,49 @@ def redeploy_stargate(): initialize_stargate(account, SoDiamond[-1]) +# redeploy and initialize +def redeploy_celer(): + account = get_account() + + if network.show_active() in ["rinkeby", "goerli"]: + priority_fee("2 gwei") + + # proxy_celer = Contract.from_abi("CelerFacet", SoDiamond[-1].address, CelerFacet.abi) + # lastNonce = proxy_celer.getNonce() + # print(f"last nonce: {lastNonce}") + # + # remove_facet(CelerFacet) + + CelerFacet.deploy({"from": account}) + add_cut([CelerFacet]) + + initialize_celer(account, SoDiamond[-1]) + + # proxy_celer = Contract.from_abi("CelerFacet", SoDiamond[-1].address, CelerFacet.abi) + # proxy_celer.setNonce(lastNonce, {"from": account}) + + proxy_dex = Contract.from_abi( + "DexManagerFacet", SoDiamond[-1].address, DexManagerFacet.abi + ) + + so_fee = 1e-3 + ray = 1e27 + + print("Deploy LibSoFeeCelerV1...") + LibSoFeeCelerV1.deploy(int(so_fee * ray), {"from": account}) + + print("AddFee ...") + proxy_dex.addFee( + get_celer_message_bus(), LibSoFeeCelerV1[-1].address, {"from": account} + ) + + print("Initialize celer fee...") + initialize_celer_fee(account) + + # LibSoFeeCelerV1[-1].setPriceRatio(43113, ray, {'from': account}) + # LibSoFeeCelerV1[-1].updatePriceRatio(43113, {'from': account}) + + def remove_dump(a: list, b: list): result = [] for k in a: diff --git a/ethereum/scripts/publish.py b/ethereum/scripts/publish.py index 3d231b73..18caefea 100644 --- a/ethereum/scripts/publish.py +++ b/ethereum/scripts/publish.py @@ -25,6 +25,7 @@ def main(net: str = None): "GenericSwapFacet", "WormholeFacet", "SerdeFacet", + "CelerFacet", ] for c in deployed_contract: print(f"network:{net} publish source: {c}") diff --git a/ethereum/scripts/relayer/oracle_evm.py b/ethereum/scripts/relayer/oracle_evm.py index 753afb8c..1d658272 100644 --- a/ethereum/scripts/relayer/oracle_evm.py +++ b/ethereum/scripts/relayer/oracle_evm.py @@ -7,6 +7,7 @@ WormholeFacet, LibSoFeeWormholeV1, StargateFacet, + LibSoFeeCelerV1, ) import ccxt @@ -52,6 +53,18 @@ def get_prices(symbols=("ETH/USDT", "BNB/USDT", "MATIC/USDT", "AVAX/USDT", "APT/ return prices +def set_celer_bnb_price_on_avax(ratio): + # bnb + dst_celer_id = 56 + old_ratio = int(LibSoFeeCelerV1[-1].getPriceRatio(dst_celer_id)[0]) + print( + f"[set_celer_bnb_price_on_avax]: old: {old_ratio} new: {ratio} percent: {ratio / old_ratio}" + ) + + if old_ratio < ratio or ratio * 1.1 < old_ratio: + LibSoFeeCelerV1[-1].setPriceRatio(dst_celer_id, ratio, {"from": get_account()}) + + def set_so_price(): prices = get_prices() @@ -69,6 +82,9 @@ def set_so_price(): LibSoFeeWormholeV1[-1].setPriceRatio( dst_wormhole_id, ratio, {"from": get_account()} ) + + set_celer_bnb_price_on_avax(ratio) + # aptos dst_wormhole_id = 22 old_ratio = int(LibSoFeeWormholeV1[-1].getPriceRatio(dst_wormhole_id)[0]) diff --git a/ethereum/scripts/uniswap.py b/ethereum/scripts/uniswap.py index b30ade09..3680def8 100644 --- a/ethereum/scripts/uniswap.py +++ b/ethereum/scripts/uniswap.py @@ -22,7 +22,7 @@ def batch_add_liquidity(): current_net = network.show_active() if current_net in ["goerli"]: - priority_fee("1 gwei") + priority_fee("2 gwei") omni_swap_infos = read_json(omni_swap_file) (_, stable_coin_address) = get_stable_coin_address(current_net) @@ -72,3 +72,44 @@ def create_pair_and_add_liquidity(token1_address, token2_address): int(time.time() + 3000), {"from": account}, ) + + +def create_pair_and_add_liquidity_for_celer(): + if network.show_active() not in ["goerli"]: + print("Only support avax-test") + return + + account = get_account() + token1_address = "0xCbE56b00d173A26a5978cE90Db2E33622fD95A28" # celer-usdc + token2_address = "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6" # weth + + router_address = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" + router = Contract.from_abi( + "Router", router_address, interface.IUniswapV2Router02.abi + ) + factory_address = router.factory() + factory = Contract.from_abi( + "Factory", factory_address, interface.IUniswapV2Factory.abi + ) + with contextlib.suppress(Exception): + factory.createPair(token1_address, token2_address, {"from": account}) + # approve + token1 = Contract.from_abi("ERC20", token1_address, ERC20.abi) + token1_amount = int(100 * 10 ** token1.decimals()) + token1.approve(router_address, token1_amount, {"from": account}) + + token2 = Contract.from_abi("ERC20", token2_address, ERC20.abi) + token2_amount = int(0.1 * 10 ** token2.decimals()) + token2.approve(router_address, token2_amount, {"from": account}) + + router.addLiquidity( + token1_address, + token2_address, + token1_amount, + token2_amount, + 0, + 0, + account, + int(time.time() + 3000), + {"from": account}, + )