diff --git a/src/swap/defi/abi/TC_AVAX_GENERIC.ts b/src/swap/defi/abi/TC_AVAX_GENERIC.ts deleted file mode 100644 index da0ad902..00000000 --- a/src/swap/defi/abi/TC_AVAX_GENERIC.ts +++ /dev/null @@ -1,106 +0,0 @@ -export default [ - { - inputs: [{ internalType: 'address', name: '_ttp', type: 'address' }], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'address', name: 'router', type: 'address' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_AVAX_PANGOLIN.ts b/src/swap/defi/abi/TC_AVAX_PANGOLIN.ts deleted file mode 100644 index 90784aca..00000000 --- a/src/swap/defi/abi/TC_AVAX_PANGOLIN.ts +++ /dev/null @@ -1,140 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { - internalType: 'contract IUniswapRouterV2AVAX', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_AVAX_TRADER_JOE.ts b/src/swap/defi/abi/TC_AVAX_TRADER_JOE.ts deleted file mode 100644 index 90784aca..00000000 --- a/src/swap/defi/abi/TC_AVAX_TRADER_JOE.ts +++ /dev/null @@ -1,140 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { - internalType: 'contract IUniswapRouterV2AVAX', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_GENERIC.ts b/src/swap/defi/abi/TC_ETH_GENERIC.ts deleted file mode 100644 index da0ad902..00000000 --- a/src/swap/defi/abi/TC_ETH_GENERIC.ts +++ /dev/null @@ -1,106 +0,0 @@ -export default [ - { - inputs: [{ internalType: 'address', name: '_ttp', type: 'address' }], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'address', name: 'router', type: 'address' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_LEG_UNISWAP_V2.ts b/src/swap/defi/abi/TC_ETH_LEG_UNISWAP_V2.ts deleted file mode 100644 index dfda8366..00000000 --- a/src/swap/defi/abi/TC_ETH_LEG_UNISWAP_V2.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'address', name: '_legToken', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'legToken', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV2', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_SHORT_SUSHISWAP.ts b/src/swap/defi/abi/TC_ETH_SHORT_SUSHISWAP.ts deleted file mode 100644 index f11ff270..00000000 --- a/src/swap/defi/abi/TC_ETH_SHORT_SUSHISWAP.ts +++ /dev/null @@ -1,136 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV2', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V2.ts b/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V2.ts deleted file mode 100644 index f11ff270..00000000 --- a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V2.ts +++ /dev/null @@ -1,136 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV2', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_001.ts b/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_001.ts deleted file mode 100644 index e1095ccb..00000000 --- a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_001.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'uint24', name: '_poolFee', type: 'uint24' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolFee', - outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV3', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'contract IWETH9', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_005.ts b/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_005.ts deleted file mode 100644 index e1095ccb..00000000 --- a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_005.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'uint24', name: '_poolFee', type: 'uint24' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolFee', - outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV3', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'contract IWETH9', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_03.ts b/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_03.ts deleted file mode 100644 index e1095ccb..00000000 --- a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_03.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'uint24', name: '_poolFee', type: 'uint24' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolFee', - outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV3', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'contract IWETH9', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_1.ts b/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_1.ts deleted file mode 100644 index e1095ccb..00000000 --- a/src/swap/defi/abi/TC_ETH_SHORT_UNISWAP_V3_1.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'uint24', name: '_poolFee', type: 'uint24' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolFee', - outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV3', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'contract IWETH9', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_SUSHISWAP.ts b/src/swap/defi/abi/TC_ETH_SUSHISWAP.ts deleted file mode 100644 index f11ff270..00000000 --- a/src/swap/defi/abi/TC_ETH_SUSHISWAP.ts +++ /dev/null @@ -1,136 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV2', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_UNISWAP_V2.ts b/src/swap/defi/abi/TC_ETH_UNISWAP_V2.ts deleted file mode 100644 index f11ff270..00000000 --- a/src/swap/defi/abi/TC_ETH_UNISWAP_V2.ts +++ /dev/null @@ -1,136 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV2', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_UNISWAP_V3_005.ts b/src/swap/defi/abi/TC_ETH_UNISWAP_V3_005.ts deleted file mode 100644 index e1095ccb..00000000 --- a/src/swap/defi/abi/TC_ETH_UNISWAP_V3_005.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'uint24', name: '_poolFee', type: 'uint24' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolFee', - outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV3', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'contract IWETH9', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_UNISWAP_V3_03.ts b/src/swap/defi/abi/TC_ETH_UNISWAP_V3_03.ts deleted file mode 100644 index e1095ccb..00000000 --- a/src/swap/defi/abi/TC_ETH_UNISWAP_V3_03.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'uint24', name: '_poolFee', type: 'uint24' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolFee', - outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV3', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'contract IWETH9', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/TC_ETH_UNISWAP_V3_1.ts b/src/swap/defi/abi/TC_ETH_UNISWAP_V3_1.ts deleted file mode 100644 index e1095ccb..00000000 --- a/src/swap/defi/abi/TC_ETH_UNISWAP_V3_1.ts +++ /dev/null @@ -1,144 +0,0 @@ -export default [ - { - inputs: [ - { internalType: 'address', name: '_ttp', type: 'address' }, - { internalType: 'address', name: '_weth', type: 'address' }, - { internalType: 'address', name: '_swapRouter', type: 'address' }, - { internalType: 'uint24', name: '_poolFee', type: 'uint24' } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' }, - { - indexed: false, - internalType: 'address', - name: 'feeRecipient', - type: 'address' - } - ], - name: 'FeeSet', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address' - }, - { indexed: false, internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'OwnerSet', - type: 'event' - }, - { - inputs: [], - name: 'fee', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'feeRecipient', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'owners', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolFee', - outputs: [{ internalType: 'uint24', name: '', type: 'uint24' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { internalType: 'uint256', name: '_fee', type: 'uint256' }, - { internalType: 'address', name: '_feeRecipient', type: 'address' } - ], - name: 'setFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'bool', name: 'active', type: 'bool' } - ], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'tcRouter', type: 'address' }, - { internalType: 'address', name: 'tcVault', type: 'address' }, - { internalType: 'string', name: 'tcMemo', type: 'string' }, - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' } - ], - name: 'swapIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { internalType: 'address', name: 'token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' } - ], - name: 'swapOut', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [], - name: 'swapRouter', - outputs: [ - { internalType: 'contract IUniswapRouterV3', name: '', type: 'address' } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'tokenTransferProxy', - outputs: [ - { - internalType: 'contract TSAggregatorTokenTransferProxy', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'weth', - outputs: [{ internalType: 'contract IWETH9', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function' - }, - { stateMutability: 'payable', type: 'receive' } -] diff --git a/src/swap/defi/abi/abiMap.ts b/src/swap/defi/abi/abiMap.ts deleted file mode 100644 index 6389efca..00000000 --- a/src/swap/defi/abi/abiMap.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { ContractInterface } from 'ethers' - -import TC_AVAX_GENERIC from './TC_AVAX_GENERIC' -import TC_AVAX_PANGOLIN from './TC_AVAX_PANGOLIN' -import TC_AVAX_TRADER_JOE from './TC_AVAX_TRADER_JOE' -import TC_ETH_GENERIC from './TC_ETH_GENERIC' -import TC_ETH_LEG_UNISWAP_V2 from './TC_ETH_LEG_UNISWAP_V2' -import TC_ETH_SHORT_SUSHISWAP from './TC_ETH_SHORT_SUSHISWAP' -import TC_ETH_SHORT_UNISWAP_V2 from './TC_ETH_SHORT_UNISWAP_V2' -import TC_ETH_SHORT_UNISWAP_V3_001 from './TC_ETH_SHORT_UNISWAP_V3_001' -import TC_ETH_SHORT_UNISWAP_V3_1 from './TC_ETH_SHORT_UNISWAP_V3_1' -import TC_ETH_SHORT_UNISWAP_V3_03 from './TC_ETH_SHORT_UNISWAP_V3_03' -import TC_ETH_SHORT_UNISWAP_V3_005 from './TC_ETH_SHORT_UNISWAP_V3_005' -import TC_ETH_SUSHISWAP from './TC_ETH_SUSHISWAP' -import TC_ETH_UNISWAP_V2 from './TC_ETH_UNISWAP_V2' -import TC_ETH_UNISWAP_V3_1 from './TC_ETH_UNISWAP_V3_1' -import TC_ETH_UNISWAP_V3_03 from './TC_ETH_UNISWAP_V3_03' -import TC_ETH_UNISWAP_V3_005 from './TC_ETH_UNISWAP_V3_005' - -export type TcRouterType = - | 'TC_ROUTER_GENERIC' - | 'TC_ROUTER_UNISWAP' - | 'TC_ROUTER_PANGOLIN' - | 'INVALID' -interface AbiMap { - [pluginId: string]: { - [contractAddress: string]: { - name: string - type: TcRouterType - data: ContractInterface - } - } -} -export const abiMap: AbiMap = { - ethereum: { - '0x7c38b8b2eff28511ecc14a621e263857fb5771d3': { - name: 'Thorchain Aggregator Ethereum Uniswap V2', - data: TC_ETH_UNISWAP_V2, - type: 'TC_ROUTER_UNISWAP' - }, - '0x0f2cd5df82959e00be7afeef8245900fc4414199': { - name: 'Thorchain Aggregator Ethereum Sushiswap', - data: TC_ETH_SUSHISWAP, - type: 'INVALID' - }, - '0x0747c681e5ada7936ad915ccff6cd3bd71dbf121': { - name: 'Thorchain Aggregator Ethereum Uniswap V3 0.05%', - data: TC_ETH_UNISWAP_V3_005, - type: 'TC_ROUTER_UNISWAP' - }, - '0xd1ea5f7ce9da98d0bd7b1f4e3e05985e88b1ef10': { - name: 'Thorchain Aggregator Ethereum Uniswap V3 0.3%', - data: TC_ETH_UNISWAP_V3_03, - type: 'TC_ROUTER_UNISWAP' - }, - '0x94a852f0a21e473078846cf88382dd8d15bd1dfb': { - name: 'Thorchain Aggregator Ethereum Uniswap V3 1.0%', - data: TC_ETH_UNISWAP_V3_1, - type: 'TC_ROUTER_UNISWAP' - }, - '0x3660de6c56cfd31998397652941ece42118375da': { - name: 'Thorchain Aggregator Leg Ethereum Uniswap V2', - data: TC_ETH_LEG_UNISWAP_V2, - type: 'TC_ROUTER_UNISWAP' - }, - '0xd31f7e39afecec4855fecc51b693f9a0cec49fd2': { - name: 'Thorchain Aggregator Ethereum Generic', - data: TC_ETH_GENERIC, - type: 'TC_ROUTER_GENERIC' - }, - '0x86904eb2b3c743400d03f929f2246efa80b91215': { - name: 'Thorchain Aggregator Ethereum Short Notation Uniswap V2', - data: TC_ETH_SHORT_UNISWAP_V2, - type: 'TC_ROUTER_UNISWAP' - }, - '0xbf365e79aa44a2164da135100c57fdb6635ae870': { - name: 'Thorchain Aggregator Ethereum Short Notation Sushiswap', - data: TC_ETH_SHORT_SUSHISWAP, - type: 'TC_ROUTER_UNISWAP' - }, - '0xbd68cbe6c247e2c3a0e36b8f0e24964914f26ee8': { - name: 'Thorchain Aggregator Ethereum Short Notation Uniswap V3 0.01%', - data: TC_ETH_SHORT_UNISWAP_V3_001, - type: 'TC_ROUTER_UNISWAP' - }, - '0xe4ddca21881bac219af7f217703db0475d2a9f02': { - name: 'Thorchain Aggregator Ethereum Short Notation Uniswap V3 0.005', - data: TC_ETH_SHORT_UNISWAP_V3_005, - type: 'TC_ROUTER_UNISWAP' - }, - '0x11733abf0cdb43298f7e949c930188451a9a9ef2': { - name: 'Thorchain Aggregator Ethereum Short Notation Uniswap V3 0.3%', - data: TC_ETH_SHORT_UNISWAP_V3_03, - type: 'TC_ROUTER_UNISWAP' - }, - '0xb33874810e5395eb49d8bd7e912631db115d5a03': { - name: 'Thorchain Aggregator Ethereum Short Notation Uniswap V3 1%', - data: TC_ETH_SHORT_UNISWAP_V3_1, - type: 'TC_ROUTER_UNISWAP' - } - }, - avalanche: { - '0x942c6da485fd6cef255853ef83a149d43a73f18a': { - name: 'Thorchain Aggregator Avalanche Pangolin', - data: TC_AVAX_PANGOLIN, - type: 'TC_ROUTER_PANGOLIN' - }, - '0x3b7dbdd635b99cea39d3d95dbd0217f05e55b212': { - name: 'Thorchain Aggregator Avalanche Trader Joe', - data: TC_AVAX_TRADER_JOE, - type: 'TC_ROUTER_UNISWAP' - }, - '0x7c38b8b2eff28511ecc14a621e263857fb5771d3': { - name: 'Thorchain Aggregator Avalanche Generic', - data: TC_AVAX_GENERIC, - type: 'TC_ROUTER_GENERIC' - } - } -} diff --git a/src/swap/defi/thorchain/swapkit.ts b/src/swap/defi/thorchain/swapkit.ts index 20511be9..086ed638 100644 --- a/src/swap/defi/thorchain/swapkit.ts +++ b/src/swap/defi/thorchain/swapkit.ts @@ -19,10 +19,8 @@ import { EdgeSwapQuote, EdgeSwapRequest, EdgeTransaction, - JsonObject, SwapCurrencyError } from 'edge-core-js/types' -import { ethers } from 'ethers' import { checkInvalidCodes, @@ -39,7 +37,6 @@ import { promiseWithTimeout } from '../../../util/utils' import { EdgeSwapRequestPlugin } from '../../types' -import { abiMap } from '../abi/abiMap' import { getEvmApprovalData, getEvmTokenData } from '../defiUtils' import { AFFILIATE_FEE_BASIS_DEFAULT, @@ -92,6 +89,9 @@ const asThorSwapRoute = asObject({ // expectedOutputMaxSlippage: asString, // expectedOutputUSD: asString, // expectedOutputMaxSlippageUSD: asString, + transaction: asObject({ + data: asString + }), deadline: asOptional(asString) }) @@ -319,7 +319,13 @@ export function makeSwapKitPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin { if (thorSwap == null) throw new SwapCurrencyError(swapInfo, request) - const { providers, path, contractMethod, expectedOutput } = thorSwap + const { + providers, + path, + contractMethod, + expectedOutput, + transaction + } = thorSwap const calldata = asCalldata(thorSwap.calldata) @@ -362,7 +368,6 @@ export function makeSwapKitPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin { log.warn(memo) const contractAddress = tcDirect ? router : thorSwap.contract - const calldataAny: any = thorSwap.calldata let ethNativeAmount = nativeAmount let publicAddress = thorAddress let approvalData @@ -391,12 +396,7 @@ export function makeSwapKitPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin { if (contractAddress == null) throw new Error('Invalid null contractAddress') - memo = await getCalldataData( - fromWallet.currencyInfo.pluginId, - contractAddress, - contractMethod, - calldataAny - ) + memo = transaction.data } ethNativeAmount = '0' @@ -528,73 +528,3 @@ export function makeSwapKitPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin { } return out } - -const calldataOrder = { - TC_ROUTER_GENERIC: [ - 'tcRouter', - 'tcVault', - 'tcMemo', - 'token', - 'amount', - 'router', - 'data', - 'deadline' - ], - TC_ROUTER_UNISWAP: [ - 'tcRouter', - 'tcVault', - 'tcMemo', - 'token', - 'amount', - 'amountOutMin', - 'deadline' - ], - TC_ROUTER_PANGOLIN: [ - 'tcRouter', - 'tcVault', - 'tcMemo', - 'token', - 'amount', - 'amountOutMin', - 'deadline' - ] -} - -export const getCalldataData = async ( - currencyPluginId: string, - contractAddress: string, - contractMethod: string, - calldata: JsonObject -): Promise => { - let abi, contractType - try { - const { type, data } = abiMap[currencyPluginId][ - contractAddress.toLowerCase() - ] - if (type === 'INVALID') { - throw new Error(`Unsupported contract`) - } - abi = data - contractType = type - } catch (e: any) { - throw new Error( - `Could not find ABI for contract ${currencyPluginId}-${contractAddress}` - ) - } - - const contractParams = calldataOrder[contractType].map(key => calldata[key]) - - // initialize contract - const contract = new ethers.Contract( - contractAddress, - abi, - ethers.providers.getDefaultProvider() - ) - - // call the deposit method on the contract - const tx = await contract.populateTransaction[contractMethod]( - ...contractParams - ) - if (tx.data == null) throw new Error('No data in tx object') - return tx.data -}