TransitSwapRouterV5

0x07964f135f276412b3182a3b2407b8dd45000000

Verification
Verified
v0.8.28+commit.7893614a
Type
Contract
20,178 bytes
ABI entries
42
9 read · 17 write
License
none

Contract information

Address
0x07964f135f276412b3182a3b2407b8dd45000000
Chain
Robinhood Chain (4663)
Compiler
v0.8.28+commit.7893614a
Optimization
Enabled
Creation tx
0xdb906cb972…ae74b39231

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (9)

CHECKFEE_TYPEHASH()bytes32
DOMAIN_SEPARATOR()bytes32
executor()address
paused(uint8)bool
pausedOverAll()bool, bool, bool, bool
pendingExecutor()address
transitAllowedQuery(address, address, uint256)bool, bool, tuple
transitFee()uint256, uint256, address
transitProxyAddress()address, address

Events (14)

ChangeAggregateBridgeChangeCrossCallerAllowedChangeFeeRateChangeSignerChangeV3FactoryAllowedChangeVaultChangeWrappedAllowedExecutorshipTransferStartedExecutorshipTransferredPausedReceiptTransitSwappedUnpausedWithdraw

ABI

[
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "newBridge",
        "type": "address"
      }
    ],
    "name": "ChangeAggregateBridge",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address[]",
        "name": "callers",
        "type": "address[]"
      }
    ],
    "name": "ChangeCrossCallerAllowed",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "bool",
        "name": "isAggregate",
        "type": "bool"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "newRate",
        "type": "uint256"
      }
    ],
    "name": "ChangeFeeRate",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "preSigner",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "address",
        "name": "newSigner",
        "type": "address"
      }
    ],
    "name": "ChangeSigner",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256[]",
        "name": "poolIndex",
        "type": "uint256[]"
      },
      {
        "indexed": false,
        "internalType": "address[]",
        "name": "factories",
        "type": "address[]"
      },
      {
        "indexed": false,
        "internalType": "bytes[]",
        "name": "initCodeHash",
        "type": "bytes[]"
      }
    ],
    "name": "ChangeV3FactoryAllowed",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "preVault",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "address",
        "name": "newVault",
        "type": "address"
      }
    ],
    "name": "ChangeVault",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address[]",
        "name": "wrappedTokens",
        "type": "address[]"
      },
      {
        "indexed": false,
        "internalType": "bool[]",
        "name": "newAllowed",
        "type": "bool[]"
      }
    ],
    "name": "ChangeWrappedAllowed",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "previousExecutor",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "newExecutor",
        "type": "address"
      }
    ],
    "name": "ExecutorshipTransferStarted",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "previousExecutor",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "newExecutor",
        "type": "address"
      }
    ],
    "name": "ExecutorshipTransferred",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "enum Pausable.FunctionFlag",
        "name": "flag",
        "type": "uint8"
      }
    ],
    "name": "Paused",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "Receipt",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "srcToken",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "dstToken",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "dstReceiver",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "returnAmount",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "toChainID",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "string",
        "name": "channel",
        "type": "string"
      }
    ],
    "name": "TransitSwapped",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "enum Pausable.FunctionFlag",
        "name": "flag",
        "type": "uint8"
      }
    ],
    "name": "Unpaused",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "token",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "executor",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "recipient",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "Withdraw",
    "type": "event"
  },
  {
    "stateMutability": "nonpayable",
    "type": "fallback"
  },
  {
    "inputs": [],
    "name": "CHECKFEE_TYPEHASH",
    "outputs": [
      {
        "internalType": "bytes32",
        "name": "",
        "type": "bytes32"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "DOMAIN_SEPARATOR",
    "outputs": [
      {
        "internalType": "bytes32",
        "name": "",
        "type": "bytes32"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "acceptExecutorship",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "srcToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstReceiver",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "wrappedToken",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "minReturnAmount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fee",
            "type": "uint256"
          },
          {
            "internalType": "string",
            "name": "channel",
            "type": "string"
          },
          {
            "internalType": "bytes",
            "name": "signature",
            "type": "bytes"
          }
        ],
        "internalType": "struct BaseCore.TransitSwapDescription",
        "name": "desc",
        "type": "tuple"
      },
      {
        "components": [
          {
            "internalType": "address",
            "name": "srcToken",
            "type": "address"
          },
          {
            "internalType": "bytes",
            "name": "calldatas",
            "type": "bytes"
          }
        ],
        "internalType": "struct BaseCore.CallbytesDescription",
        "name": "callbytesDesc",
        "type": "tuple"
      }
    ],
    "name": "aggregate",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "returnAmount",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "srcToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstReceiver",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "wrappedToken",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "minReturnAmount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fee",
            "type": "uint256"
          },
          {
            "internalType": "string",
            "name": "channel",
            "type": "string"
          },
          {
            "internalType": "bytes",
            "name": "signature",
            "type": "bytes"
          }
        ],
        "internalType": "struct BaseCore.TransitSwapDescription",
        "name": "desc",
        "type": "tuple"
      },
      {
        "components": [
          {
            "internalType": "address",
            "name": "srcToken",
            "type": "address"
          },
          {
            "internalType": "bytes",
            "name": "calldatas",
            "type": "bytes"
          }
        ],
        "internalType": "struct BaseCore.CallbytesDescription",
        "name": "callbytesDesc",
        "type": "tuple"
      }
    ],
    "name": "aggregateAndGasUsed",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "returnAmount",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "gasUsed",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address[]",
        "name": "crossCallers",
        "type": "address[]"
      },
      {
        "internalType": "address[]",
        "name": "wrappedTokens",
        "type": "address[]"
      }
    ],
    "name": "changeAllowed",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "bool[]",
        "name": "isAggregate",
        "type": "bool[]"
      },
      {
        "internalType": "uint256[]",
        "name": "newRate",
        "type": "uint256[]"
      }
    ],
    "name": "changeFee",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "bool",
        "name": "paused",
        "type": "bool"
      },
      {
        "internalType": "enum Pausable.FunctionFlag[]",
        "name": "flags",
        "type": "uint8[]"
      }
    ],
    "name": "changePause",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "aggregator",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "signer",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "vault",
        "type": "address"
      }
    ],
    "name": "changeTransitProxy",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256[]",
        "name": "poolIndex",
        "type": "uint256[]"
      },
      {
        "internalType": "address[]",
        "name": "factories",
        "type": "address[]"
      },
      {
        "internalType": "bytes[]",
        "name": "initCodeHash",
        "type": "bytes[]"
      }
    ],
    "name": "changeUniswapV3FactoryAllowed",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "srcToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "caller",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstReceiver",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "wrappedToken",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fee",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "toChain",
            "type": "uint256"
          },
          {
            "internalType": "string",
            "name": "channel",
            "type": "string"
          },
          {
            "internalType": "bytes",
            "name": "calls",
            "type": "bytes"
          },
          {
            "internalType": "bytes",
            "name": "signature",
            "type": "bytes"
          }
        ],
        "internalType": "struct BaseCore.CrossDescription",
        "name": "desc",
        "type": "tuple"
      }
    ],
    "name": "cross",
    "outputs": [],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "dstReceiver",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "wrappedToken",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "router",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "minReturnAmount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fee",
            "type": "uint256"
          },
          {
            "internalType": "address[]",
            "name": "path",
            "type": "address[]"
          },
          {
            "internalType": "address[]",
            "name": "pool",
            "type": "address[]"
          },
          {
            "internalType": "bytes",
            "name": "signature",
            "type": "bytes"
          },
          {
            "internalType": "string",
            "name": "channel",
            "type": "string"
          }
        ],
        "internalType": "struct BaseCore.ExactInputV2SwapParams",
        "name": "exactInput",
        "type": "tuple"
      },
      {
        "internalType": "uint256",
        "name": "deadline",
        "type": "uint256"
      }
    ],
    "name": "exactInputV2Swap",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "returnAmount",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "dstReceiver",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "wrappedToken",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "router",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "minReturnAmount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fee",
            "type": "uint256"
          },
          {
            "internalType": "address[]",
            "name": "path",
            "type": "address[]"
          },
          {
            "internalType": "address[]",
            "name": "pool",
            "type": "address[]"
          },
          {
            "internalType": "bytes",
            "name": "signature",
            "type": "bytes"
          },
          {
            "internalType": "string",
            "name": "channel",
            "type": "string"
          }
        ],
        "internalType": "struct BaseCore.ExactInputV2SwapParams",
        "name": "exactInput",
        "type": "tuple"
      },
      {
        "internalType": "uint256",
        "name": "deadline",
        "type": "uint256"
      }
    ],
    "name": "exactInputV2SwapAndGasUsed",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "returnAmount",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "gasUsed",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "srcToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstReceiver",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "wrappedToken",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "minReturnAmount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fee",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "deadline",
            "type": "uint256"
          },
          {
            "internalType": "uint256[]",
            "name": "pools",
            "type": "uint256[]"
          },
          {
            "internalType": "bytes",
            "name": "signature",
            "type": "bytes"
          },
          {
            "internalType": "string",
            "name": "channel",
            "type": "string"
          }
        ],
        "internalType": "struct BaseCore.ExactInputV3SwapParams",
        "name": "params",
        "type": "tuple"
      }
    ],
    "name": "exactInputV3Swap",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "returnAmount",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "srcToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstToken",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "dstReceiver",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "wrappedToken",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "minReturnAmount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fee",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "deadline",
            "type": "uint256"
          },
          {
            "internalType": "uint256[]",
            "name": "pools",
            "type": "uint256[]"
          },
          {
            "internalType": "bytes",
            "name": "signature",
            "type": "bytes"
          },
          {
            "internalType": "string",
            "name": "channel",
            "type": "string"
          }
        ],
        "internalType": "struct BaseCore.ExactInputV3SwapParams",
        "name": "params",
        "type": "tuple"
      }
    ],
    "name": "exactInputV3SwapAndGasUsed",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "returnAmount",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "gasUsed",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "executor",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "int256",
        "name": "amount0Delta",
        "type": "int256"
      },
      {
        "internalType": "int256",
        "name": "amount1Delta",
        "type": "int256"
      },
      {
        "internalType": "bytes",
        "name": "_data",
        "type": "bytes"
      }
    ],
    "name": "pancakeV3SwapCallback",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "enum Pausable.FunctionFlag",
        "name": "flag",
        "type": "uint8"
      }
    ],
    "name": "paused",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "pausedOverAll",
    "outputs": [
      {
        "internalType": "bool",
        "name": "executeAggregate",
        "type": "bool"
      },
      {
        "internalType": "bool",
        "name": "executeV2Swap",
        "type": "bool"
      },
      {
        "internalType": "bool",
        "name": "executeV3Swap",
        "type": "bool"
      },
      {
        "internalType": "bool",
        "name": "cross",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "pendingExecutor",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "newExecutor",
        "type": "address"
      }
    ],
    "name": "transferExecutorship",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "crossCaller",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "wrappedToken",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "poolIndex",
        "type": "uint256"
      }
    ],
    "name": "transitAllowedQuery",
    "outputs": [
      {
        "internalType": "bool",
        "name": "isCrossCallerAllowed",
        "type": "bool"
      },
      {
        "internalType": "bool",
        "name": "isWrappedAllowed",
        "type": "bool"
      },
      {
        "components": [
          {
            "internalType": "address",
            "name": "factory",
            "type": "address"
          },
          {
            "internalType": "bytes",
            "name": "initCodeHash",
            "type": "bytes"
          }
        ],
        "internalType": "struct BaseCore.UniswapV3Pool",
        "name": "pool",
        "type": "tuple"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "transitFee",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "transitProxyAddress",
    "outputs": [
      {
        "internalType": "address",
        "name": "bridgeProxy",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "feeSigner",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "int256",
        "name": "amount0Delta",
        "type": "int256"
      },
      {
        "internalType": "int256",
        "name": "amount1Delta",
        "type": "int256"
      },
      {
        "internalType": "bytes",
        "name": "_data",
        "type": "bytes"
      }
    ],
    "name": "uniswapV3SwapCallback",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address[]",
        "name": "tokens",
        "type": "address[]"
      },
      {
        "internalType": "address",
        "name": "recipient",
        "type": "address"
      }
    ],
    "name": "withdrawTokens",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "stateMutability": "payable",
    "type": "receive"
  }
]

Source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "./UniswapV2Router.sol";
import "./UniswapV3Router.sol";
import "./AggregateRouter.sol";
import "./CrossRouter.sol";

contract TransitSwapRouterV5 is UniswapV2Router, UniswapV3Router, AggregateRouter, CrossRouter  {

    function withdrawTokens(address[] memory tokens, address recipient) external onlyExecutor {
        for (uint index; index < tokens.length; index++) {
            uint amount;
            if (TransferHelper.isETH(tokens[index])) {
                amount = address(this).balance;
                TransferHelper.safeTransferETH(recipient, amount);
            } else {
                amount = IERC20(tokens[index]).balanceOf(address(this));
                TransferHelper.safeTransferWithoutRequire(tokens[index], recipient, amount);
            }
            emit Withdraw(tokens[index], msg.sender, recipient, amount);
        }
    }
}
Chain explorer1983msChain node88ms