From a5a8198642d985a23c6224c9e76cf8247a10bdc0 Mon Sep 17 00:00:00 2001 From: Bharath Date: Mon, 16 Sep 2024 16:03:12 +0530 Subject: [PATCH] add univ3swaptx scenario --- .idea/workspace.xml | 47 +- contractinfos/customizableerc20/abi.json | 1 + contractinfos/swaprouter/abi.json | 1063 +++++++++++++++ scenarios/scenarios.go | 2 + .../contracts/customizable-erc20.go | 780 +++++++++++ .../univ3swaptx/contracts/swap-router.go | 1136 +++++++++++++++++ scenarios/univ3swaptx/contracts/weth.go | 1113 ++++++++++++++++ scenarios/univ3swaptx/univ3swaptx.go | 684 ++++++++++ 8 files changed, 4803 insertions(+), 23 deletions(-) create mode 100644 contractinfos/customizableerc20/abi.json create mode 100644 contractinfos/swaprouter/abi.json create mode 100644 scenarios/univ3swaptx/contracts/customizable-erc20.go create mode 100644 scenarios/univ3swaptx/contracts/swap-router.go create mode 100644 scenarios/univ3swaptx/contracts/weth.go create mode 100644 scenarios/univ3swaptx/univ3swaptx.go diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6d12471..2f05602 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,14 +5,12 @@ - + + + + - - - - - - { + "keyToString": { + "DefaultGoTemplateProperty": "Go File", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.go.formatter.settings.were.checked": "true", + "RunOnceActivity.go.migrated.go.modules.settings": "true", + "RunOnceActivity.go.modules.automatic.dependencies.download": "true", + "RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true", + "git-widget-placeholder": "bharath/add-univ3-swaps", + "go.import.settings.migrated": "true", + "go.sdk.automatically.set": "true", + "last_opened_file_path": "/Users/vedabharath/learn/spamooor/scenarios/univ3swaptx/contracts", + "node.js.detected.package.eslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "nodejs_package_manager_path": "npm" } -}]]> +} + + + diff --git a/contractinfos/customizableerc20/abi.json b/contractinfos/customizableerc20/abi.json new file mode 100644 index 0000000..a194c17 --- /dev/null +++ b/contractinfos/customizableerc20/abi.json @@ -0,0 +1 @@ +[{"type":"constructor","inputs":[{"name":"_name","type":"string","internalType":"string"},{"name":"_symbol","type":"string","internalType":"string"},{"name":"_decimals","type":"uint8","internalType":"uint8"},{"name":"_maxSupply","type":"uint256","internalType":"uint256"}],"stateMutability":"nonpayable"},{"type":"function","name":"allowance","inputs":[{"name":"owner","type":"address","internalType":"address"},{"name":"spender","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"approve","inputs":[{"name":"spender","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"function","name":"balanceOf","inputs":[{"name":"account","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint8","internalType":"uint8"}],"stateMutability":"view"},{"type":"function","name":"decreaseAllowance","inputs":[{"name":"spender","type":"address","internalType":"address"},{"name":"subtractedValue","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"function","name":"increaseAllowance","inputs":[{"name":"spender","type":"address","internalType":"address"},{"name":"addedValue","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"view"},{"type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"view"},{"type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"transfer","inputs":[{"name":"recipient","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"function","name":"transferFrom","inputs":[{"name":"sender","type":"address","internalType":"address"},{"name":"recipient","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"event","name":"Approval","inputs":[{"name":"owner","type":"address","indexed":true,"internalType":"address"},{"name":"spender","type":"address","indexed":true,"internalType":"address"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"name":"from","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false}] \ No newline at end of file diff --git a/contractinfos/swaprouter/abi.json b/contractinfos/swaprouter/abi.json new file mode 100644 index 0000000..afbc694 --- /dev/null +++ b/contractinfos/swaprouter/abi.json @@ -0,0 +1,1063 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_factoryV2", + "type": "address" + }, + { + "internalType": "address", + "name": "factoryV3", + "type": "address" + }, + { + "internalType": "address", + "name": "_positionManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_WETH9", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "WETH9", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "approveMax", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "approveMaxMinusOne", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "approveZeroThenMax", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "approveZeroThenMaxMinusOne", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "callPositionManager", + "outputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "paths", + "type": "bytes[]" + }, + { + "internalType": "uint128[]", + "name": "amounts", + "type": "uint128[]" + }, + { + "internalType": "uint24", + "name": "maximumTickDivergence", + "type": "uint24" + }, + { + "internalType": "uint32", + "name": "secondsAgo", + "type": "uint32" + } + ], + "name": "checkOracleSlippage", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "path", + "type": "bytes" + }, + { + "internalType": "uint24", + "name": "maximumTickDivergence", + "type": "uint24" + }, + { + "internalType": "uint32", + "name": "secondsAgo", + "type": "uint32" + } + ], + "name": "checkOracleSlippage", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "path", + "type": "bytes" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinimum", + "type": "uint256" + } + ], + "internalType": "struct IV3SwapRouter.ExactInputParams", + "name": "params", + "type": "tuple" + } + ], + "name": "exactInput", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinimum", + "type": "uint256" + }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + } + ], + "internalType": "struct IV3SwapRouter.ExactInputSingleParams", + "name": "params", + "type": "tuple" + } + ], + "name": "exactInputSingle", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "path", + "type": "bytes" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaximum", + "type": "uint256" + } + ], + "internalType": "struct IV3SwapRouter.ExactOutputParams", + "name": "params", + "type": "tuple" + } + ], + "name": "exactOutput", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaximum", + "type": "uint256" + }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + } + ], + "internalType": "struct IV3SwapRouter.ExactOutputSingleParams", + "name": "params", + "type": "tuple" + } + ], + "name": "exactOutputSingle", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "factoryV2", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "getApprovalType", + "outputs": [ + { + "internalType": "enum IApproveAndCall.ApprovalType", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token0", + "type": "address" + }, + { + "internalType": "address", + "name": "token1", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount0Min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Min", + "type": "uint256" + } + ], + "internalType": "struct IApproveAndCall.IncreaseLiquidityParams", + "name": "params", + "type": "tuple" + } + ], + "name": "increaseLiquidity", + "outputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token0", + "type": "address" + }, + { + "internalType": "address", + "name": "token1", + "type": "address" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "internalType": "uint256", + "name": "amount0Min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Min", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "internalType": "struct IApproveAndCall.MintParams", + "name": "params", + "type": "tuple" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "previousBlockhash", + "type": "bytes32" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "positionManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "pull", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "refundETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermitAllowed", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermitAllowedIfNecessary", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermitIfNecessary", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "swapExactTokensForTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "swapTokensForExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountMinimum", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountMinimum", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountMinimum", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeBips", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + } + ], + "name": "sweepTokenWithFee", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountMinimum", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeBips", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + } + ], + "name": "sweepTokenWithFee", + "outputs": [], + "stateMutability": "payable", + "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": "uint256", + "name": "amountMinimum", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "unwrapWETH9", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMinimum", + "type": "uint256" + } + ], + "name": "unwrapWETH9", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMinimum", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeBips", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + } + ], + "name": "unwrapWETH9WithFee", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMinimum", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeBips", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + } + ], + "name": "unwrapWETH9WithFee", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "wrapETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] \ No newline at end of file diff --git a/scenarios/scenarios.go b/scenarios/scenarios.go index c3c23ed..12ab39e 100644 --- a/scenarios/scenarios.go +++ b/scenarios/scenarios.go @@ -9,6 +9,7 @@ import ( "github.com/astriaorg/spamooor/scenarios/sequencersequenceactiontx" "github.com/astriaorg/spamooor/scenarios/sequencertransfertx" "github.com/astriaorg/spamooor/scenarios/univ2tx" + "github.com/astriaorg/spamooor/scenarios/univ3swaptx" "github.com/astriaorg/spamooor/scenariotypes" ) @@ -21,4 +22,5 @@ var Scenarios = map[string]func() scenariotypes.Scenario{ "deploytx": deploytx.NewScenario, "sequencertransfertx": sequencertransfertx.NewScenario, "sequencersequenceactiontx": sequencersequenceactiontx.NewScenario, + "univ3swaptx": univ3swaptx.NewScenario, } diff --git a/scenarios/univ3swaptx/contracts/customizable-erc20.go b/scenarios/univ3swaptx/contracts/customizable-erc20.go new file mode 100644 index 0000000..0563575 --- /dev/null +++ b/scenarios/univ3swaptx/contracts/customizable-erc20.go @@ -0,0 +1,780 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package univ3swaptx + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// CustomizableErc20MetaData contains all meta data concerning the CustomizableErc20 contract. +var CustomizableErc20MetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_decimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"_maxSupply\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"subtractedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"increaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"addedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", +} + +// CustomizableErc20ABI is the input ABI used to generate the binding from. +// Deprecated: Use CustomizableErc20MetaData.ABI instead. +var CustomizableErc20ABI = CustomizableErc20MetaData.ABI + +// CustomizableErc20 is an auto generated Go binding around an Ethereum contract. +type CustomizableErc20 struct { + CustomizableErc20Caller // Read-only binding to the contract + CustomizableErc20Transactor // Write-only binding to the contract + CustomizableErc20Filterer // Log filterer for contract events +} + +// CustomizableErc20Caller is an auto generated read-only Go binding around an Ethereum contract. +type CustomizableErc20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CustomizableErc20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type CustomizableErc20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CustomizableErc20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type CustomizableErc20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CustomizableErc20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type CustomizableErc20Session struct { + Contract *CustomizableErc20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CustomizableErc20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type CustomizableErc20CallerSession struct { + Contract *CustomizableErc20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// CustomizableErc20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type CustomizableErc20TransactorSession struct { + Contract *CustomizableErc20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CustomizableErc20Raw is an auto generated low-level Go binding around an Ethereum contract. +type CustomizableErc20Raw struct { + Contract *CustomizableErc20 // Generic contract binding to access the raw methods on +} + +// CustomizableErc20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type CustomizableErc20CallerRaw struct { + Contract *CustomizableErc20Caller // Generic read-only contract binding to access the raw methods on +} + +// CustomizableErc20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type CustomizableErc20TransactorRaw struct { + Contract *CustomizableErc20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewCustomizableErc20 creates a new instance of CustomizableErc20, bound to a specific deployed contract. +func NewCustomizableErc20(address common.Address, backend bind.ContractBackend) (*CustomizableErc20, error) { + contract, err := bindCustomizableErc20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CustomizableErc20{CustomizableErc20Caller: CustomizableErc20Caller{contract: contract}, CustomizableErc20Transactor: CustomizableErc20Transactor{contract: contract}, CustomizableErc20Filterer: CustomizableErc20Filterer{contract: contract}}, nil +} + +// NewCustomizableErc20Caller creates a new read-only instance of CustomizableErc20, bound to a specific deployed contract. +func NewCustomizableErc20Caller(address common.Address, caller bind.ContractCaller) (*CustomizableErc20Caller, error) { + contract, err := bindCustomizableErc20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CustomizableErc20Caller{contract: contract}, nil +} + +// NewCustomizableErc20Transactor creates a new write-only instance of CustomizableErc20, bound to a specific deployed contract. +func NewCustomizableErc20Transactor(address common.Address, transactor bind.ContractTransactor) (*CustomizableErc20Transactor, error) { + contract, err := bindCustomizableErc20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CustomizableErc20Transactor{contract: contract}, nil +} + +// NewCustomizableErc20Filterer creates a new log filterer instance of CustomizableErc20, bound to a specific deployed contract. +func NewCustomizableErc20Filterer(address common.Address, filterer bind.ContractFilterer) (*CustomizableErc20Filterer, error) { + contract, err := bindCustomizableErc20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CustomizableErc20Filterer{contract: contract}, nil +} + +// bindCustomizableErc20 binds a generic wrapper to an already deployed contract. +func bindCustomizableErc20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CustomizableErc20MetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_CustomizableErc20 *CustomizableErc20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CustomizableErc20.Contract.CustomizableErc20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_CustomizableErc20 *CustomizableErc20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CustomizableErc20.Contract.CustomizableErc20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_CustomizableErc20 *CustomizableErc20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CustomizableErc20.Contract.CustomizableErc20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_CustomizableErc20 *CustomizableErc20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CustomizableErc20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_CustomizableErc20 *CustomizableErc20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CustomizableErc20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_CustomizableErc20 *CustomizableErc20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CustomizableErc20.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _CustomizableErc20.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _CustomizableErc20.Contract.Allowance(&_CustomizableErc20.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _CustomizableErc20.Contract.Allowance(&_CustomizableErc20.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _CustomizableErc20.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20Session) BalanceOf(account common.Address) (*big.Int, error) { + return _CustomizableErc20.Contract.BalanceOf(&_CustomizableErc20.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _CustomizableErc20.Contract.BalanceOf(&_CustomizableErc20.CallOpts, account) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_CustomizableErc20 *CustomizableErc20Caller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _CustomizableErc20.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_CustomizableErc20 *CustomizableErc20Session) Decimals() (uint8, error) { + return _CustomizableErc20.Contract.Decimals(&_CustomizableErc20.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_CustomizableErc20 *CustomizableErc20CallerSession) Decimals() (uint8, error) { + return _CustomizableErc20.Contract.Decimals(&_CustomizableErc20.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_CustomizableErc20 *CustomizableErc20Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CustomizableErc20.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_CustomizableErc20 *CustomizableErc20Session) Name() (string, error) { + return _CustomizableErc20.Contract.Name(&_CustomizableErc20.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_CustomizableErc20 *CustomizableErc20CallerSession) Name() (string, error) { + return _CustomizableErc20.Contract.Name(&_CustomizableErc20.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_CustomizableErc20 *CustomizableErc20Caller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _CustomizableErc20.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_CustomizableErc20 *CustomizableErc20Session) Symbol() (string, error) { + return _CustomizableErc20.Contract.Symbol(&_CustomizableErc20.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_CustomizableErc20 *CustomizableErc20CallerSession) Symbol() (string, error) { + return _CustomizableErc20.Contract.Symbol(&_CustomizableErc20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CustomizableErc20.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20Session) TotalSupply() (*big.Int, error) { + return _CustomizableErc20.Contract.TotalSupply(&_CustomizableErc20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_CustomizableErc20 *CustomizableErc20CallerSession) TotalSupply() (*big.Int, error) { + return _CustomizableErc20.Contract.TotalSupply(&_CustomizableErc20.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.Approve(&_CustomizableErc20.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.Approve(&_CustomizableErc20.TransactOpts, spender, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.DecreaseAllowance(&_CustomizableErc20.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_CustomizableErc20 *CustomizableErc20TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.DecreaseAllowance(&_CustomizableErc20.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.IncreaseAllowance(&_CustomizableErc20.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_CustomizableErc20 *CustomizableErc20TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.IncreaseAllowance(&_CustomizableErc20.TransactOpts, spender, addedValue) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.contract.Transact(opts, "transfer", recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.Transfer(&_CustomizableErc20.TransactOpts, recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.Transfer(&_CustomizableErc20.TransactOpts, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.contract.Transact(opts, "transferFrom", sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.TransferFrom(&_CustomizableErc20.TransactOpts, sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_CustomizableErc20 *CustomizableErc20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _CustomizableErc20.Contract.TransferFrom(&_CustomizableErc20.TransactOpts, sender, recipient, amount) +} + +// CustomizableErc20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the CustomizableErc20 contract. +type CustomizableErc20ApprovalIterator struct { + Event *CustomizableErc20Approval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *CustomizableErc20ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CustomizableErc20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CustomizableErc20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CustomizableErc20ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CustomizableErc20ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CustomizableErc20Approval represents a Approval event raised by the CustomizableErc20 contract. +type CustomizableErc20Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_CustomizableErc20 *CustomizableErc20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*CustomizableErc20ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _CustomizableErc20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &CustomizableErc20ApprovalIterator{contract: _CustomizableErc20.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_CustomizableErc20 *CustomizableErc20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *CustomizableErc20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _CustomizableErc20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CustomizableErc20Approval) + if err := _CustomizableErc20.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_CustomizableErc20 *CustomizableErc20Filterer) ParseApproval(log types.Log) (*CustomizableErc20Approval, error) { + event := new(CustomizableErc20Approval) + if err := _CustomizableErc20.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CustomizableErc20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the CustomizableErc20 contract. +type CustomizableErc20TransferIterator struct { + Event *CustomizableErc20Transfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *CustomizableErc20TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CustomizableErc20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CustomizableErc20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CustomizableErc20TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CustomizableErc20TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CustomizableErc20Transfer represents a Transfer event raised by the CustomizableErc20 contract. +type CustomizableErc20Transfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_CustomizableErc20 *CustomizableErc20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*CustomizableErc20TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CustomizableErc20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &CustomizableErc20TransferIterator{contract: _CustomizableErc20.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_CustomizableErc20 *CustomizableErc20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *CustomizableErc20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _CustomizableErc20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CustomizableErc20Transfer) + if err := _CustomizableErc20.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_CustomizableErc20 *CustomizableErc20Filterer) ParseTransfer(log types.Log) (*CustomizableErc20Transfer, error) { + event := new(CustomizableErc20Transfer) + if err := _CustomizableErc20.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/scenarios/univ3swaptx/contracts/swap-router.go b/scenarios/univ3swaptx/contracts/swap-router.go new file mode 100644 index 0000000..33e5b4f --- /dev/null +++ b/scenarios/univ3swaptx/contracts/swap-router.go @@ -0,0 +1,1136 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package univ3swaptx + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IApproveAndCallIncreaseLiquidityParams is an auto generated low-level Go binding around an user-defined struct. +type IApproveAndCallIncreaseLiquidityParams struct { + Token0 common.Address + Token1 common.Address + TokenId *big.Int + Amount0Min *big.Int + Amount1Min *big.Int +} + +// IApproveAndCallMintParams is an auto generated low-level Go binding around an user-defined struct. +type IApproveAndCallMintParams struct { + Token0 common.Address + Token1 common.Address + Fee *big.Int + TickLower *big.Int + TickUpper *big.Int + Amount0Min *big.Int + Amount1Min *big.Int + Recipient common.Address +} + +// IV3SwapRouterExactInputParams is an auto generated low-level Go binding around an user-defined struct. +type IV3SwapRouterExactInputParams struct { + Path []byte + Recipient common.Address + AmountIn *big.Int + AmountOutMinimum *big.Int +} + +// IV3SwapRouterExactInputSingleParams is an auto generated low-level Go binding around an user-defined struct. +type IV3SwapRouterExactInputSingleParams struct { + TokenIn common.Address + TokenOut common.Address + Fee *big.Int + Recipient common.Address + AmountIn *big.Int + AmountOutMinimum *big.Int + SqrtPriceLimitX96 *big.Int +} + +// IV3SwapRouterExactOutputParams is an auto generated low-level Go binding around an user-defined struct. +type IV3SwapRouterExactOutputParams struct { + Path []byte + Recipient common.Address + AmountOut *big.Int + AmountInMaximum *big.Int +} + +// IV3SwapRouterExactOutputSingleParams is an auto generated low-level Go binding around an user-defined struct. +type IV3SwapRouterExactOutputSingleParams struct { + TokenIn common.Address + TokenOut common.Address + Fee *big.Int + Recipient common.Address + AmountOut *big.Int + AmountInMaximum *big.Int + SqrtPriceLimitX96 *big.Int +} + +// SwapRouterMetaData contains all meta data concerning the SwapRouter contract. +var SwapRouterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factoryV2\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"factoryV3\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_positionManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH9\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"WETH9\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveMax\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveMaxMinusOne\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveZeroThenMax\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"approveZeroThenMaxMinusOne\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"callPositionManager\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"paths\",\"type\":\"bytes[]\"},{\"internalType\":\"uint128[]\",\"name\":\"amounts\",\"type\":\"uint128[]\"},{\"internalType\":\"uint24\",\"name\":\"maximumTickDivergence\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"secondsAgo\",\"type\":\"uint32\"}],\"name\":\"checkOracleSlippage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"uint24\",\"name\":\"maximumTickDivergence\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"secondsAgo\",\"type\":\"uint32\"}],\"name\":\"checkOracleSlippage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"}],\"internalType\":\"structIV3SwapRouter.ExactInputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIV3SwapRouter.ExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"path\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaximum\",\"type\":\"uint256\"}],\"internalType\":\"structIV3SwapRouter.ExactOutputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactOutput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaximum\",\"type\":\"uint256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"}],\"internalType\":\"structIV3SwapRouter.ExactOutputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactOutputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factoryV2\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getApprovalType\",\"outputs\":[{\"internalType\":\"enumIApproveAndCall.ApprovalType\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"}],\"internalType\":\"structIApproveAndCall.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"internalType\":\"structIApproveAndCall.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"previousBlockhash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"positionManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"pull\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"swapExactTokensForTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"swapTokensForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"sweepTokenWithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"sweepTokenWithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"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\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"}],\"name\":\"unwrapWETH9\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9WithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBips\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH9WithFee\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"wrapETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", +} + +// SwapRouterABI is the input ABI used to generate the binding from. +// Deprecated: Use SwapRouterMetaData.ABI instead. +var SwapRouterABI = SwapRouterMetaData.ABI + +// SwapRouter is an auto generated Go binding around an Ethereum contract. +type SwapRouter struct { + SwapRouterCaller // Read-only binding to the contract + SwapRouterTransactor // Write-only binding to the contract + SwapRouterFilterer // Log filterer for contract events +} + +// SwapRouterCaller is an auto generated read-only Go binding around an Ethereum contract. +type SwapRouterCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SwapRouterTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SwapRouterTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SwapRouterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SwapRouterFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SwapRouterSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SwapRouterSession struct { + Contract *SwapRouter // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SwapRouterCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SwapRouterCallerSession struct { + Contract *SwapRouterCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SwapRouterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SwapRouterTransactorSession struct { + Contract *SwapRouterTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SwapRouterRaw is an auto generated low-level Go binding around an Ethereum contract. +type SwapRouterRaw struct { + Contract *SwapRouter // Generic contract binding to access the raw methods on +} + +// SwapRouterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SwapRouterCallerRaw struct { + Contract *SwapRouterCaller // Generic read-only contract binding to access the raw methods on +} + +// SwapRouterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SwapRouterTransactorRaw struct { + Contract *SwapRouterTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSwapRouter creates a new instance of SwapRouter, bound to a specific deployed contract. +func NewSwapRouter(address common.Address, backend bind.ContractBackend) (*SwapRouter, error) { + contract, err := bindSwapRouter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SwapRouter{SwapRouterCaller: SwapRouterCaller{contract: contract}, SwapRouterTransactor: SwapRouterTransactor{contract: contract}, SwapRouterFilterer: SwapRouterFilterer{contract: contract}}, nil +} + +// NewSwapRouterCaller creates a new read-only instance of SwapRouter, bound to a specific deployed contract. +func NewSwapRouterCaller(address common.Address, caller bind.ContractCaller) (*SwapRouterCaller, error) { + contract, err := bindSwapRouter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SwapRouterCaller{contract: contract}, nil +} + +// NewSwapRouterTransactor creates a new write-only instance of SwapRouter, bound to a specific deployed contract. +func NewSwapRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*SwapRouterTransactor, error) { + contract, err := bindSwapRouter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SwapRouterTransactor{contract: contract}, nil +} + +// NewSwapRouterFilterer creates a new log filterer instance of SwapRouter, bound to a specific deployed contract. +func NewSwapRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*SwapRouterFilterer, error) { + contract, err := bindSwapRouter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SwapRouterFilterer{contract: contract}, nil +} + +// bindSwapRouter binds a generic wrapper to an already deployed contract. +func bindSwapRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := SwapRouterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SwapRouter *SwapRouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SwapRouter.Contract.SwapRouterCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SwapRouter *SwapRouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SwapRouter.Contract.SwapRouterTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SwapRouter *SwapRouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SwapRouter.Contract.SwapRouterTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SwapRouter *SwapRouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SwapRouter.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SwapRouter *SwapRouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SwapRouter.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SwapRouter *SwapRouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SwapRouter.Contract.contract.Transact(opts, method, params...) +} + +// WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. +// +// Solidity: function WETH9() view returns(address) +func (_SwapRouter *SwapRouterCaller) WETH9(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SwapRouter.contract.Call(opts, &out, "WETH9") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. +// +// Solidity: function WETH9() view returns(address) +func (_SwapRouter *SwapRouterSession) WETH9() (common.Address, error) { + return _SwapRouter.Contract.WETH9(&_SwapRouter.CallOpts) +} + +// WETH9 is a free data retrieval call binding the contract method 0x4aa4a4fc. +// +// Solidity: function WETH9() view returns(address) +func (_SwapRouter *SwapRouterCallerSession) WETH9() (common.Address, error) { + return _SwapRouter.Contract.WETH9(&_SwapRouter.CallOpts) +} + +// CheckOracleSlippage is a free data retrieval call binding the contract method 0xefdeed8e. +// +// Solidity: function checkOracleSlippage(bytes[] paths, uint128[] amounts, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() +func (_SwapRouter *SwapRouterCaller) CheckOracleSlippage(opts *bind.CallOpts, paths [][]byte, amounts []*big.Int, maximumTickDivergence *big.Int, secondsAgo uint32) error { + var out []interface{} + err := _SwapRouter.contract.Call(opts, &out, "checkOracleSlippage", paths, amounts, maximumTickDivergence, secondsAgo) + + if err != nil { + return err + } + + return err + +} + +// CheckOracleSlippage is a free data retrieval call binding the contract method 0xefdeed8e. +// +// Solidity: function checkOracleSlippage(bytes[] paths, uint128[] amounts, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() +func (_SwapRouter *SwapRouterSession) CheckOracleSlippage(paths [][]byte, amounts []*big.Int, maximumTickDivergence *big.Int, secondsAgo uint32) error { + return _SwapRouter.Contract.CheckOracleSlippage(&_SwapRouter.CallOpts, paths, amounts, maximumTickDivergence, secondsAgo) +} + +// CheckOracleSlippage is a free data retrieval call binding the contract method 0xefdeed8e. +// +// Solidity: function checkOracleSlippage(bytes[] paths, uint128[] amounts, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() +func (_SwapRouter *SwapRouterCallerSession) CheckOracleSlippage(paths [][]byte, amounts []*big.Int, maximumTickDivergence *big.Int, secondsAgo uint32) error { + return _SwapRouter.Contract.CheckOracleSlippage(&_SwapRouter.CallOpts, paths, amounts, maximumTickDivergence, secondsAgo) +} + +// CheckOracleSlippage0 is a free data retrieval call binding the contract method 0xf25801a7. +// +// Solidity: function checkOracleSlippage(bytes path, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() +func (_SwapRouter *SwapRouterCaller) CheckOracleSlippage0(opts *bind.CallOpts, path []byte, maximumTickDivergence *big.Int, secondsAgo uint32) error { + var out []interface{} + err := _SwapRouter.contract.Call(opts, &out, "checkOracleSlippage0", path, maximumTickDivergence, secondsAgo) + + if err != nil { + return err + } + + return err + +} + +// CheckOracleSlippage0 is a free data retrieval call binding the contract method 0xf25801a7. +// +// Solidity: function checkOracleSlippage(bytes path, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() +func (_SwapRouter *SwapRouterSession) CheckOracleSlippage0(path []byte, maximumTickDivergence *big.Int, secondsAgo uint32) error { + return _SwapRouter.Contract.CheckOracleSlippage0(&_SwapRouter.CallOpts, path, maximumTickDivergence, secondsAgo) +} + +// CheckOracleSlippage0 is a free data retrieval call binding the contract method 0xf25801a7. +// +// Solidity: function checkOracleSlippage(bytes path, uint24 maximumTickDivergence, uint32 secondsAgo) view returns() +func (_SwapRouter *SwapRouterCallerSession) CheckOracleSlippage0(path []byte, maximumTickDivergence *big.Int, secondsAgo uint32) error { + return _SwapRouter.Contract.CheckOracleSlippage0(&_SwapRouter.CallOpts, path, maximumTickDivergence, secondsAgo) +} + +// Factory is a free data retrieval call binding the contract method 0xc45a0155. +// +// Solidity: function factory() view returns(address) +func (_SwapRouter *SwapRouterCaller) Factory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SwapRouter.contract.Call(opts, &out, "factory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Factory is a free data retrieval call binding the contract method 0xc45a0155. +// +// Solidity: function factory() view returns(address) +func (_SwapRouter *SwapRouterSession) Factory() (common.Address, error) { + return _SwapRouter.Contract.Factory(&_SwapRouter.CallOpts) +} + +// Factory is a free data retrieval call binding the contract method 0xc45a0155. +// +// Solidity: function factory() view returns(address) +func (_SwapRouter *SwapRouterCallerSession) Factory() (common.Address, error) { + return _SwapRouter.Contract.Factory(&_SwapRouter.CallOpts) +} + +// FactoryV2 is a free data retrieval call binding the contract method 0x68e0d4e1. +// +// Solidity: function factoryV2() view returns(address) +func (_SwapRouter *SwapRouterCaller) FactoryV2(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SwapRouter.contract.Call(opts, &out, "factoryV2") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// FactoryV2 is a free data retrieval call binding the contract method 0x68e0d4e1. +// +// Solidity: function factoryV2() view returns(address) +func (_SwapRouter *SwapRouterSession) FactoryV2() (common.Address, error) { + return _SwapRouter.Contract.FactoryV2(&_SwapRouter.CallOpts) +} + +// FactoryV2 is a free data retrieval call binding the contract method 0x68e0d4e1. +// +// Solidity: function factoryV2() view returns(address) +func (_SwapRouter *SwapRouterCallerSession) FactoryV2() (common.Address, error) { + return _SwapRouter.Contract.FactoryV2(&_SwapRouter.CallOpts) +} + +// PositionManager is a free data retrieval call binding the contract method 0x791b98bc. +// +// Solidity: function positionManager() view returns(address) +func (_SwapRouter *SwapRouterCaller) PositionManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SwapRouter.contract.Call(opts, &out, "positionManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PositionManager is a free data retrieval call binding the contract method 0x791b98bc. +// +// Solidity: function positionManager() view returns(address) +func (_SwapRouter *SwapRouterSession) PositionManager() (common.Address, error) { + return _SwapRouter.Contract.PositionManager(&_SwapRouter.CallOpts) +} + +// PositionManager is a free data retrieval call binding the contract method 0x791b98bc. +// +// Solidity: function positionManager() view returns(address) +func (_SwapRouter *SwapRouterCallerSession) PositionManager() (common.Address, error) { + return _SwapRouter.Contract.PositionManager(&_SwapRouter.CallOpts) +} + +// ApproveMax is a paid mutator transaction binding the contract method 0x571ac8b0. +// +// Solidity: function approveMax(address token) payable returns() +func (_SwapRouter *SwapRouterTransactor) ApproveMax(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "approveMax", token) +} + +// ApproveMax is a paid mutator transaction binding the contract method 0x571ac8b0. +// +// Solidity: function approveMax(address token) payable returns() +func (_SwapRouter *SwapRouterSession) ApproveMax(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveMax(&_SwapRouter.TransactOpts, token) +} + +// ApproveMax is a paid mutator transaction binding the contract method 0x571ac8b0. +// +// Solidity: function approveMax(address token) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) ApproveMax(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveMax(&_SwapRouter.TransactOpts, token) +} + +// ApproveMaxMinusOne is a paid mutator transaction binding the contract method 0xcab372ce. +// +// Solidity: function approveMaxMinusOne(address token) payable returns() +func (_SwapRouter *SwapRouterTransactor) ApproveMaxMinusOne(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "approveMaxMinusOne", token) +} + +// ApproveMaxMinusOne is a paid mutator transaction binding the contract method 0xcab372ce. +// +// Solidity: function approveMaxMinusOne(address token) payable returns() +func (_SwapRouter *SwapRouterSession) ApproveMaxMinusOne(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveMaxMinusOne(&_SwapRouter.TransactOpts, token) +} + +// ApproveMaxMinusOne is a paid mutator transaction binding the contract method 0xcab372ce. +// +// Solidity: function approveMaxMinusOne(address token) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) ApproveMaxMinusOne(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveMaxMinusOne(&_SwapRouter.TransactOpts, token) +} + +// ApproveZeroThenMax is a paid mutator transaction binding the contract method 0x639d71a9. +// +// Solidity: function approveZeroThenMax(address token) payable returns() +func (_SwapRouter *SwapRouterTransactor) ApproveZeroThenMax(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "approveZeroThenMax", token) +} + +// ApproveZeroThenMax is a paid mutator transaction binding the contract method 0x639d71a9. +// +// Solidity: function approveZeroThenMax(address token) payable returns() +func (_SwapRouter *SwapRouterSession) ApproveZeroThenMax(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveZeroThenMax(&_SwapRouter.TransactOpts, token) +} + +// ApproveZeroThenMax is a paid mutator transaction binding the contract method 0x639d71a9. +// +// Solidity: function approveZeroThenMax(address token) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) ApproveZeroThenMax(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveZeroThenMax(&_SwapRouter.TransactOpts, token) +} + +// ApproveZeroThenMaxMinusOne is a paid mutator transaction binding the contract method 0xab3fdd50. +// +// Solidity: function approveZeroThenMaxMinusOne(address token) payable returns() +func (_SwapRouter *SwapRouterTransactor) ApproveZeroThenMaxMinusOne(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "approveZeroThenMaxMinusOne", token) +} + +// ApproveZeroThenMaxMinusOne is a paid mutator transaction binding the contract method 0xab3fdd50. +// +// Solidity: function approveZeroThenMaxMinusOne(address token) payable returns() +func (_SwapRouter *SwapRouterSession) ApproveZeroThenMaxMinusOne(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveZeroThenMaxMinusOne(&_SwapRouter.TransactOpts, token) +} + +// ApproveZeroThenMaxMinusOne is a paid mutator transaction binding the contract method 0xab3fdd50. +// +// Solidity: function approveZeroThenMaxMinusOne(address token) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) ApproveZeroThenMaxMinusOne(token common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.ApproveZeroThenMaxMinusOne(&_SwapRouter.TransactOpts, token) +} + +// CallPositionManager is a paid mutator transaction binding the contract method 0xb3a2af13. +// +// Solidity: function callPositionManager(bytes data) payable returns(bytes result) +func (_SwapRouter *SwapRouterTransactor) CallPositionManager(opts *bind.TransactOpts, data []byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "callPositionManager", data) +} + +// CallPositionManager is a paid mutator transaction binding the contract method 0xb3a2af13. +// +// Solidity: function callPositionManager(bytes data) payable returns(bytes result) +func (_SwapRouter *SwapRouterSession) CallPositionManager(data []byte) (*types.Transaction, error) { + return _SwapRouter.Contract.CallPositionManager(&_SwapRouter.TransactOpts, data) +} + +// CallPositionManager is a paid mutator transaction binding the contract method 0xb3a2af13. +// +// Solidity: function callPositionManager(bytes data) payable returns(bytes result) +func (_SwapRouter *SwapRouterTransactorSession) CallPositionManager(data []byte) (*types.Transaction, error) { + return _SwapRouter.Contract.CallPositionManager(&_SwapRouter.TransactOpts, data) +} + +// ExactInput is a paid mutator transaction binding the contract method 0xb858183f. +// +// Solidity: function exactInput((bytes,address,uint256,uint256) params) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterTransactor) ExactInput(opts *bind.TransactOpts, params IV3SwapRouterExactInputParams) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "exactInput", params) +} + +// ExactInput is a paid mutator transaction binding the contract method 0xb858183f. +// +// Solidity: function exactInput((bytes,address,uint256,uint256) params) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterSession) ExactInput(params IV3SwapRouterExactInputParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactInput(&_SwapRouter.TransactOpts, params) +} + +// ExactInput is a paid mutator transaction binding the contract method 0xb858183f. +// +// Solidity: function exactInput((bytes,address,uint256,uint256) params) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterTransactorSession) ExactInput(params IV3SwapRouterExactInputParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactInput(&_SwapRouter.TransactOpts, params) +} + +// ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. +// +// Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterTransactor) ExactInputSingle(opts *bind.TransactOpts, params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "exactInputSingle", params) +} + +// ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. +// +// Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterSession) ExactInputSingle(params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactInputSingle(&_SwapRouter.TransactOpts, params) +} + +// ExactInputSingle is a paid mutator transaction binding the contract method 0x04e45aaf. +// +// Solidity: function exactInputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterTransactorSession) ExactInputSingle(params IV3SwapRouterExactInputSingleParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactInputSingle(&_SwapRouter.TransactOpts, params) +} + +// ExactOutput is a paid mutator transaction binding the contract method 0x09b81346. +// +// Solidity: function exactOutput((bytes,address,uint256,uint256) params) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterTransactor) ExactOutput(opts *bind.TransactOpts, params IV3SwapRouterExactOutputParams) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "exactOutput", params) +} + +// ExactOutput is a paid mutator transaction binding the contract method 0x09b81346. +// +// Solidity: function exactOutput((bytes,address,uint256,uint256) params) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterSession) ExactOutput(params IV3SwapRouterExactOutputParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactOutput(&_SwapRouter.TransactOpts, params) +} + +// ExactOutput is a paid mutator transaction binding the contract method 0x09b81346. +// +// Solidity: function exactOutput((bytes,address,uint256,uint256) params) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterTransactorSession) ExactOutput(params IV3SwapRouterExactOutputParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactOutput(&_SwapRouter.TransactOpts, params) +} + +// ExactOutputSingle is a paid mutator transaction binding the contract method 0x5023b4df. +// +// Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterTransactor) ExactOutputSingle(opts *bind.TransactOpts, params IV3SwapRouterExactOutputSingleParams) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "exactOutputSingle", params) +} + +// ExactOutputSingle is a paid mutator transaction binding the contract method 0x5023b4df. +// +// Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterSession) ExactOutputSingle(params IV3SwapRouterExactOutputSingleParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactOutputSingle(&_SwapRouter.TransactOpts, params) +} + +// ExactOutputSingle is a paid mutator transaction binding the contract method 0x5023b4df. +// +// Solidity: function exactOutputSingle((address,address,uint24,address,uint256,uint256,uint160) params) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterTransactorSession) ExactOutputSingle(params IV3SwapRouterExactOutputSingleParams) (*types.Transaction, error) { + return _SwapRouter.Contract.ExactOutputSingle(&_SwapRouter.TransactOpts, params) +} + +// GetApprovalType is a paid mutator transaction binding the contract method 0xdee00f35. +// +// Solidity: function getApprovalType(address token, uint256 amount) returns(uint8) +func (_SwapRouter *SwapRouterTransactor) GetApprovalType(opts *bind.TransactOpts, token common.Address, amount *big.Int) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "getApprovalType", token, amount) +} + +// GetApprovalType is a paid mutator transaction binding the contract method 0xdee00f35. +// +// Solidity: function getApprovalType(address token, uint256 amount) returns(uint8) +func (_SwapRouter *SwapRouterSession) GetApprovalType(token common.Address, amount *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.GetApprovalType(&_SwapRouter.TransactOpts, token, amount) +} + +// GetApprovalType is a paid mutator transaction binding the contract method 0xdee00f35. +// +// Solidity: function getApprovalType(address token, uint256 amount) returns(uint8) +func (_SwapRouter *SwapRouterTransactorSession) GetApprovalType(token common.Address, amount *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.GetApprovalType(&_SwapRouter.TransactOpts, token, amount) +} + +// IncreaseLiquidity is a paid mutator transaction binding the contract method 0xf100b205. +// +// Solidity: function increaseLiquidity((address,address,uint256,uint256,uint256) params) payable returns(bytes result) +func (_SwapRouter *SwapRouterTransactor) IncreaseLiquidity(opts *bind.TransactOpts, params IApproveAndCallIncreaseLiquidityParams) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "increaseLiquidity", params) +} + +// IncreaseLiquidity is a paid mutator transaction binding the contract method 0xf100b205. +// +// Solidity: function increaseLiquidity((address,address,uint256,uint256,uint256) params) payable returns(bytes result) +func (_SwapRouter *SwapRouterSession) IncreaseLiquidity(params IApproveAndCallIncreaseLiquidityParams) (*types.Transaction, error) { + return _SwapRouter.Contract.IncreaseLiquidity(&_SwapRouter.TransactOpts, params) +} + +// IncreaseLiquidity is a paid mutator transaction binding the contract method 0xf100b205. +// +// Solidity: function increaseLiquidity((address,address,uint256,uint256,uint256) params) payable returns(bytes result) +func (_SwapRouter *SwapRouterTransactorSession) IncreaseLiquidity(params IApproveAndCallIncreaseLiquidityParams) (*types.Transaction, error) { + return _SwapRouter.Contract.IncreaseLiquidity(&_SwapRouter.TransactOpts, params) +} + +// Mint is a paid mutator transaction binding the contract method 0x11ed56c9. +// +// Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,address) params) payable returns(bytes result) +func (_SwapRouter *SwapRouterTransactor) Mint(opts *bind.TransactOpts, params IApproveAndCallMintParams) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "mint", params) +} + +// Mint is a paid mutator transaction binding the contract method 0x11ed56c9. +// +// Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,address) params) payable returns(bytes result) +func (_SwapRouter *SwapRouterSession) Mint(params IApproveAndCallMintParams) (*types.Transaction, error) { + return _SwapRouter.Contract.Mint(&_SwapRouter.TransactOpts, params) +} + +// Mint is a paid mutator transaction binding the contract method 0x11ed56c9. +// +// Solidity: function mint((address,address,uint24,int24,int24,uint256,uint256,address) params) payable returns(bytes result) +func (_SwapRouter *SwapRouterTransactorSession) Mint(params IApproveAndCallMintParams) (*types.Transaction, error) { + return _SwapRouter.Contract.Mint(&_SwapRouter.TransactOpts, params) +} + +// Multicall is a paid mutator transaction binding the contract method 0x1f0464d1. +// +// Solidity: function multicall(bytes32 previousBlockhash, bytes[] data) payable returns(bytes[]) +func (_SwapRouter *SwapRouterTransactor) Multicall(opts *bind.TransactOpts, previousBlockhash [32]byte, data [][]byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "multicall", previousBlockhash, data) +} + +// Multicall is a paid mutator transaction binding the contract method 0x1f0464d1. +// +// Solidity: function multicall(bytes32 previousBlockhash, bytes[] data) payable returns(bytes[]) +func (_SwapRouter *SwapRouterSession) Multicall(previousBlockhash [32]byte, data [][]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.Multicall(&_SwapRouter.TransactOpts, previousBlockhash, data) +} + +// Multicall is a paid mutator transaction binding the contract method 0x1f0464d1. +// +// Solidity: function multicall(bytes32 previousBlockhash, bytes[] data) payable returns(bytes[]) +func (_SwapRouter *SwapRouterTransactorSession) Multicall(previousBlockhash [32]byte, data [][]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.Multicall(&_SwapRouter.TransactOpts, previousBlockhash, data) +} + +// Multicall0 is a paid mutator transaction binding the contract method 0x5ae401dc. +// +// Solidity: function multicall(uint256 deadline, bytes[] data) payable returns(bytes[]) +func (_SwapRouter *SwapRouterTransactor) Multicall0(opts *bind.TransactOpts, deadline *big.Int, data [][]byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "multicall0", deadline, data) +} + +// Multicall0 is a paid mutator transaction binding the contract method 0x5ae401dc. +// +// Solidity: function multicall(uint256 deadline, bytes[] data) payable returns(bytes[]) +func (_SwapRouter *SwapRouterSession) Multicall0(deadline *big.Int, data [][]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.Multicall0(&_SwapRouter.TransactOpts, deadline, data) +} + +// Multicall0 is a paid mutator transaction binding the contract method 0x5ae401dc. +// +// Solidity: function multicall(uint256 deadline, bytes[] data) payable returns(bytes[]) +func (_SwapRouter *SwapRouterTransactorSession) Multicall0(deadline *big.Int, data [][]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.Multicall0(&_SwapRouter.TransactOpts, deadline, data) +} + +// Multicall1 is a paid mutator transaction binding the contract method 0xac9650d8. +// +// Solidity: function multicall(bytes[] data) payable returns(bytes[] results) +func (_SwapRouter *SwapRouterTransactor) Multicall1(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "multicall1", data) +} + +// Multicall1 is a paid mutator transaction binding the contract method 0xac9650d8. +// +// Solidity: function multicall(bytes[] data) payable returns(bytes[] results) +func (_SwapRouter *SwapRouterSession) Multicall1(data [][]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.Multicall1(&_SwapRouter.TransactOpts, data) +} + +// Multicall1 is a paid mutator transaction binding the contract method 0xac9650d8. +// +// Solidity: function multicall(bytes[] data) payable returns(bytes[] results) +func (_SwapRouter *SwapRouterTransactorSession) Multicall1(data [][]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.Multicall1(&_SwapRouter.TransactOpts, data) +} + +// Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. +// +// Solidity: function pull(address token, uint256 value) payable returns() +func (_SwapRouter *SwapRouterTransactor) Pull(opts *bind.TransactOpts, token common.Address, value *big.Int) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "pull", token, value) +} + +// Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. +// +// Solidity: function pull(address token, uint256 value) payable returns() +func (_SwapRouter *SwapRouterSession) Pull(token common.Address, value *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.Pull(&_SwapRouter.TransactOpts, token, value) +} + +// Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. +// +// Solidity: function pull(address token, uint256 value) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) Pull(token common.Address, value *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.Pull(&_SwapRouter.TransactOpts, token, value) +} + +// RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. +// +// Solidity: function refundETH() payable returns() +func (_SwapRouter *SwapRouterTransactor) RefundETH(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "refundETH") +} + +// RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. +// +// Solidity: function refundETH() payable returns() +func (_SwapRouter *SwapRouterSession) RefundETH() (*types.Transaction, error) { + return _SwapRouter.Contract.RefundETH(&_SwapRouter.TransactOpts) +} + +// RefundETH is a paid mutator transaction binding the contract method 0x12210e8a. +// +// Solidity: function refundETH() payable returns() +func (_SwapRouter *SwapRouterTransactorSession) RefundETH() (*types.Transaction, error) { + return _SwapRouter.Contract.RefundETH(&_SwapRouter.TransactOpts) +} + +// SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. +// +// Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactor) SelfPermit(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "selfPermit", token, value, deadline, v, r, s) +} + +// SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. +// +// Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermit(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) +} + +// SelfPermit is a paid mutator transaction binding the contract method 0xf3995c67. +// +// Solidity: function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SelfPermit(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermit(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) +} + +// SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. +// +// Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactor) SelfPermitAllowed(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "selfPermitAllowed", token, nonce, expiry, v, r, s) +} + +// SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. +// +// Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermitAllowed(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) +} + +// SelfPermitAllowed is a paid mutator transaction binding the contract method 0x4659a494. +// +// Solidity: function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SelfPermitAllowed(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermitAllowed(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) +} + +// SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. +// +// Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactor) SelfPermitAllowedIfNecessary(opts *bind.TransactOpts, token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "selfPermitAllowedIfNecessary", token, nonce, expiry, v, r, s) +} + +// SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. +// +// Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermitAllowedIfNecessary(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) +} + +// SelfPermitAllowedIfNecessary is a paid mutator transaction binding the contract method 0xa4a78f0c. +// +// Solidity: function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SelfPermitAllowedIfNecessary(token common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermitAllowedIfNecessary(&_SwapRouter.TransactOpts, token, nonce, expiry, v, r, s) +} + +// SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. +// +// Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactor) SelfPermitIfNecessary(opts *bind.TransactOpts, token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "selfPermitIfNecessary", token, value, deadline, v, r, s) +} + +// SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. +// +// Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermitIfNecessary(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) +} + +// SelfPermitIfNecessary is a paid mutator transaction binding the contract method 0xc2e3140a. +// +// Solidity: function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SelfPermitIfNecessary(token common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _SwapRouter.Contract.SelfPermitIfNecessary(&_SwapRouter.TransactOpts, token, value, deadline, v, r, s) +} + +// SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x472b43f3. +// +// Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterTransactor) SwapExactTokensForTokens(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "swapExactTokensForTokens", amountIn, amountOutMin, path, to) +} + +// SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x472b43f3. +// +// Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterSession) SwapExactTokensForTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SwapExactTokensForTokens(&_SwapRouter.TransactOpts, amountIn, amountOutMin, path, to) +} + +// SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x472b43f3. +// +// Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to) payable returns(uint256 amountOut) +func (_SwapRouter *SwapRouterTransactorSession) SwapExactTokensForTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SwapExactTokensForTokens(&_SwapRouter.TransactOpts, amountIn, amountOutMin, path, to) +} + +// SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x42712a67. +// +// Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterTransactor) SwapTokensForExactTokens(opts *bind.TransactOpts, amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "swapTokensForExactTokens", amountOut, amountInMax, path, to) +} + +// SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x42712a67. +// +// Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterSession) SwapTokensForExactTokens(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SwapTokensForExactTokens(&_SwapRouter.TransactOpts, amountOut, amountInMax, path, to) +} + +// SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x42712a67. +// +// Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to) payable returns(uint256 amountIn) +func (_SwapRouter *SwapRouterTransactorSession) SwapTokensForExactTokens(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SwapTokensForExactTokens(&_SwapRouter.TransactOpts, amountOut, amountInMax, path, to) +} + +// SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. +// +// Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() +func (_SwapRouter *SwapRouterTransactor) SweepToken(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "sweepToken", token, amountMinimum, recipient) +} + +// SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. +// +// Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() +func (_SwapRouter *SwapRouterSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepToken(&_SwapRouter.TransactOpts, token, amountMinimum, recipient) +} + +// SweepToken is a paid mutator transaction binding the contract method 0xdf2ab5bb. +// +// Solidity: function sweepToken(address token, uint256 amountMinimum, address recipient) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SweepToken(token common.Address, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepToken(&_SwapRouter.TransactOpts, token, amountMinimum, recipient) +} + +// SweepToken0 is a paid mutator transaction binding the contract method 0xe90a182f. +// +// Solidity: function sweepToken(address token, uint256 amountMinimum) payable returns() +func (_SwapRouter *SwapRouterTransactor) SweepToken0(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "sweepToken0", token, amountMinimum) +} + +// SweepToken0 is a paid mutator transaction binding the contract method 0xe90a182f. +// +// Solidity: function sweepToken(address token, uint256 amountMinimum) payable returns() +func (_SwapRouter *SwapRouterSession) SweepToken0(token common.Address, amountMinimum *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepToken0(&_SwapRouter.TransactOpts, token, amountMinimum) +} + +// SweepToken0 is a paid mutator transaction binding the contract method 0xe90a182f. +// +// Solidity: function sweepToken(address token, uint256 amountMinimum) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SweepToken0(token common.Address, amountMinimum *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepToken0(&_SwapRouter.TransactOpts, token, amountMinimum) +} + +// SweepTokenWithFee is a paid mutator transaction binding the contract method 0x3068c554. +// +// Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactor) SweepTokenWithFee(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "sweepTokenWithFee", token, amountMinimum, feeBips, feeRecipient) +} + +// SweepTokenWithFee is a paid mutator transaction binding the contract method 0x3068c554. +// +// Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterSession) SweepTokenWithFee(token common.Address, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepTokenWithFee(&_SwapRouter.TransactOpts, token, amountMinimum, feeBips, feeRecipient) +} + +// SweepTokenWithFee is a paid mutator transaction binding the contract method 0x3068c554. +// +// Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SweepTokenWithFee(token common.Address, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepTokenWithFee(&_SwapRouter.TransactOpts, token, amountMinimum, feeBips, feeRecipient) +} + +// SweepTokenWithFee0 is a paid mutator transaction binding the contract method 0xe0e189a0. +// +// Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactor) SweepTokenWithFee0(opts *bind.TransactOpts, token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "sweepTokenWithFee0", token, amountMinimum, recipient, feeBips, feeRecipient) +} + +// SweepTokenWithFee0 is a paid mutator transaction binding the contract method 0xe0e189a0. +// +// Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterSession) SweepTokenWithFee0(token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepTokenWithFee0(&_SwapRouter.TransactOpts, token, amountMinimum, recipient, feeBips, feeRecipient) +} + +// SweepTokenWithFee0 is a paid mutator transaction binding the contract method 0xe0e189a0. +// +// Solidity: function sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) SweepTokenWithFee0(token common.Address, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.SweepTokenWithFee0(&_SwapRouter.TransactOpts, token, amountMinimum, recipient, feeBips, feeRecipient) +} + +// UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. +// +// Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() +func (_SwapRouter *SwapRouterTransactor) UniswapV3SwapCallback(opts *bind.TransactOpts, amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "uniswapV3SwapCallback", amount0Delta, amount1Delta, _data) +} + +// UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. +// +// Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() +func (_SwapRouter *SwapRouterSession) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { + return _SwapRouter.Contract.UniswapV3SwapCallback(&_SwapRouter.TransactOpts, amount0Delta, amount1Delta, _data) +} + +// UniswapV3SwapCallback is a paid mutator transaction binding the contract method 0xfa461e33. +// +// Solidity: function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) returns() +func (_SwapRouter *SwapRouterTransactorSession) UniswapV3SwapCallback(amount0Delta *big.Int, amount1Delta *big.Int, _data []byte) (*types.Transaction, error) { + return _SwapRouter.Contract.UniswapV3SwapCallback(&_SwapRouter.TransactOpts, amount0Delta, amount1Delta, _data) +} + +// UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. +// +// Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() +func (_SwapRouter *SwapRouterTransactor) UnwrapWETH9(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "unwrapWETH9", amountMinimum, recipient) +} + +// UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. +// +// Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() +func (_SwapRouter *SwapRouterSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH9(&_SwapRouter.TransactOpts, amountMinimum, recipient) +} + +// UnwrapWETH9 is a paid mutator transaction binding the contract method 0x49404b7c. +// +// Solidity: function unwrapWETH9(uint256 amountMinimum, address recipient) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) UnwrapWETH9(amountMinimum *big.Int, recipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH9(&_SwapRouter.TransactOpts, amountMinimum, recipient) +} + +// UnwrapWETH90 is a paid mutator transaction binding the contract method 0x49616997. +// +// Solidity: function unwrapWETH9(uint256 amountMinimum) payable returns() +func (_SwapRouter *SwapRouterTransactor) UnwrapWETH90(opts *bind.TransactOpts, amountMinimum *big.Int) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "unwrapWETH90", amountMinimum) +} + +// UnwrapWETH90 is a paid mutator transaction binding the contract method 0x49616997. +// +// Solidity: function unwrapWETH9(uint256 amountMinimum) payable returns() +func (_SwapRouter *SwapRouterSession) UnwrapWETH90(amountMinimum *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH90(&_SwapRouter.TransactOpts, amountMinimum) +} + +// UnwrapWETH90 is a paid mutator transaction binding the contract method 0x49616997. +// +// Solidity: function unwrapWETH9(uint256 amountMinimum) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) UnwrapWETH90(amountMinimum *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH90(&_SwapRouter.TransactOpts, amountMinimum) +} + +// UnwrapWETH9WithFee is a paid mutator transaction binding the contract method 0x9b2c0a37. +// +// Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactor) UnwrapWETH9WithFee(opts *bind.TransactOpts, amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "unwrapWETH9WithFee", amountMinimum, recipient, feeBips, feeRecipient) +} + +// UnwrapWETH9WithFee is a paid mutator transaction binding the contract method 0x9b2c0a37. +// +// Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterSession) UnwrapWETH9WithFee(amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH9WithFee(&_SwapRouter.TransactOpts, amountMinimum, recipient, feeBips, feeRecipient) +} + +// UnwrapWETH9WithFee is a paid mutator transaction binding the contract method 0x9b2c0a37. +// +// Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) UnwrapWETH9WithFee(amountMinimum *big.Int, recipient common.Address, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH9WithFee(&_SwapRouter.TransactOpts, amountMinimum, recipient, feeBips, feeRecipient) +} + +// UnwrapWETH9WithFee0 is a paid mutator transaction binding the contract method 0xd4ef38de. +// +// Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactor) UnwrapWETH9WithFee0(opts *bind.TransactOpts, amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "unwrapWETH9WithFee0", amountMinimum, feeBips, feeRecipient) +} + +// UnwrapWETH9WithFee0 is a paid mutator transaction binding the contract method 0xd4ef38de. +// +// Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterSession) UnwrapWETH9WithFee0(amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH9WithFee0(&_SwapRouter.TransactOpts, amountMinimum, feeBips, feeRecipient) +} + +// UnwrapWETH9WithFee0 is a paid mutator transaction binding the contract method 0xd4ef38de. +// +// Solidity: function unwrapWETH9WithFee(uint256 amountMinimum, uint256 feeBips, address feeRecipient) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) UnwrapWETH9WithFee0(amountMinimum *big.Int, feeBips *big.Int, feeRecipient common.Address) (*types.Transaction, error) { + return _SwapRouter.Contract.UnwrapWETH9WithFee0(&_SwapRouter.TransactOpts, amountMinimum, feeBips, feeRecipient) +} + +// WrapETH is a paid mutator transaction binding the contract method 0x1c58db4f. +// +// Solidity: function wrapETH(uint256 value) payable returns() +func (_SwapRouter *SwapRouterTransactor) WrapETH(opts *bind.TransactOpts, value *big.Int) (*types.Transaction, error) { + return _SwapRouter.contract.Transact(opts, "wrapETH", value) +} + +// WrapETH is a paid mutator transaction binding the contract method 0x1c58db4f. +// +// Solidity: function wrapETH(uint256 value) payable returns() +func (_SwapRouter *SwapRouterSession) WrapETH(value *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.WrapETH(&_SwapRouter.TransactOpts, value) +} + +// WrapETH is a paid mutator transaction binding the contract method 0x1c58db4f. +// +// Solidity: function wrapETH(uint256 value) payable returns() +func (_SwapRouter *SwapRouterTransactorSession) WrapETH(value *big.Int) (*types.Transaction, error) { + return _SwapRouter.Contract.WrapETH(&_SwapRouter.TransactOpts, value) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SwapRouter *SwapRouterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SwapRouter.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SwapRouter *SwapRouterSession) Receive() (*types.Transaction, error) { + return _SwapRouter.Contract.Receive(&_SwapRouter.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SwapRouter *SwapRouterTransactorSession) Receive() (*types.Transaction, error) { + return _SwapRouter.Contract.Receive(&_SwapRouter.TransactOpts) +} diff --git a/scenarios/univ3swaptx/contracts/weth.go b/scenarios/univ3swaptx/contracts/weth.go new file mode 100644 index 0000000..817e0ef --- /dev/null +++ b/scenarios/univ3swaptx/contracts/weth.go @@ -0,0 +1,1113 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package univ3swaptx + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// WethMetaData contains all meta data concerning the Weth contract. +var WethMetaData = &bind.MetaData{ + ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"guy\",\"type\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"src\",\"type\":\"address\"},{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"}]", + Bin: "0x60c0604052600d60808190527f577261707065642045746865720000000000000000000000000000000000000060a090815261003e91600091906100a3565b506040805180820190915260048082527f57455448000000000000000000000000000000000000000000000000000000006020909201918252610083916001916100a3565b506002805460ff1916601217905534801561009d57600080fd5b5061013e565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100e457805160ff1916838001178555610111565b82800160010185558215610111579182015b828111156101115782518255916020019190600101906100f6565b5061011d929150610121565b5090565b61013b91905b8082111561011d5760008155600101610127565b90565b6106568061014d6000396000f3006080604052600436106100925760003560e01c63ffffffff16806306fdde031461009c578063095ea7b31461012657806318160ddd1461015e57806323b872dd146101855780632e1a7d4d146101af578063313ce567146101c757806370a08231146101f257806395d89b4114610213578063a9059cbb14610228578063d0e30db014610092578063dd62ed3e1461024c575b61009a610273565b005b3480156100a857600080fd5b506100b16102c2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100eb5781810151838201526020016100d3565b50505050905090810190601f1680156101185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013257600080fd5b5061014a600160a060020a0360043516602435610350565b604080519115158252519081900360200190f35b34801561016a57600080fd5b506101736103b6565b60408051918252519081900360200190f35b34801561019157600080fd5b5061014a600160a060020a03600435811690602435166044356103bb565b3480156101bb57600080fd5b5061009a6004356104ef565b3480156101d357600080fd5b506101dc610584565b6040805160ff9092168252519081900360200190f35b3480156101fe57600080fd5b50610173600160a060020a036004351661058d565b34801561021f57600080fd5b506100b161059f565b34801561023457600080fd5b5061014a600160a060020a03600435166024356105f9565b34801561025857600080fd5b50610173600160a060020a036004358116906024351661060d565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103485780601f1061031d57610100808354040283529160200191610348565b820191906000526020600020905b81548152906001019060200180831161032b57829003601f168201915b505050505081565b336000818152600460209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b303190565b600160a060020a0383166000908152600360205260408120548211156103e057600080fd5b600160a060020a038416331480159061041e5750600160a060020a038416600090815260046020908152604080832033845290915290205460001914155b1561047e57600160a060020a038416600090815260046020908152604080832033845290915290205482111561045357600080fd5b600160a060020a03841660009081526004602090815260408083203384529091529020805483900390555b600160a060020a03808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561050b57600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f1935050505015801561054a573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103485780601f1061031d57610100808354040283529160200191610348565b60006106063384846103bb565b9392505050565b6004602090815260009283526040808420909152908252902054815600a165627a7a72305820cdc402417907a098bc5bc3cd06952f3284f73052dccefab50e1f5e07421287ce0029", +} + +// WethABI is the input ABI used to generate the binding from. +// Deprecated: Use WethMetaData.ABI instead. +var WethABI = WethMetaData.ABI + +// WethBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use WethMetaData.Bin instead. +var WethBin = WethMetaData.Bin + +// DeployWeth deploys a new Ethereum contract, binding an instance of Weth to it. +func DeployWeth(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Weth, error) { + parsed, err := WethMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(WethBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Weth{WethCaller: WethCaller{contract: contract}, WethTransactor: WethTransactor{contract: contract}, WethFilterer: WethFilterer{contract: contract}}, nil +} + +// Weth is an auto generated Go binding around an Ethereum contract. +type Weth struct { + WethCaller // Read-only binding to the contract + WethTransactor // Write-only binding to the contract + WethFilterer // Log filterer for contract events +} + +// WethCaller is an auto generated read-only Go binding around an Ethereum contract. +type WethCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WethTransactor is an auto generated write-only Go binding around an Ethereum contract. +type WethTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WethFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type WethFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WethSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type WethSession struct { + Contract *Weth // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// WethCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type WethCallerSession struct { + Contract *WethCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// WethTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type WethTransactorSession struct { + Contract *WethTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// WethRaw is an auto generated low-level Go binding around an Ethereum contract. +type WethRaw struct { + Contract *Weth // Generic contract binding to access the raw methods on +} + +// WethCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type WethCallerRaw struct { + Contract *WethCaller // Generic read-only contract binding to access the raw methods on +} + +// WethTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type WethTransactorRaw struct { + Contract *WethTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewWeth creates a new instance of Weth, bound to a specific deployed contract. +func NewWeth(address common.Address, backend bind.ContractBackend) (*Weth, error) { + contract, err := bindWeth(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Weth{WethCaller: WethCaller{contract: contract}, WethTransactor: WethTransactor{contract: contract}, WethFilterer: WethFilterer{contract: contract}}, nil +} + +// NewWethCaller creates a new read-only instance of Weth, bound to a specific deployed contract. +func NewWethCaller(address common.Address, caller bind.ContractCaller) (*WethCaller, error) { + contract, err := bindWeth(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &WethCaller{contract: contract}, nil +} + +// NewWethTransactor creates a new write-only instance of Weth, bound to a specific deployed contract. +func NewWethTransactor(address common.Address, transactor bind.ContractTransactor) (*WethTransactor, error) { + contract, err := bindWeth(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &WethTransactor{contract: contract}, nil +} + +// NewWethFilterer creates a new log filterer instance of Weth, bound to a specific deployed contract. +func NewWethFilterer(address common.Address, filterer bind.ContractFilterer) (*WethFilterer, error) { + contract, err := bindWeth(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &WethFilterer{contract: contract}, nil +} + +// bindWeth binds a generic wrapper to an already deployed contract. +func bindWeth(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := WethMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Weth *WethRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Weth.Contract.WethCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Weth *WethRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Weth.Contract.WethTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Weth *WethRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Weth.Contract.WethTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Weth *WethCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Weth.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Weth *WethTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Weth.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Weth *WethTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Weth.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_Weth *WethCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _Weth.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_Weth *WethSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _Weth.Contract.Allowance(&_Weth.CallOpts, arg0, arg1) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_Weth *WethCallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _Weth.Contract.Allowance(&_Weth.CallOpts, arg0, arg1) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_Weth *WethCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _Weth.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_Weth *WethSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _Weth.Contract.BalanceOf(&_Weth.CallOpts, arg0) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_Weth *WethCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _Weth.Contract.BalanceOf(&_Weth.CallOpts, arg0) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Weth *WethCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _Weth.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Weth *WethSession) Decimals() (uint8, error) { + return _Weth.Contract.Decimals(&_Weth.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Weth *WethCallerSession) Decimals() (uint8, error) { + return _Weth.Contract.Decimals(&_Weth.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Weth *WethCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Weth.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Weth *WethSession) Name() (string, error) { + return _Weth.Contract.Name(&_Weth.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Weth *WethCallerSession) Name() (string, error) { + return _Weth.Contract.Name(&_Weth.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Weth *WethCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Weth.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Weth *WethSession) Symbol() (string, error) { + return _Weth.Contract.Symbol(&_Weth.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Weth *WethCallerSession) Symbol() (string, error) { + return _Weth.Contract.Symbol(&_Weth.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Weth *WethCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Weth.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Weth *WethSession) TotalSupply() (*big.Int, error) { + return _Weth.Contract.TotalSupply(&_Weth.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Weth *WethCallerSession) TotalSupply() (*big.Int, error) { + return _Weth.Contract.TotalSupply(&_Weth.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_Weth *WethTransactor) Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.contract.Transact(opts, "approve", guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_Weth *WethSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.Approve(&_Weth.TransactOpts, guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_Weth *WethTransactorSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.Approve(&_Weth.TransactOpts, guy, wad) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_Weth *WethTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Weth.contract.Transact(opts, "deposit") +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_Weth *WethSession) Deposit() (*types.Transaction, error) { + return _Weth.Contract.Deposit(&_Weth.TransactOpts) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_Weth *WethTransactorSession) Deposit() (*types.Transaction, error) { + return _Weth.Contract.Deposit(&_Weth.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_Weth *WethTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.contract.Transact(opts, "transfer", dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_Weth *WethSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.Transfer(&_Weth.TransactOpts, dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_Weth *WethTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.Transfer(&_Weth.TransactOpts, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_Weth *WethTransactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.contract.Transact(opts, "transferFrom", src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_Weth *WethSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.TransferFrom(&_Weth.TransactOpts, src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_Weth *WethTransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.TransferFrom(&_Weth.TransactOpts, src, dst, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_Weth *WethTransactor) Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _Weth.contract.Transact(opts, "withdraw", wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_Weth *WethSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.Withdraw(&_Weth.TransactOpts, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_Weth *WethTransactorSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _Weth.Contract.Withdraw(&_Weth.TransactOpts, wad) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Weth *WethTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _Weth.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Weth *WethSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Weth.Contract.Fallback(&_Weth.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Weth *WethTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Weth.Contract.Fallback(&_Weth.TransactOpts, calldata) +} + +// WethApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Weth contract. +type WethApprovalIterator struct { + Event *WethApproval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *WethApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WethApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WethApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WethApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WethApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WethApproval represents a Approval event raised by the Weth contract. +type WethApproval struct { + Src common.Address + Guy common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_Weth *WethFilterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*WethApprovalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _Weth.contract.FilterLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return &WethApprovalIterator{contract: _Weth.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_Weth *WethFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *WethApproval, src []common.Address, guy []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _Weth.contract.WatchLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WethApproval) + if err := _Weth.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_Weth *WethFilterer) ParseApproval(log types.Log) (*WethApproval, error) { + event := new(WethApproval) + if err := _Weth.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WethDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the Weth contract. +type WethDepositIterator struct { + Event *WethDeposit // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *WethDepositIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WethDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WethDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WethDepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WethDepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WethDeposit represents a Deposit event raised by the Weth contract. +type WethDeposit struct { + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_Weth *WethFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WethDepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _Weth.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &WethDepositIterator{contract: _Weth.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_Weth *WethFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *WethDeposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _Weth.contract.WatchLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WethDeposit) + if err := _Weth.contract.UnpackLog(event, "Deposit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_Weth *WethFilterer) ParseDeposit(log types.Log) (*WethDeposit, error) { + event := new(WethDeposit) + if err := _Weth.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WethTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Weth contract. +type WethTransferIterator struct { + Event *WethTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *WethTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WethTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WethTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WethTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WethTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WethTransfer represents a Transfer event raised by the Weth contract. +type WethTransfer struct { + Src common.Address + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_Weth *WethFilterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*WethTransferIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _Weth.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return &WethTransferIterator{contract: _Weth.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_Weth *WethFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *WethTransfer, src []common.Address, dst []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _Weth.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WethTransfer) + if err := _Weth.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_Weth *WethFilterer) ParseTransfer(log types.Log) (*WethTransfer, error) { + event := new(WethTransfer) + if err := _Weth.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WethWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the Weth contract. +type WethWithdrawalIterator struct { + Event *WethWithdrawal // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *WethWithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WethWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WethWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WethWithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WethWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WethWithdrawal represents a Withdrawal event raised by the Weth contract. +type WethWithdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_Weth *WethFilterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WethWithdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _Weth.contract.FilterLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return &WethWithdrawalIterator{contract: _Weth.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_Weth *WethFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WethWithdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _Weth.contract.WatchLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WethWithdrawal) + if err := _Weth.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal is a log parse operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_Weth *WethFilterer) ParseWithdrawal(log types.Log) (*WethWithdrawal, error) { + event := new(WethWithdrawal) + if err := _Weth.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/scenarios/univ3swaptx/univ3swaptx.go b/scenarios/univ3swaptx/univ3swaptx.go new file mode 100644 index 0000000..4ae815b --- /dev/null +++ b/scenarios/univ3swaptx/univ3swaptx.go @@ -0,0 +1,684 @@ +package univ3swaptx + +import ( + rand2 "crypto/rand" + "flag" + "fmt" + univ2tx "github.com/astriaorg/spamooor/scenarios/univ2tx/contracts" + univ3swaptx "github.com/astriaorg/spamooor/scenarios/univ3swaptx/contracts" + "github.com/astriaorg/spamooor/scenariotypes" + "github.com/astriaorg/spamooor/tester" + "github.com/astriaorg/spamooor/txbuilder" + "github.com/astriaorg/spamooor/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/holiman/uint256" + "github.com/sirupsen/logrus" + "github.com/spf13/pflag" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "math/big" + "os" + "sync" + "time" +) + +type ScenarioOptions struct { + TotalCount uint64 + Throughput uint64 + MaxPending uint64 + MaxWallets uint64 + Timeout uint64 + BaseFee uint64 + TipFee uint64 + WethContractAddress string + SwapRouterContractAddress string + CustomizableErc20ContractAddress string + AmountToSwap uint64 + RandomAmountToSwap bool + TokenMintAmount uint64 + ComposerAddress string + SendViaComposer bool + RollupId string +} + +type Scenario struct { + options ScenarioOptions + logger *logrus.Entry + tester *tester.Tester + composerConn *grpc.ClientConn + + wethContract common.Address + swapRouterContract common.Address + customizableErc20Contract common.Address + + tokenMintAmount *big.Int + + pendingCount uint64 + pendingChan chan bool + pendingWGroup sync.WaitGroup +} + +func NewScenario() scenariotypes.Scenario { + return &Scenario{ + logger: logrus.WithField("scenario", "univ3swaptx"), + } +} + +func (s *Scenario) Flags(flags *pflag.FlagSet) error { + flags.Uint64VarP(&s.options.TotalCount, "count", "c", 0, "Total number of large transactions to send") + flags.Uint64VarP(&s.options.Throughput, "throughput", "t", 0, "Number of large transactions to send per slot") + flags.Uint64Var(&s.options.MaxPending, "max-pending", 0, "Maximum number of pending transactions") + flags.Uint64Var(&s.options.MaxWallets, "max-wallets", 0, "Maximum number of child wallets to use") + flags.Uint64Var(&s.options.Timeout, "timeout", 120, "Number of seconds to wait timing out the test") + flags.Uint64Var(&s.options.BaseFee, "basefee", 20, "Max fee per gas to use in large transactions (in gwei)") + flags.Uint64Var(&s.options.TipFee, "tipfee", 2, "Max tip per gas to use in large transactions (in gwei)") + flag.Uint64Var(&s.options.AmountToSwap, "amount-to-swap", 1, "Amount of tokens to swap in each transaction(in gwei)") + flag.BoolVar(&s.options.RandomAmountToSwap, "random-amount-to-swap", false, "Randomize the amount of tokens to swap in each transaction(in gwei)") + flags.StringVar(&s.options.ComposerAddress, "composer-address", "localhost:50051", "Address of the composer service") + flags.BoolVar(&s.options.SendViaComposer, "send-via-composer", false, "Send transactions via composer") + flags.StringVar(&s.options.WethContractAddress, "weth-contract", "", "The address of the WETH contract") + flags.StringVar(&s.options.SwapRouterContractAddress, "swap-router-contract", "", "The address of the Uniswap V2 Router contract") + flags.StringVar(&s.options.CustomizableErc20ContractAddress, "customizable-erc20-contract", "", "The address of the customizable ERC20 contract") + flags.Uint64Var(&s.options.TokenMintAmount, "token-mint-amount", 1000000000000000000, "Amount of tokens to mint for each wallet(in gwei)") + flags.StringVar(&s.options.RollupId, "", "", "The rollup id of the evm rollup") + + return nil +} + +func (s *Scenario) Init(testerCfg *tester.TesterConfig) error { + if s.options.TotalCount == 0 && s.options.Throughput == 0 { + return fmt.Errorf("neither total count nor throughput limit set, must define at least one of them") + } + + if s.options.MaxWallets > 0 { + testerCfg.WalletCount = s.options.MaxWallets + } else if s.options.TotalCount > 0 { + if s.options.TotalCount < 1000 { + testerCfg.WalletCount = s.options.TotalCount + } else { + testerCfg.WalletCount = 1000 + } + } else { + if s.options.Throughput*10 < 1000 { + testerCfg.WalletCount = s.options.Throughput * 10 + } else { + testerCfg.WalletCount = 1000 + } + } + + if s.options.MaxPending > 0 { + s.pendingChan = make(chan bool, s.options.MaxPending) + } + + s.wethContract = common.HexToAddress(s.options.WethContractAddress) + s.swapRouterContract = common.HexToAddress(s.options.SwapRouterContractAddress) + s.customizableErc20Contract = common.HexToAddress(s.options.CustomizableErc20ContractAddress) + + s.tokenMintAmount = big.NewInt(int64(s.options.TokenMintAmount)) + + conn, err := grpc.NewClient(s.options.ComposerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return err + } + + s.composerConn = conn + + return nil +} + +func (s *Scenario) Setup(testerCfg *tester.Tester) error { + s.tester = testerCfg + + s.logger.Infof("starting scenario: univ3tx") + + // now we need to mint DAI and WETH for all child wallets + s.logger.Infof("minting Erc20 and WETH for child wallets...") + errorMap, err := s.MintErc20AndWethForChildWallets() + if err != nil { + s.logger.Errorf("could not mint Erc20 and WETH for child wallets: %v", err) + return err + } + if len(errorMap) > 0 { + // print errors + for addr, errs := range errorMap { + for _, e := range errs { + s.logger.Errorf("error for wallet: %v: %v", addr.String(), e) + } + } + } + + return nil +} + +func (s *Scenario) Run() error { + txIdxCounter := uint64(0) + counterMutex := sync.Mutex{} + waitGroup := sync.WaitGroup{} + pendingCount := uint64(0) + txCount := uint64(0) + startTime := time.Now() + + for { + txIdx := txIdxCounter + txIdxCounter++ + + if s.pendingChan != nil { + // await pending transactions + s.pendingChan <- true + } + waitGroup.Add(1) + counterMutex.Lock() + pendingCount++ + counterMutex.Unlock() + + go func(txIdx uint64) { + defer func() { + counterMutex.Lock() + pendingCount-- + counterMutex.Unlock() + waitGroup.Done() + }() + + logger := s.logger + tx, client, err := s.sendTx(txIdx) + if client != nil { + logger = logger.WithField("rpc", client.GetName()) + } + if err != nil { + logger.Warnf("could not send transaction: %v", err) + <-s.pendingChan + return + } + + counterMutex.Lock() + txCount++ + counterMutex.Unlock() + logger.Infof("sent tx #%6d: %v", txIdx+1, tx.Hash().String()) + }(txIdx) + + count := txCount + pendingCount + if s.options.TotalCount > 0 && count >= s.options.TotalCount { + break + } + if s.options.Throughput > 0 { + for count/((uint64(time.Since(startTime).Seconds())/utils.SecondsPerSlot)+1) >= s.options.Throughput { + time.Sleep(100 * time.Millisecond) + } + } + } + waitGroup.Wait() + + s.logger.Infof("finished sending transactions, awaiting block inclusion...") + s.pendingWGroup.Wait() + s.logger.Infof("finished sending transactions, awaiting block inclusion...") + + return nil +} + +func (s *Scenario) sendTx(txIdx uint64) (*types.Transaction, *txbuilder.Client, error) { + client := s.tester.GetClient(tester.SelectByIndex, int(txIdx)) + wallet := s.tester.GetWallet(tester.SelectByIndex, int(txIdx)) + + var feeCap *big.Int + var tipCap *big.Int + + if s.options.BaseFee > 0 { + feeCap = new(big.Int).Mul(big.NewInt(int64(s.options.BaseFee)), big.NewInt(1000000000)) + } + if s.options.TipFee > 0 { + tipCap = new(big.Int).Mul(big.NewInt(int64(s.options.TipFee)), big.NewInt(1000000000)) + } + + if feeCap == nil || tipCap == nil { + var err error + feeCap, tipCap, err = client.GetSuggestedFee() + if err != nil { + return nil, client, err + } + } + + if feeCap.Cmp(big.NewInt(1000000000)) < 0 { + feeCap = big.NewInt(1000000000) + } + if tipCap.Cmp(big.NewInt(1000000000)) < 0 { + tipCap = big.NewInt(1000000000) + } + + routerContract, err := s.GetSwapRouterContract() + if err != nil { + return nil, nil, err + } + + // Generate a random number (either 0 or 1) + result, err := rand2.Int(rand2.Reader, big.NewInt(2)) + if err != nil { + return nil, nil, err + } + var swapDirection []common.Address + if result.Uint64() == 0 { + swapDirection = []common.Address{s.customizableErc20Contract, s.wethContract} + } else { + swapDirection = []common.Address{s.wethContract, s.customizableErc20Contract} + } + + // get amount to swap + amount := uint256.NewInt(s.options.AmountToSwap) + amount = amount.Mul(amount, uint256.NewInt(1000000)) + if s.options.RandomAmountToSwap { + n, err := rand2.Int(rand2.Reader, amount.ToBig()) + if err == nil { + amount = uint256.MustFromBig(n) + } + } + + walletTransactor, err := wallet.GetTransactor(true, big.NewInt(0)) + if err != nil { + return nil, nil, err + } + + swapTx, err := routerContract.ExactInputSingle(walletTransactor, univ3swaptx.IV3SwapRouterExactInputSingleParams{ + TokenIn: swapDirection[0], + TokenOut: swapDirection[1], + Fee: big.NewInt(0), + Recipient: walletTransactor.From, + AmountIn: amount.ToBig(), + AmountOutMinimum: big.NewInt(1), + SqrtPriceLimitX96: big.NewInt(0), + }) + if err != nil { + return nil, nil, err + } + + txData, err := txbuilder.DynFeeTx(&txbuilder.TxMetadata{ + GasFeeCap: uint256.MustFromBig(feeCap), + GasTipCap: uint256.MustFromBig(tipCap), + Gas: swapTx.Gas(), + To: swapTx.To(), + Value: uint256.MustFromBig(swapTx.Value()), + Data: swapTx.Data(), + }) + if err != nil { + return nil, nil, err + } + + tx, err := wallet.BuildDynamicFeeTx(txData) + if err != nil { + return nil, nil, err + } + + if s.options.SendViaComposer { + err = client.SendTransactionViaComposer(tx, s.composerConn, s.options.RollupId) + if err != nil { + return nil, client, err + } + } else { + err = client.SendTransaction(tx) + if err != nil { + return nil, client, err + } + } + + s.pendingWGroup.Add(1) + go s.awaitTx(txIdx, tx, client, wallet) + + return tx, client, nil +} + +func (s *Scenario) MintErc20AndWethForChildWallets() (map[common.Address][]error, error) { + if s.options.MaxWallets == 0 { + return nil, fmt.Errorf("max wallets not set") + } + + client := s.tester.GetClient(tester.SelectByIndex, 0) + + rootWallet := s.tester.GetRootWallet() + rootWalletTransactor, err := rootWallet.GetTransactor(true, big.NewInt(0)) + if err != nil { + s.logger.Errorf("could not get transactor for root wallet: %v", err) + return nil, err + } + + tokenMintAmount := s.tokenMintAmount + batchSize := uint64(100) + batchIndex := uint64(0) + + errorMapLock := sync.Mutex{} + errorMap := make(map[common.Address][]error) + + wg := sync.WaitGroup{} + // batch up the mints and deposits in order to not overwhelm the rpc + for { + wg.Add(1) + go func(batchIndex uint64, batchSize uint64, errorMap *map[common.Address][]error, errorMapLock *sync.Mutex) { + defer wg.Done() + finalBatchIndex := batchIndex + batchSize + + s.logger.Infof("funding child wallets: %v/%v", batchIndex, s.tester.GetTotalChildWallets()) + + wg1 := sync.WaitGroup{} + + for { + if batchIndex > uint64(s.tester.GetTotalChildWallets()) || batchIndex >= finalBatchIndex { + break + } + + childWallet := s.tester.GetWallet(tester.SelectByIndex, int(batchIndex)) + + wg1.Add(1) + go func(errorMap *map[common.Address][]error, errorMapLock *sync.Mutex) { + defer wg1.Done() + // get child wallet transactor + childWalletTransactor, err := childWallet.GetTransactor(true, big.NewInt(0)) + if err != nil { + s.logger.Errorf("could not get transactor for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + customizableErc20Contract, err := s.GetCustomizableErc20Contract() + if err != nil { + s.logger.Errorf("could not create Dai contract: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + wethContract, err := s.GetWethContract() + if err != nil { + s.logger.Errorf("could not create WETH contract: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + // transfer erc20 for child wallet + transferTx, err := customizableErc20Contract.Transfer(rootWalletTransactor, childWallet.GetAddress(), tokenMintAmount) + if err != nil { + s.logger.Errorf("could not transfer Erc20 for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + wethTransferTx, err := wethContract.Transfer(rootWalletTransactor, childWallet.GetAddress(), tokenMintAmount) + if err != nil { + s.logger.Errorf("could not transfer WETH for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + childWalletTransactor.Value = big.NewInt(0) + // dai approval + approveTx, err := customizableErc20Contract.Approve(childWalletTransactor, s.swapRouterContract, tokenMintAmount) + if err != nil { + s.logger.Errorf("could not approve DAI for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + wethApproveTx, err := wethContract.Approve(childWalletTransactor, s.swapRouterContract, tokenMintAmount) + if err != nil { + s.logger.Errorf("could not approve WETH for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + internalWg := sync.WaitGroup{} + + internalWg.Add(1) + // send and await txs + go func(errorMap *map[common.Address][]error, errorMapLock *sync.Mutex) { + defer internalWg.Done() + _, _, err = txbuilder.SendAndAwaitTx(txbuilder.SendTxOpts{ + Gas: 0, + Wallet: rootWallet, + Tx: transferTx, + Client: client, + BaseFee: int64(s.options.BaseFee), + TipFee: int64(s.options.TipFee), + }) + if err != nil { + s.logger.Errorf("could not mint DAI for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + _, _, err = txbuilder.SendAndAwaitTx(txbuilder.SendTxOpts{ + Gas: 0, + Wallet: rootWallet, + Tx: wethTransferTx, + Client: client, + BaseFee: int64(s.options.BaseFee), + TipFee: int64(s.options.TipFee), + }) + if err != nil { + s.logger.Errorf("could not transfer WETH for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + _, _, err = txbuilder.SendAndAwaitTx(txbuilder.SendTxOpts{ + Gas: 0, + Wallet: rootWallet, + Tx: wethApproveTx, + Client: client, + BaseFee: int64(s.options.BaseFee), + TipFee: int64(s.options.TipFee), + }) + if err != nil { + s.logger.Errorf("could not approve WETH for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + + _, _, err = txbuilder.SendAndAwaitTx(txbuilder.SendTxOpts{ + Gas: 0, + Wallet: rootWallet, + Tx: approveTx, + Client: client, + BaseFee: int64(s.options.BaseFee), + TipFee: int64(s.options.TipFee), + }) + if err != nil { + s.logger.Errorf("could not approve ERC20 for child wallet: %v", err) + errorMapLock.Lock() + (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + errorMapLock.Unlock() + return + } + }(errorMap, errorMapLock) + + //internalWg.Add(1) + //go func(errorMap *map[common.Address][]error, errorMapLock *sync.Mutex) { + // defer internalWg.Done() + // _, _, err = txbuilder.SendAndAwaitTx(txbuilder.SendTxOpts{ + // Gas: 0, + // Wallet: childWallet, + // Tx: approveTx, + // Client: client, + // BaseFee: int64(s.options.BaseFee), + // TipFee: int64(s.options.TipFee), + // }) + // if err != nil { + // s.logger.Errorf("could not approve DAI for child wallet: %v", err) + // errorMapLock.Lock() + // (*errorMap)[childWallet.GetAddress()] = append((*errorMap)[childWallet.GetAddress()], err) + // errorMapLock.Unlock() + // return + // } + //}(errorMap, errorMapLock) + + internalWg.Wait() + }(errorMap, errorMapLock) + + wg1.Wait() + + batchIndex += 1 + } + + }(batchIndex, batchSize, &errorMap, &errorMapLock) + + batchIndex += batchSize + + // we are done if this is true + if batchIndex >= uint64(s.tester.GetTotalChildWallets()) { + break + } + } + + wg.Wait() + + s.logger.Infof("minted DAI for child wallets") + + return errorMap, nil +} + +func (s *Scenario) awaitTx(txIdx uint64, tx *types.Transaction, client *txbuilder.Client, wallet *txbuilder.Wallet) { + var awaitConfirmation bool = true + defer func() { + awaitConfirmation = false + if s.pendingChan != nil { + <-s.pendingChan + } + s.pendingWGroup.Done() + }() + if s.options.Timeout > 0 { + go s.timeTicker(txIdx, tx, &awaitConfirmation) + } + + receipt, blockNum, err := client.AwaitTransaction(tx) + if err != nil { + s.logger.WithField("client", client.GetName()).Warnf("error while awaiting tx receipt: %v", err) + return + } + + effectiveGasPrice := receipt.EffectiveGasPrice + if effectiveGasPrice == nil { + effectiveGasPrice = big.NewInt(0) + } + blobGasPrice := receipt.BlobGasPrice + if blobGasPrice == nil { + blobGasPrice = big.NewInt(0) + } + feeAmount := new(big.Int).Mul(effectiveGasPrice, big.NewInt(int64(receipt.GasUsed))) + totalAmount := new(big.Int).Add(tx.Value(), feeAmount) + wallet.SubBalance(totalAmount) + + gweiTotalFee := new(big.Int).Div(totalAmount, big.NewInt(1000000000)) + gweiBaseFee := new(big.Int).Div(effectiveGasPrice, big.NewInt(1000000000)) + gweiBlobFee := new(big.Int).Div(blobGasPrice, big.NewInt(1000000000)) + + txStatus := "failure" + if receipt.Status == 1 { + txStatus = "success" + } + + s.logger.WithField("client", client.GetName()).Infof(" transaction %d confirmed in block #%v with %s. total fee: %v gwei (base: %v, blob: %v)", txIdx+1, blockNum, txStatus, gweiTotalFee, gweiBaseFee, gweiBlobFee) +} + +func (s *Scenario) timeTicker(txIdx uint64, tx *types.Transaction, awaitConfirmation *bool) { + for { + time.Sleep(time.Duration(s.options.Timeout) * time.Second) + + if !*awaitConfirmation { + break + } + + s.logger.Infof("timeout reached for tx: %d with hash: %s, stopping test", txIdx, tx.Hash().String()) + os.Exit(1) + } +} + +func (s *Scenario) GetWethBalance(wallet *txbuilder.Wallet) (*big.Int, error) { + client := s.tester.GetClient(tester.SelectByIndex, 0) + + wethContract, err := univ3swaptx.NewWeth(s.wethContract, client.GetEthClient()) + if err != nil { + return nil, err + } + + return wethContract.BalanceOf(nil, wallet.GetAddress()) +} + +func (s *Scenario) GetCustomizableErc20Balance(wallet *txbuilder.Wallet) (*big.Int, error) { + client := s.tester.GetClient(tester.SelectByIndex, 0) + + customizableErc20, err := univ3swaptx.NewCustomizableErc20(s.customizableErc20Contract, client.GetEthClient()) + if err != nil { + return nil, err + } + + return customizableErc20.BalanceOf(nil, wallet.GetAddress()) +} + +func (s *Scenario) GetWethAllowance(wallet *txbuilder.Wallet, to common.Address) (*big.Int, error) { + client := s.tester.GetClient(tester.SelectByIndex, 0) + + wethContract, err := univ2tx.NewWeth(s.wethContract, client.GetEthClient()) + if err != nil { + return nil, err + } + + return wethContract.Allowance(nil, wallet.GetAddress(), to) +} + +func (s *Scenario) GetCustomizableErc20Allowance(wallet *txbuilder.Wallet, to common.Address) (*big.Int, error) { + client := s.tester.GetClient(tester.SelectByIndex, 0) + + customizableErc20, err := univ3swaptx.NewCustomizableErc20(s.customizableErc20Contract, client.GetEthClient()) + if err != nil { + return nil, err + } + + return customizableErc20.Allowance(nil, wallet.GetAddress(), to) +} + +func (s *Scenario) GetCustomizableErc20Contract() (*univ3swaptx.CustomizableErc20, error) { + client := s.tester.GetClient(tester.SelectByIndex, 0) + + customizableErc20Contract, err := univ3swaptx.NewCustomizableErc20(s.customizableErc20Contract, client.GetEthClient()) + if err != nil { + return nil, err + } + + return customizableErc20Contract, nil +} + +func (s *Scenario) GetWethContract() (*univ3swaptx.Weth, error) { + client := s.tester.GetClient(tester.SelectByIndex, 0) + + wethContract, err := univ3swaptx.NewWeth(s.wethContract, client.GetEthClient()) + if err != nil { + return nil, err + } + + return wethContract, nil +} + +func (s *Scenario) GetSwapRouterContract() (*univ3swaptx.SwapRouter, error) { + client := s.tester.GetClient(tester.SelectByIndex, 0) + + swapRouterContract, err := univ3swaptx.NewSwapRouter(s.swapRouterContract, client.GetEthClient()) + if err != nil { + return nil, err + } + + return swapRouterContract, nil +}