From 764aed8d457ec818a68892b518de6bf0d3a3274d Mon Sep 17 00:00:00 2001 From: Adrien Lacombe Date: Mon, 18 Dec 2023 07:47:00 +0100 Subject: [PATCH] add okx on mainnet --- ...0df4f312e745d270119c6052904fb6790.abi.json | 323 ++++++++++++++++++ ...eabb01ec9de53ece7a96f1c951f886dd2.abi.json | 73 ++++ ...a8974a4bc36e60e2d490bb8d72899ee9f.abi.json | 122 +++++++ ethereum/okx/b2c.json | 60 ++++ 4 files changed, 578 insertions(+) create mode 100644 ethereum/okx/abis/0x3b3ae790df4f312e745d270119c6052904fb6790.abi.json create mode 100644 ethereum/okx/abis/0x7251febeabb01ec9de53ece7a96f1c951f886dd2.abi.json create mode 100644 ethereum/okx/abis/0xfc99f58a8974a4bc36e60e2d490bb8d72899ee9f.abi.json create mode 100644 ethereum/okx/b2c.json diff --git a/ethereum/okx/abis/0x3b3ae790df4f312e745d270119c6052904fb6790.abi.json b/ethereum/okx/abis/0x3b3ae790df4f312e745d270119c6052904fb6790.abi.json new file mode 100644 index 00000000..7f9e2cca --- /dev/null +++ b/ethereum/okx/abis/0x3b3ae790df4f312e745d270119c6052904fb6790.abi.json @@ -0,0 +1,323 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fromToken", + "type": "uint256" + }, + { + "internalType": "address", + "name": "toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fromTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReturnAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadLine", + "type": "uint256" + } + ], + "internalType": "struct DexRouter.BaseRequest", + "name": "baseRequest", + "type": "tuple" + }, + { + "internalType": "uint256[]", + "name": "batchesAmount", + "type": "uint256[]" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "mixAdapters", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "assetTo", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "rawData", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "extraData", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "fromToken", + "type": "uint256" + } + ], + "internalType": "struct DexRouter.RouterPath[][]", + "name": "batches", + "type": "tuple[][]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pathIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "fromToken", + "type": "address" + }, + { + "internalType": "address", + "name": "toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fromTokenAmountMax", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTokenAmountMax", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadLine", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isPushOrder", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extension", + "type": "bytes" + } + ], + "internalType": "struct PMMLib.PMMSwapRequest[]", + "name": "extraData", + "type": "tuple[]" + } + ], + "name": "smartSwapByOrderId", + "outputs": [ + { + "internalType": "uint256", + "name": "returnAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "fromTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReturnAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadLine", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "fromNative", + "type": "bool" + }, + { + "internalType": "bool", + "name": "toNative", + "type": "bool" + } + ], + "internalType": "struct PMMLib.PMMBaseRequest", + "name": "baseRequest", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pathIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "fromToken", + "type": "address" + }, + { + "internalType": "address", + "name": "toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fromTokenAmountMax", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTokenAmountMax", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadLine", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isPushOrder", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extension", + "type": "bytes" + } + ], + "internalType": "struct PMMLib.PMMSwapRequest", + "name": "request", + "type": "tuple" + } + ], + "name": "PMMV2Swap", + "outputs": [ + { + "internalType": "uint256", + "name": "returnAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReturn", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "pools", + "type": "bytes32[]" + } + ], + "name": "unxswapByOrderId", + "outputs": [ + { + "internalType": "uint256", + "name": "returnAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "recipient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReturn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "pools", + "type": "uint256[]" + } + ], + "name": "uniswapV3SwapTo", + "outputs": [ + { + "internalType": "uint256", + "name": "returnAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + } +] \ No newline at end of file diff --git a/ethereum/okx/abis/0x7251febeabb01ec9de53ece7a96f1c951f886dd2.abi.json b/ethereum/okx/abis/0x7251febeabb01ec9de53ece7a96f1c951f886dd2.abi.json new file mode 100644 index 00000000..121fcf05 --- /dev/null +++ b/ethereum/okx/abis/0x7251febeabb01ec9de53ece7a96f1c951f886dd2.abi.json @@ -0,0 +1,73 @@ +[ + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "internalType": "struct Entrance.TokenInInfo[]", + "name": "tokenIn", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct Entrance.TokenAmount[]", + "name": "tokenOut", + "type": "tuple[]" + } + ], + "internalType": "struct Entrance.BaseRequest", + "name": "request", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Entrance.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } +] diff --git a/ethereum/okx/abis/0xfc99f58a8974a4bc36e60e2d490bb8d72899ee9f.abi.json b/ethereum/okx/abis/0xfc99f58a8974a4bc36e60e2d490bb8d72899ee9f.abi.json new file mode 100644 index 00000000..1bd00137 --- /dev/null +++ b/ethereum/okx/abis/0xfc99f58a8974a4bc36e60e2d490bb8d72899ee9f.abi.json @@ -0,0 +1,122 @@ +[ + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "adaptorId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "toChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extData", + "type": "bytes" + } + ], + "internalType": "struct XBridge.BridgeRequestV2", + "name": "_request", + "type": "tuple" + } + ], + "name": "bridgeToV2", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "fromToken", + "type": "address" + }, + { + "internalType": "address", + "name": "toToken", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "adaptorId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fromTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTokenMinAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toChainToTokenMinAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "dexData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extData", + "type": "bytes" + } + ], + "internalType": "struct XBridge.SwapBridgeRequestV2", + "name": "_request", + "type": "tuple" + } + ], + "name": "swapBridgeToV2", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } +] diff --git a/ethereum/okx/b2c.json b/ethereum/okx/b2c.json new file mode 100644 index 00000000..e8f53b21 --- /dev/null +++ b/ethereum/okx/b2c.json @@ -0,0 +1,60 @@ +{ + "blockchainName": "ethereum", + "chainId": 1, + "contracts": [ + { + "address": "0x7251febeabb01ec9de53ece7a96f1c951f886dd2", + "contractName": "OKXEarnEntryPoint", + "selectors": { + "0x016cba5f": { + "erc20OfInterest": [], + "method": "execute", + "plugin": "OKX Web3" + } + } + }, + { + "address": "0x3b3ae790df4f312e745d270119c6052904fb6790", + "contractName": "OKX DEX. Aggregation Router", + "selectors": { + "0x0d5f0e3b": { + "erc20OfInterest": [], + "method": "uniswapV3SwapTo", + "plugin": "OKX Web3" + }, + "0x12a0ddc7": { + "erc20OfInterest": [], + "method": "PMMV2Swap", + "plugin": "OKX Web3" + }, + "0x9871efa4": { + "erc20OfInterest": [], + "method": "unxswapByOrderId", + "plugin": "OKX Web3" + }, + "0xb80c2f09": { + "erc20OfInterest": [], + "method": "smartSwapByOrderId", + "plugin": "OKX Web3" + } + } + }, + { + "address": "0xfc99f58a8974a4bc36e60e2d490bb8d72899ee9f", + "contractName": "OKX DEX. Aggregation Router", + "selectors": { + "0x3d21e25a": { + "erc20OfInterest": [], + "method": "swapBridgeToV2", + "plugin": "OKX Web3" + }, + "0x972250fe": { + "erc20OfInterest": [], + "method": "bridgeToV2", + "plugin": "OKX Web3" + } + } + } + ], + "name": "OKX Web3" +} \ No newline at end of file