From eb4785133345f8375e94410e45871344243bc4a0 Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Mon, 25 Sep 2023 11:40:49 +1000 Subject: [PATCH] Update example diagrams --- docs/README.md | 76 +++- docs/depositDetailed.svg | 2 +- docs/depositSummary.svg | 2 +- docs/depositValue.svg | 1 + docs/dynamicFee.config.json | 546 ++++++++++++++++++++----- docs/dynamicFeeAddDetailed.svg | 2 +- docs/dynamicFeeAddSummary.svg | 2 +- docs/dynamicFeeAddValue.svg | 2 +- docs/dynamicFeeRemoveDetailed.svg | 2 +- docs/dynamicFeeRemoveSummary.svg | 2 +- docs/dynamicFeeRemoveValue.svg | 1 + docs/dynamicFeeSwapDetailed.svg | 2 +- docs/dynamicFeeSwapSummary.svg | 2 +- docs/dynamicFeeSwapValue.svg | 2 +- docs/flashLoanDetailed.svg | 2 +- docs/flashLoanSummary.svg | 2 +- docs/swapPoolManagerTokensDetailed.svg | 2 +- docs/swapPoolManagerTokensSummary.svg | 2 +- docs/swapPoolManagerTokensValue.svg | 1 + docs/withdrawDetailed.svg | 2 +- docs/withdrawSummary.svg | 2 +- docs/withdrawValue.svg | 1 + dynamicFeeRemoveDetailed.svg | 0 23 files changed, 522 insertions(+), 136 deletions(-) create mode 100644 docs/depositValue.svg create mode 100644 docs/dynamicFeeRemoveValue.svg create mode 100644 docs/swapPoolManagerTokensValue.svg create mode 100644 docs/withdrawValue.svg create mode 100644 dynamicFeeRemoveDetailed.svg diff --git a/docs/README.md b/docs/README.md index a4a1c1b..48ddb76 100644 --- a/docs/README.md +++ b/docs/README.md @@ -65,7 +65,7 @@ tx2uml --nodeType anvil --configFile counter.config.json --chain none \ ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Swap Tokens" -hf -hc -x -l -p -g -t -v \ - 0x623e6894fd8d64ae42534dfcc314aeff0695f5518f818aed295561b068b2af46 \ + 0x3ed0c0719da01688328b48231566ff10d27ddc07d937bffd84fa926de27ed765 \ -o dynamicFeeSwapSummary ``` @@ -74,16 +74,18 @@ See the full trace with parameters in [dynamicFeeSwapDetailed.svg](./dynamicFeeS ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Swap Tokens" -v \ - 0x623e6894fd8d64ae42534dfcc314aeff0695f5518f818aed295561b068b2af46 \ + 0x3ed0c0719da01688328b48231566ff10d27ddc07d937bffd84fa926de27ed765 \ -o dynamicFeeSwapDetailed ``` +**Value Flows** + ![Dynamic Fee Swap Value](./dynamicFeeSwapValue.svg) ``` tx2uml value --configFile dynamicFee.config.json --chain none --onlyToken \ --title "Uniswap v4 - Swap Tokens" -hf -hc -v \ - 0x623e6894fd8d64ae42534dfcc314aeff0695f5518f818aed295561b068b2af46 \ + 0x3ed0c0719da01688328b48231566ff10d27ddc07d937bffd84fa926de27ed765 \ -o dynamicFeeSwapValue ``` @@ -94,7 +96,7 @@ tx2uml value --configFile dynamicFee.config.json --chain none --onlyToken \ ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Remove Liquidity to a Pool" -hf -hc -x -l -p -g -t -v \ - 0xc639b3116391ae4d9ade0ba25bc87d690950c63405fc4d1b37e911f4d4f0b83b \ + 0x8a288170cf4f7f37e478597208843dda7fa2fcfe852dc94b5f4d9a36b0bfd278 \ -o dynamicFeeAddSummary ``` @@ -103,18 +105,18 @@ See the full trace with parameters in [dynamicFeeAddDetailed](./dynamicFeeAddDet ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none -v \ --title "Uniswap v4 - Add Liquidity to a Pool" -v \ - 0xc639b3116391ae4d9ade0ba25bc87d690950c63405fc4d1b37e911f4d4f0b83b \ + 0x8a288170cf4f7f37e478597208843dda7fa2fcfe852dc94b5f4d9a36b0bfd278 \ -o dynamicFeeAddDetailed ``` -**Value Flow** +**Value Flows** ![Dynamic Fee Add Liquidity Value](./dynamicFeeAddValue.svg) ``` tx2uml value --configFile dynamicFee.config.json --chain none --onlyToken \ --title "Uniswap v4 - Add Liquidity to a Pool" -hf -hc -v \ - 0xc639b3116391ae4d9ade0ba25bc87d690950c63405fc4d1b37e911f4d4f0b83b \ + 0x8a288170cf4f7f37e478597208843dda7fa2fcfe852dc94b5f4d9a36b0bfd278 \ -o dynamicFeeAddValue ``` @@ -125,7 +127,7 @@ tx2uml value --configFile dynamicFee.config.json --chain none --onlyToken \ ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Remove Liquidity from a Pool" -hf -hc -x -l -p -g -t -v \ - 0xb78d396ea5f8825cb4a895593f084a577407d6c907bf8b33a846e4c341fbf17f -o dynamicFeeRemoveSummary + 0x8d14ff42b04de11964541401a5c13de22530e704e8a0661c7c00703ed3153c16 -o dynamicFeeRemoveSummary ``` See the full trace with parameters in [dynamicFeeRemoveDetailed.svg](./dynamicFeeRemoveDetailed.svg) @@ -133,10 +135,21 @@ See the full trace with parameters in [dynamicFeeRemoveDetailed.svg](./dynamicFe ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Remove Liquidity from a Pool" -v \ - 0xb78d396ea5f8825cb4a895593f084a577407d6c907bf8b33a846e4c341fbf17f \ + 0x8d14ff42b04de11964541401a5c13de22530e704e8a0661c7c00703ed3153c16 \ -o dynamicFeeRemoveDetailed ``` +**Value Flows** + +![Dynamic Fee Remove Liquidity Value](./dynamicFeeRemoveValue.svg) + +``` +tx2uml value --configFile dynamicFee.config.json --chain none --onlyToken \ + --title "Uniswap v4 - Remove Liquidity to a Pool" -hf -hc -v \ + 0x8d14ff42b04de11964541401a5c13de22530e704e8a0661c7c00703ed3153c16 \ + -o dynamicFeeRemoveValue +``` + ## Pool Manager ## Deposit tokens into the Pool Manager @@ -146,7 +159,7 @@ tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Deposit" -hf -hc -x -l -p -g -t -v \ - 0x3ab92865b020d566ce9bc52f42f4c96f196b9a0c4329cf74a27e32c1c9f5f352 \ + 0xbecdfe032eb2b73ff63d3406e9669e5270e85955a459a5f0d7f1cf1c61f85be2 \ -o depositSummary ``` @@ -155,10 +168,21 @@ See the full trace with parameters in [depositDetailed.svg](./depositDetailed.sv ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Deposit" -v \ - 0x3ab92865b020d566ce9bc52f42f4c96f196b9a0c4329cf74a27e32c1c9f5f352 \ + 0xbecdfe032eb2b73ff63d3406e9669e5270e85955a459a5f0d7f1cf1c61f85be2 \ -o depositDetailed ``` +**Value Flows** + +![Deposit Value Transfers](./depositValue.svg) + +``` +tx2uml value --configFile dynamicFee.config.json --chain none --onlyToken \ + --title "Uniswap v4 - Deposit Value Transfers" -hf -hc -v \ + 0xbecdfe032eb2b73ff63d3406e9669e5270e85955a459a5f0d7f1cf1c61f85be2 \ + -o depositValue +``` + ## Withdraw tokens from the Pool Manager ![Withdraw Summary](./withdrawSummary.svg) @@ -166,7 +190,7 @@ tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Withdraw" -hf -hc -x -l -p -g -t -v \ - 0x976339bbf4dfb4145af25029d34fd5a2d5919fa065ad4cb0e34d30907e91b940 \ + 0x96939ca613e425db4493a7b70a81056e1dadcf81023216b404a2adc7c4a3ff30 \ -o withdrawSummary ``` @@ -175,9 +199,19 @@ See the full trace with parameters in [withdrawDetailed.svg](./withdrawDetailed. ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Withdraw" -v \ - 0x81ef52fae7c0a4d2421c1caf2d018f45e6ef9c1c0c3a5a13b39a90b8445c8baa,0x976339bbf4dfb4145af25029d34fd5a2d5919fa065ad4cb0e34d30907e91b940 \ + 0x82da8e1120dcbc236d3b603db357923c8cc3691711a67fe259f3404c6ba23ad5,0x96939ca613e425db4493a7b70a81056e1dadcf81023216b404a2adc7c4a3ff30 \ -o withdrawDetailed ``` +**Value Flows** + +![Withdraw Value Transfers](./withdrawValue.svg) + +``` +tx2uml value --configFile dynamicFee.config.json --chain none --onlyToken \ + --title "Uniswap v4 - Withdraw Value Transfers" -hf -hc -v \ + 0x96939ca613e425db4493a7b70a81056e1dadcf81023216b404a2adc7c4a3ff30 \ + -o withdrawValue +``` ## Flash loan from the Pool Manager @@ -186,7 +220,7 @@ tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Flash Loan" -hf -hc -l -p -g -t -v \ - 0x26e858c200e5627685aee1bf16e9db98efb1a01ce8b7028218325a32e0d612a7 \ + 0x07f869c4a03292803b15b97cc812bb7cb05f6e587b84889c880da69671ec37d4 \ -o flashLoanSummary ``` @@ -195,7 +229,7 @@ See the full trace with parameters in [flashLoanDetailed.svg](./flashLoanDetaile ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Flash Loan" -v \ - 0x26e858c200e5627685aee1bf16e9db98efb1a01ce8b7028218325a32e0d612a7 \ + 0x07f869c4a03292803b15b97cc812bb7cb05f6e587b84889c880da69671ec37d4 \ -o flashLoanDetailed ``` @@ -206,7 +240,7 @@ tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Swap ERC1155 Tokens in the Pool Manager" -hf -hc -l -p -g -t -v \ - 0x7357f376a03cbdb2143bacdbdb3768e4c32e3432202921dc612a614eb574d691 \ + 0x0d9980ebc2c1a15ec8cd8100365829af3d5baa75fea4fef66315c1f9163f7abc \ -o swapPoolManagerTokensSummary ``` @@ -215,17 +249,17 @@ See the full trace with parameters in [swapPoolManagerTokensDetailed.svg](./swap ``` tx2uml --nodeType anvil --configFile dynamicFee.config.json --chain none \ --title "Uniswap v4 - Swap ERC1155 Tokens in the Pool Manager" -v \ - 0x7357f376a03cbdb2143bacdbdb3768e4c32e3432202921dc612a614eb574d691 \ + 0x0d9980ebc2c1a15ec8cd8100365829af3d5baa75fea4fef66315c1f9163f7abc \ -o swapPoolManagerTokensDetailed ``` - \ No newline at end of file +``` diff --git a/docs/depositDetailed.svg b/docs/depositDetailed.svg index d18a106..8481c10 100644 --- a/docs/depositDetailed.svg +++ b/docs/depositDetailed.svg @@ -1 +1 @@ -Uniswap v4 - Depositnone, block 5, Mon, 18 Sep 2023 22:50:25 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«token0»«TestERC20»0x9fe4..a6e0«token0»«TestERC20»0x9fe4..a6e0Nonce: 16Gas Price: 3.658192031 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 191,059Gas Used: 138,324Tx Fee: 0.001 ETHdeposit(token: 0x9fE4..a6e0,sender: 0xf39F..2266,recipient: 0xf39F..2266,amount: 6,,000,000,000,000,000,000)120,430 gas0xc443648c114,956 gasprocess(calls: [0: [target: 0x9fE4..a6e0,callType: ,results: false,value: 0,data: 0x23b872dd..ec580000],1: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0xc6c3bbe6..ec580000],2: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0]])106,021 gaslock(data: 0x00000000..00000000)95,220 gaslockAcquired(encodedCalls: 0x00000000..00000000)72,563 gastransferFrom(sender: 0xf39F..2266,recipient: 0xCf7E..0Fc9,amount: 6,,000,000,000,000,000,000)18,366 gastruemint(currency: 0x9fE4..a6e0,to: 0xf39F..2266,amount: 6,,000,000,000,000,000,000)50,441 gassettle(currency: 0x9fE4..a6e0)7,136 gasbalanceOf(0xCf7E..0Fc9)566 gas37,,125,499,066,867,325,885paid: 6,,000,000,000,000,000,000 6,570 gas0x00000000..ec580000result: 0x00000000..ec580000 22,657 gasresults: [0: 0x00000000..00000001,1: 0x,2: 0x00000000..ec580000] 10,801 gas 8,935 gasresults: [0: 0x00000000..00000001,1: 0x,2: 0x00000000..ec580000] 5,474 gasTransferSingle:operator: 0xDc64..F6C9,from: 0x0000..0000,to: 0xf39F..2266,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 6,,000,000,000,000,000,000Transfer:from: 0xf39F..2266,to: 0xCf7E..0Fc9,value: 6,,000,000,000,000,000,000 \ No newline at end of file +Uniswap v4 - Depositnone, block 8, Sun, 24 Sep 2023 01:02:28 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Token B»«MockToken»0x9fe4..a6e0«Token B»«MockToken»0x9fe4..a6e0Nonce: 18Gas Price: 3.46992129 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 191,306Gas Used: 138,503Tx Fee: 0 ETHdeposit(token: 0x9fE4..a6e0,sender: 0xf39F..2266,recipient: 0xf39F..2266,amount: 6,,000,000,000,000,000,000)120,608 gas0xc443648c115,135 gasprocess(calls: [0: [target: 0x9fE4..a6e0,callType: ,results: false,value: 0,data: 0x23b872dd..ec580000],1: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0xc6c3bbe6..ec580000],2: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0]])106,200 gaslock(data: 0x00000000..00000000)95,398 gaslockAcquired(encodedCalls: 0x00000000..00000000)72,699 gastransferFrom(from: 0xf39F..2266,to: 0x5FC8..5707,value: 6,,000,000,000,000,000,000)18,562 gastruemint(currency: 0x9fE4..a6e0,to: 0xf39F..2266,amount: 6,,000,000,000,000,000,000)50,419 gassettle(currency: 0x9fE4..a6e0)7,132 gasbalanceOf(account: 0x5FC8..5707)562 gas37,,125,499,066,867,325,885paid: 6,,000,000,000,000,000,000 6,570 gas0x00000000..ec580000result: 0x00000000..ec580000 22,699 gasresults: [0: 0x00000000..00000001,1: 0x,2: 0x00000000..ec580000] 10,802 gas 8,935 gasresults: [0: 0x00000000..00000001,1: 0x,2: 0x00000000..ec580000] 5,473 gasTransferSingle:operator: 0x0165..Eb8F,from: 0x0000..0000,to: 0xf39F..2266,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 6,,000,000,000,000,000,000Transfer:from: 0xf39F..2266,to: 0x5FC8..5707,value: 6,,000,000,000,000,000,000 \ No newline at end of file diff --git a/docs/depositSummary.svg b/docs/depositSummary.svg index 0ef59e7..b154739 100644 --- a/docs/depositSummary.svg +++ b/docs/depositSummary.svg @@ -1 +1 @@ -Uniswap v4 - Deposit0xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«token0»«TestERC20»0x9fe4..a6e0depositprocesslocklockAcquiredtransferFrommintsettlebalanceOf \ No newline at end of file +Uniswap v4 - Deposit0xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Token B»«MockToken»0x9fe4..a6e0depositprocesslocklockAcquiredtransferFrommintsettlebalanceOf \ No newline at end of file diff --git a/docs/depositValue.svg b/docs/depositValue.svg new file mode 100644 index 0000000..1e1cb92 --- /dev/null +++ b/docs/depositValue.svg @@ -0,0 +1 @@ +Uniswap v4 - Deposit Value Transfers0xf39F..2266«Uniswap v4 Core»«PoolManager»0x5FC8..5707Transfer 6.0 TOKBTransferSingle 6.0 TOKBin 0x5FC8..5707-6.0 TOKB+6.0 TOKBin 0x5FC8..5707+6.0 TOKB \ No newline at end of file diff --git a/docs/dynamicFee.config.json b/docs/dynamicFee.config.json index f0df969..abe6b98 100644 --- a/docs/dynamicFee.config.json +++ b/docs/dynamicFee.config.json @@ -123,10 +123,34 @@ ], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolManager", + "name": "poolManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startSalt", + "type": "uint256" + } + ], + "name": "mineSalt", + "outputs": [ + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" } ] }, - "0x3cB22f90D5c566246877a5e25605D04bd8ecB33E": { + "0x3C9226DB34834B44a707044E90B00aC8bD2b0434": { "contractName": "DynamicFeeHook", "abi": [ { @@ -224,6 +248,11 @@ "internalType": "uint256", "name": "", "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "afterDonate", @@ -285,6 +314,11 @@ "internalType": "int24", "name": "", "type": "int24" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "afterInitialize", @@ -363,6 +397,11 @@ "internalType": "BalanceDelta", "name": "delta", "type": "int256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "afterModifyPosition", @@ -441,6 +480,11 @@ "internalType": "BalanceDelta", "name": "delta", "type": "int256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "afterSwap", @@ -502,6 +546,11 @@ "internalType": "uint256", "name": "", "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "beforeDonate", @@ -558,6 +607,11 @@ "internalType": "uint160", "name": "", "type": "uint160" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "beforeInitialize", @@ -631,6 +685,11 @@ "internalType": "struct IPoolManager.ModifyPositionParams", "name": "params", "type": "tuple" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "beforeModifyPosition", @@ -704,6 +763,11 @@ "internalType": "struct IPoolManager.SwapParams", "name": "params", "type": "tuple" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "name": "beforeSwap", @@ -719,6 +783,11 @@ }, { "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, { "components": [ { @@ -750,6 +819,33 @@ "internalType": "struct PoolKey", "name": "key", "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "zeroForOne", + "type": "bool" + }, + { + "internalType": "int256", + "name": "amountSpecified", + "type": "int256" + }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + } + ], + "internalType": "struct IPoolManager.SwapParams", + "name": "params", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" } ], "name": "getFee", @@ -852,21 +948,119 @@ } ] }, - "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0": { - "contractName": "TestERC20", - "tokenName": "token0", + "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512": { + "contractName": "MockToken", + "tokenName": "Token A", + "tokenSymbol": "TOKA", + "decimals": "18", "abi": [ { "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, { "internalType": "uint256", - "name": "amountToMint", + "name": "initAmount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -921,12 +1115,12 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "owner", "type": "address" }, { "internalType": "address", - "name": "", + "name": "spender", "type": "address" } ], @@ -950,7 +1144,7 @@ }, { "internalType": "uint256", - "name": "amount", + "name": "value", "type": "uint256" } ], @@ -969,7 +1163,7 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "account", "type": "address" } ], @@ -985,33 +1179,67 @@ "type": "function" }, { - "inputs": [ + "inputs": [], + "name": "decimals", + "outputs": [ { - "internalType": "address", - "name": "to", - "type": "address" - }, + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ { "internalType": "uint256", - "name": "amount", + "name": "", "type": "uint256" } ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "recipient", + "name": "to", "type": "address" }, { "internalType": "uint256", - "name": "amount", + "name": "value", "type": "uint256" } ], @@ -1030,17 +1258,17 @@ "inputs": [ { "internalType": "address", - "name": "sender", + "name": "from", "type": "address" }, { "internalType": "address", - "name": "recipient", + "name": "to", "type": "address" }, { "internalType": "uint256", - "name": "amount", + "name": "value", "type": "uint256" } ], @@ -1057,21 +1285,119 @@ } ] }, - "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512": { - "contractName": "TestERC20", - "tokenName": "token1", + "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0": { + "contractName": "MockToken", + "tokenName": "Token B", + "tokenSymbol": "TOKB", + "decimals": "18", "abi": [ { "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, { "internalType": "uint256", - "name": "amountToMint", + "name": "initAmount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -1126,12 +1452,12 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "owner", "type": "address" }, { "internalType": "address", - "name": "", + "name": "spender", "type": "address" } ], @@ -1155,7 +1481,7 @@ }, { "internalType": "uint256", - "name": "amount", + "name": "value", "type": "uint256" } ], @@ -1174,7 +1500,7 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "account", "type": "address" } ], @@ -1190,33 +1516,67 @@ "type": "function" }, { - "inputs": [ + "inputs": [], + "name": "decimals", + "outputs": [ { - "internalType": "address", - "name": "to", - "type": "address" - }, + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ { "internalType": "uint256", - "name": "amount", + "name": "", "type": "uint256" } ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "recipient", + "name": "to", "type": "address" }, { "internalType": "uint256", - "name": "amount", + "name": "value", "type": "uint256" } ], @@ -1235,17 +1595,17 @@ "inputs": [ { "internalType": "address", - "name": "sender", + "name": "from", "type": "address" }, { "internalType": "address", - "name": "recipient", + "name": "to", "type": "address" }, { "internalType": "uint256", - "name": "amount", + "name": "value", "type": "uint256" } ], @@ -1262,7 +1622,7 @@ } ] }, - "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9": { + "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707": { "contractName": "PoolManager", "tokenName": "Uniswap v4 Core", "abi": [ @@ -1629,15 +1989,9 @@ }, { "indexed": false, - "internalType": "uint8", - "name": "hookSwapFee", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "hookWithdrawFee", - "type": "uint8" + "internalType": "uint24", + "name": "hookFees", + "type": "uint24" } ], "name": "HookFeeUpdated", @@ -1766,15 +2120,9 @@ }, { "indexed": false, - "internalType": "uint8", - "name": "protocolSwapFee", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "protocolWithdrawFee", - "type": "uint8" + "internalType": "uint24", + "name": "protocolFees", + "type": "uint24" } ], "name": "ProtocolFeeUpdated", @@ -2140,6 +2488,11 @@ "internalType": "uint256", "name": "amount1", "type": "uint256" + }, + { + "internalType": "bytes", + "name": "hookData", + "type": "bytes" } ], "name": "donate", @@ -2340,24 +2693,14 @@ "type": "int24" }, { - "internalType": "uint8", - "name": "protocolSwapFee", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "protocolWithdrawFee", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "hookSwapFee", - "type": "uint8" + "internalType": "uint24", + "name": "protocolFees", + "type": "uint24" }, { - "internalType": "uint8", - "name": "hookWithdrawFee", - "type": "uint8" + "internalType": "uint24", + "name": "hookFees", + "type": "uint24" } ], "stateMutability": "view", @@ -2425,6 +2768,11 @@ "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" + }, + { + "internalType": "bytes", + "name": "hookData", + "type": "bytes" } ], "name": "initialize", @@ -2577,6 +2925,11 @@ "internalType": "struct IPoolManager.ModifyPositionParams", "name": "params", "type": "tuple" + }, + { + "internalType": "bytes", + "name": "hookData", + "type": "bytes" } ], "name": "modifyPosition", @@ -2704,24 +3057,14 @@ "type": "int24" }, { - "internalType": "uint8", - "name": "protocolSwapFee", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "protocolWithdrawFee", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "hookSwapFee", - "type": "uint8" + "internalType": "uint24", + "name": "protocolFees", + "type": "uint24" }, { - "internalType": "uint8", - "name": "hookWithdrawFee", - "type": "uint8" + "internalType": "uint24", + "name": "hookFees", + "type": "uint24" } ], "internalType": "struct Pool.Slot0", @@ -3081,6 +3424,11 @@ "internalType": "struct IPoolManager.SwapParams", "name": "params", "type": "tuple" + }, + { + "internalType": "bytes", + "name": "hookData", + "type": "bytes" } ], "name": "swap", @@ -3142,7 +3490,7 @@ } ] }, - "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9": { + "0x0165878A594ca255338adfa4d48449f69242Eb8F": { "contractName": "UniswapV4Router", "abi": [ { @@ -3341,7 +3689,7 @@ } ] }, - "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707": { + "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853": { "contractName": "UniswapV4Caller", "abi": [ { @@ -3839,7 +4187,7 @@ } ] }, - "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c": { + "0x59b670e9fA9D0A427751Af201D676719a970857b": { "contractName": "FlashLoanLogic", "abi": [ { diff --git a/docs/dynamicFeeAddDetailed.svg b/docs/dynamicFeeAddDetailed.svg index bfba18a..cb8ab08 100644 --- a/docs/dynamicFeeAddDetailed.svg +++ b/docs/dynamicFeeAddDetailed.svg @@ -1 +1 @@ -Uniswap v4 - Add Liquidity to a Poolnone, block 5, Mon, 18 Sep 2023 22:50:25 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0«token0»«TestERC20»0x9fe4..a6e0«token1»«TestERC20»0xe7f1..0512«token1»«TestERC20»0xe7f1..0512Nonce: 13Gas Price: 3.658192031 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 498,880Gas Used: 361,181Tx Fee: 0.001 ETHaddLiquidity(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],sender: 0xf39F..2266,tickLower: -887220,tickUpper: 887,220,liquidityAmount: 30,,000,000,000,000,000,000)337,477 gas0xb4fda173328,025 gasprocess(calls: [0: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x555a4733..9db80000],1: [target: 0x5FC8..5707,callType: 1,results: true,value: 0,data: 0xd04380f7..00000000],2: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0],3: [target: 0x5FC8..5707,callType: 1,results: true,value: 0,data: 0xd04380f7..00000000],4: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x6a256b29..bb3f0512]])308,597 gaslock(data: 0x00000000..00000000)288,644 gaslockAcquired(encodedCalls: 0x00000000..00000000)279,320 gasmodifyPosition(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000])204,670 gasbeforeModifyPosition(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000])560 gasselector: 0x0dbe5dbdafterModifyPosition(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000],delta: 10,208,471,007,628,153,903,560,955,856,032,107,880,246,,625,392,568,231,788,543)605 gasselector: 0x0e2059f5delta: 10,208,471,007,628,153,903,560,955,856,032,107,880,246,,625,392,568,231,788,543 203,505 gasremoveSelector(data: 0xd04380f7..00000000)1,638 gasremainingData: 0x00000000..00000000addLiquidityCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)29,593 gasaddLiquidityCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)26,373 gastransferFrom(sender: 0xf39F..2266,recipient: 0xCf7E..0Fc9,amount: 29,,999,999,999,999,999,999)18,366 gastrue 8,007 gas 3,220 gassettle(currency: 0x9fE4..a6e0)7,136 gasbalanceOf(0xCf7E..0Fc9)566 gas30,,149,588,304,769,301,061paid: 29,,999,999,999,999,999,999 6,570 gasremoveSelector(data: 0xd04380f7..00000000)1,638 gasremainingData: 0x00000000..00000000addLiquidityCallback(callData: 0x00000000..00000000,resultData: 0x00000000..00000000)29,736 gasaddLiquidityCallback(callData: 0x00000000..00000000,resultData: 0x00000000..00000000)26,440 gastransferFrom(sender: 0xf39F..2266,recipient: 0xCf7E..0Fc9,amount: 29,,999,999,999,999,999,999)18,366 gastrue 8,074 gas 3,296 gassettle(currency: 0xe7f1..0512)7,136 gasbalanceOf(0xCf7E..0Fc9)566 gas30,,149,588,304,769,301,061paid: 29,,999,999,999,999,999,999 6,570 gas0x00000000..9db7ffffresult: 0x00000000..9db7ffff 9,324 gasresults: [0: 0x00000000..9db7ffff,1: 0x,2: 0x00000000..9db7ffff,3: 0x,4: 0x00000000..9db7ffff] 19,953 gas 19,428 gasresults: [0: 0x00000000..9db7ffff,1: 0x,2: 0x00000000..9db7ffff,3: 0x,4: 0x00000000..9db7ffff] 9,452 gasModifyPosition:id: 0xf49e1fc4..ade8fcab,sender: 0xDc64..F6C9,tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000Transfer:from: 0xf39F..2266,to: 0xCf7E..0Fc9,value: 29,,999,999,999,999,999,999Transfer:from: 0xf39F..2266,to: 0xCf7E..0Fc9,value: 29,,999,999,999,999,999,999 \ No newline at end of file +Uniswap v4 - Add Liquidity to a Poolnone, block 7, Sun, 24 Sep 2023 01:02:27 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0«Token B»«MockToken»0x9fe4..a6e0«Token A»«MockToken»0xe7f1..0512«Token A»«MockToken»0xe7f1..0512Nonce: 15Gas Price: 3.504777049 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 502,164Gas Used: 363,558Tx Fee: 0.001 ETHaddLiquidity(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],sender: 0xf39F..2266,tickLower: -887220,tickUpper: 887,220,liquidityAmount: 30,,000,000,000,000,000,000)339,854 gas0xb4fda173330,402 gasprocess(calls: [0: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x61ae449a..00000000],1: [target: 0xa513..C853,callType: 1,results: true,value: 0,data: 0xd04380f7..00000000],2: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0],3: [target: 0xa513..C853,callType: 1,results: true,value: 0,data: 0xd04380f7..00000000],4: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x6a256b29..bb3f0512]])310,578 gaslock(data: 0x00000000..00000000)290,471 gaslockAcquired(encodedCalls: 0x00000000..00000000)281,082 gasmodifyPosition(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000],hookData: 0x)205,900 gasbeforeModifyPosition(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000],0x)925 gasselector: 0xfe9a6f45afterModifyPosition(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000],delta: 10,208,471,007,628,153,903,560,955,856,032,107,880,246,,625,392,568,231,788,543,0x)863 gasselector: 0x30b7cdefdelta: 10,208,471,007,628,153,903,560,955,856,032,107,880,246,,625,392,568,231,788,543 204,112 gasremoveSelector(data: 0xd04380f7..00000000)1,638 gasremainingData: 0x00000000..00000000addLiquidityCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)29,789 gasaddLiquidityCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)26,569 gastransferFrom(from: 0xf39F..2266,to: 0x5FC8..5707,value: 29,,999,999,999,999,999,999)18,562 gastrue 8,007 gas 3,220 gassettle(currency: 0x9fE4..a6e0)7,132 gasbalanceOf(account: 0x5FC8..5707)562 gas30,,149,588,304,769,301,061paid: 29,,999,999,999,999,999,999 6,570 gasremoveSelector(data: 0xd04380f7..00000000)1,638 gasremainingData: 0x00000000..00000000addLiquidityCallback(callData: 0x00000000..00000000,resultData: 0x00000000..00000000)29,932 gasaddLiquidityCallback(callData: 0x00000000..00000000,resultData: 0x00000000..00000000)26,636 gastransferFrom(from: 0xf39F..2266,to: 0x5FC8..5707,value: 29,,999,999,999,999,999,999)18,562 gastrue 8,074 gas 3,296 gassettle(currency: 0xe7f1..0512)7,132 gasbalanceOf(account: 0x5FC8..5707)562 gas30,,149,588,304,769,301,061paid: 29,,999,999,999,999,999,999 6,570 gas0x00000000..9db7ffffresult: 0x00000000..9db7ffff 9,389 gasresults: [0: 0x00000000..9db7ffff,1: 0x,2: 0x00000000..9db7ffff,3: 0x,4: 0x00000000..9db7ffff] 20,107 gas 19,824 gasresults: [0: 0x00000000..9db7ffff,1: 0x,2: 0x00000000..9db7ffff,3: 0x,4: 0x00000000..9db7ffff] 9,452 gasModifyPosition:id: 0x0509f27e..72fb7633,sender: 0x0165..Eb8F,tickLower: -887220,tickUpper: 887,220,liquidityDelta: 30,,000,000,000,000,000,000Transfer:from: 0xf39F..2266,to: 0x5FC8..5707,value: 29,,999,999,999,999,999,999Transfer:from: 0xf39F..2266,to: 0x5FC8..5707,value: 29,,999,999,999,999,999,999 \ No newline at end of file diff --git a/docs/dynamicFeeAddSummary.svg b/docs/dynamicFeeAddSummary.svg index e7dc554..0bcdc80 100644 --- a/docs/dynamicFeeAddSummary.svg +++ b/docs/dynamicFeeAddSummary.svg @@ -1 +1 @@ -Uniswap v4 - Remove Liquidity to a Pool0xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0«token1»«TestERC20»0xe7f1..0512addLiquidityprocesslocklockAcquiredmodifyPositionbeforeModifyPositionafterModifyPositiontransferFromsettlebalanceOftransferFromsettlebalanceOf \ No newline at end of file +Uniswap v4 - Remove Liquidity to a Pool0xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0«Token A»«MockToken»0xe7f1..0512addLiquidityprocesslocklockAcquiredmodifyPositionbeforeModifyPositionafterModifyPositiontransferFromsettlebalanceOftransferFromsettlebalanceOf \ No newline at end of file diff --git a/docs/dynamicFeeAddValue.svg b/docs/dynamicFeeAddValue.svg index d49d902..21d24d9 100644 --- a/docs/dynamicFeeAddValue.svg +++ b/docs/dynamicFeeAddValue.svg @@ -1 +1 @@ -Uniswap v4 - Add Liquidity to a Pool0xf39F..2266«Uniswap v4 Core»«PoolManager»0xCf7E..0Fc9Transfer 29,999,999,999,999,999,999Transfer 29,999,999,999,999,999,999-29,999,999,999,999,999,999-29,999,999,999,999,999,99929,999,999,999,999,999,99929,999,999,999,999,999,999 \ No newline at end of file +Uniswap v4 - Add Liquidity to a Pool0xf39F..2266«Uniswap v4 Core»«PoolManager»0x5FC8..5707Transfer 29.999999999999999999 TOKBTransfer 29.999999999999999999 TOKA-29.999999999999999999 TOKB-29.999999999999999999 TOKA+29.999999999999999999 TOKB+29.999999999999999999 TOKA \ No newline at end of file diff --git a/docs/dynamicFeeRemoveDetailed.svg b/docs/dynamicFeeRemoveDetailed.svg index d79e91d..a2a5b05 100644 --- a/docs/dynamicFeeRemoveDetailed.svg +++ b/docs/dynamicFeeRemoveDetailed.svg @@ -1 +1 @@ -Uniswap v4 - Remove Liquidity from a Poolnone, block 5, Mon, 18 Sep 2023 22:50:25 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0«token0»«TestERC20»0x9fe4..a6e0«token1»«TestERC20»0xe7f1..0512«token1»«TestERC20»0xe7f1..0512Nonce: 15Gas Price: 3.658192031 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 270,489Gas Used: 195,830Tx Fee: 0.001 ETHremoveLiquidity(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],recipient: 0xf39F..2266,tickLower: -60,tickUpper: 60,liquidityAmount: 4,,000,000,000,000,000,000)172,162 gas0x948d97fc165,365 gasprocess(calls: [0: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x555a4733..62700000],1: [target: 0x5FC8..5707,callType: 1,results: true,value: 0,data: 0xd992e10f..00000000]])154,661 gaslock(data: 0x00000000..00000000)145,408 gaslockAcquired(encodedCalls: 0x00000000..00000000)133,943 gasmodifyPosition(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000])92,585 gasbeforeModifyPosition(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000])560 gasselector: 0x0dbe5dbdafterModifyPosition(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000],delta: -8197142890605694701995120405752706867029739591230816256)605 gasselector: 0x0e2059f5delta: -8197142890605694701995120405752706867029739591230816256 91,420 gasremoveSelector(data: 0xd992e10f..00000000)1,638 gasremainingData: 0x00000000..00000000removeLiquidityCallback(callData: 0x00000000..ffb92266,resultData: 0x00000000..00000000)35,742 gasremoveLiquidityCallback(callData: 0x00000000..ffb92266,resultData: 0x00000000..00000000)33,551 gastake(currency: 0x9fE4..a6e0,to: 0xf39F..2266,amount: 24,089,237,901,975,176)18,856 gastransfer(recipient: 0xf39F..2266,amount: 24,089,237,901,975,176)12,877 gastrue 5,979 gastake(currency: 0xe7f1..0512,to: 0xf39F..2266,amount: 0)13,726 gastransfer(recipient: 0xf39F..2266,amount: 0)7,277 gastrue 6,449 gas 969 gas 2,191 gas0x00000000..00000000 3,978 gasresult: 0x00000000..00000000 11,465 gasresults: [0: 0xffffffff..00000000,1: 0x] 9,253 gas 10,704 gasresults: [0: 0xffffffff..00000000,1: 0x] 6,797 gasModifyPosition:id: 0xf49e1fc4..ade8fcab,sender: 0xDc64..F6C9,tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000Transfer:from: 0xCf7E..0Fc9,to: 0xf39F..2266,value: 24,089,237,901,975,176Transfer:from: 0xCf7E..0Fc9,to: 0xf39F..2266,value: 0 \ No newline at end of file +Uniswap v4 - Remove Liquidity from a Poolnone, block 8, Sun, 24 Sep 2023 01:02:28 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0«Token B»«MockToken»0x9fe4..a6e0«Token A»«MockToken»0xe7f1..0512«Token A»«MockToken»0xe7f1..0512Nonce: 17Gas Price: 3.46992129 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 289,343Gas Used: 197,842Tx Fee: 0.001 ETHremoveLiquidity(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],recipient: 0xf39F..2266,tickLower: -60,tickUpper: 60,liquidityAmount: 4,,000,000,000,000,000,000)174,174 gas0x948d97fc167,377 gasprocess(calls: [0: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x61ae449a..00000000],1: [target: 0xa513..C853,callType: 1,results: true,value: 0,data: 0xd992e10f..00000000]])155,955 gaslock(data: 0x00000000..00000000)146,579 gaslockAcquired(encodedCalls: 0x00000000..00000000)135,342 gasmodifyPosition(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000],hookData: 0x)93,815 gasbeforeModifyPosition(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000],0x)925 gasselector: 0xfe9a6f45afterModifyPosition(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000],delta: -8197142890605694701995120405752706867029739591230816256,0x)863 gasselector: 0x30b7cdefdelta: -8197142890605694701995120405752706867029739591230816256 92,027 gasremoveSelector(data: 0xd992e10f..00000000)1,638 gasremainingData: 0x00000000..00000000removeLiquidityCallback(callData: 0x00000000..ffb92266,resultData: 0x00000000..00000000)35,760 gasremoveLiquidityCallback(callData: 0x00000000..ffb92266,resultData: 0x00000000..00000000)33,568 gastake(currency: 0x9fE4..a6e0,to: 0xf39F..2266,amount: 24,089,237,901,975,176)18,865 gastransfer(to: 0xf39F..2266,value: 24,089,237,901,975,176)12,888 gastrue 5,977 gastake(currency: 0xe7f1..0512,to: 0xf39F..2266,amount: 0)13,737 gastransfer(to: 0xf39F..2266,value: 0)7,288 gastrue 6,449 gas 966 gas 2,192 gas0x00000000..00000000 4,129 gasresult: 0x00000000..00000000 11,237 gasresults: [0: 0xffffffff..00000000,1: 0x] 9,376 gas 11,422 gasresults: [0: 0xffffffff..00000000,1: 0x] 6,797 gasModifyPosition:id: 0x0509f27e..72fb7633,sender: 0x0165..Eb8F,tickLower: -60,tickUpper: 60,liquidityDelta: -4000000000000000000Transfer:from: 0x5FC8..5707,to: 0xf39F..2266,value: 24,089,237,901,975,176Transfer:from: 0x5FC8..5707,to: 0xf39F..2266,value: 0 \ No newline at end of file diff --git a/docs/dynamicFeeRemoveSummary.svg b/docs/dynamicFeeRemoveSummary.svg index 7421058..6462c48 100644 --- a/docs/dynamicFeeRemoveSummary.svg +++ b/docs/dynamicFeeRemoveSummary.svg @@ -1 +1 @@ -Uniswap v4 - Remove Liquidity from a Pool0xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0«token1»«TestERC20»0xe7f1..0512removeLiquidityprocesslocklockAcquiredmodifyPositionbeforeModifyPositionafterModifyPositiontaketransfertaketransfer \ No newline at end of file +Uniswap v4 - Remove Liquidity from a Pool0xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0«Token A»«MockToken»0xe7f1..0512removeLiquidityprocesslocklockAcquiredmodifyPositionbeforeModifyPositionafterModifyPositiontaketransfertaketransfer \ No newline at end of file diff --git a/docs/dynamicFeeRemoveValue.svg b/docs/dynamicFeeRemoveValue.svg new file mode 100644 index 0000000..65acf4d --- /dev/null +++ b/docs/dynamicFeeRemoveValue.svg @@ -0,0 +1 @@ +Uniswap v4 - Remove Liquidity to a Pool«Uniswap v4 Core»«PoolManager»0x5FC8..57070xf39F..2266Transfer 0.024089237901975176 TOKBTransfer 0.0 TOKA-0.024089237901975176 TOKB+0.024089237901975176 TOKB \ No newline at end of file diff --git a/docs/dynamicFeeSwapDetailed.svg b/docs/dynamicFeeSwapDetailed.svg index 6fedaa7..d129fd2 100644 --- a/docs/dynamicFeeSwapDetailed.svg +++ b/docs/dynamicFeeSwapDetailed.svg @@ -1 +1 @@ -Uniswap v4 - Swap Tokensnone, block 5, Mon, 18 Sep 2023 22:50:25 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0«token0»«TestERC20»0x9fe4..a6e0«token1»«TestERC20»0xe7f1..0512«token1»«TestERC20»0xe7f1..0512Nonce: 14Gas Price: 3.658192031 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 415,561Gas Used: 300,860Tx Fee: 0.001 ETHswap(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],swapper: 0xf39F..2266,recipient: 0xf39F..2266,fromCurrency: 0x9fE4..a6e0,swapAmount: 1,,000,000,000,000,000,000)277,108 gas0xa8b8b938268,442 gasprocess(calls: [0: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x1e2817de..000276a4],1: [target: 0x9fE4..a6e0,callType: ,results: false,value: 0,data: 0x23b872dd..a7640000],2: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0],3: [target: 0x5FC8..5707,callType: 1,results: true,value: 0,data: 0x629881ce..00000000]])251,980 gaslock(data: 0x00000000..00000000)235,676 gaslockAcquired(encodedCalls: 0x00000000..00000000)225,932 gasswap(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [zeroForOne: true,amountSpecified: 1,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740])180,027 gasbeforeSwap(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [zeroForOne: true,amountSpecified: 1,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740])625 gasselector: 0xb3f97f80getFee(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E])468 gasfee: 3,000afterSwap(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [zeroForOne: true,amountSpecified: 1,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],delta: 340,282,366,920,938,463,803,656,974,352,706,674,918,,401,652,799,454,293,730)604 gasselector: 0xa5aa370adelta: 340,282,366,920,938,463,803,656,974,352,706,674,918,,401,652,799,454,293,730 178,330 gastransferFrom(sender: 0xf39F..2266,recipient: 0xCf7E..0Fc9,amount: 1,,000,000,000,000,000,000)18,366 gastruesettle(currency: 0x9fE4..a6e0)7,136 gasbalanceOf(0xCf7E..0Fc9)566 gas31,,149,588,304,769,301,061paid: 1,,000,000,000,000,000,000 6,570 gasremoveSelector(data: 0x629881ce..00000000)1,638 gasremainingData: 0x00000000..00000000swapCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)25,600 gasswapCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)23,024 gastake(currency: 0xe7f1..0512,to: 0xf39F..2266,amount: 972,954,632,313,917,726)18,856 gastransfer(recipient: 0xf39F..2266,amount: 972,954,632,313,917,726)12,877 gastrue 5,979 gas 4,168 gas 2,576 gas0x00000000..00000000result: 0x00000000..00000000 9,744 gasresults: [0: 0x00000000..b65baee2,1: 0x00000000..00000001,2: 0x00000000..a7640000,3: 0x] 16,304 gas 16,462 gasresults: [0: 0x00000000..b65baee2,1: 0x00000000..00000001,2: 0x00000000..a7640000,3: 0x] 8,666 gasSwap:id: 0xf49e1fc4..ade8fcab,sender: 0xDc64..F6C9,amount0: 1,,000,000,000,000,000,000,amount1: -972954632313917726,sqrtPriceX96: 77,053,702,474,,015,074,578,386,241,425,liquidity: 30,,000,000,000,000,000,000,tick: -557,fee: 3,000Transfer:from: 0xf39F..2266,to: 0xCf7E..0Fc9,value: 1,,000,000,000,000,000,000Transfer:from: 0xCf7E..0Fc9,to: 0xf39F..2266,value: 972,954,632,313,917,726 \ No newline at end of file +Uniswap v4 - Swap Tokensnone, block 8, Sun, 24 Sep 2023 01:02:28 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0«Token B»«MockToken»0x9fe4..a6e0«Token A»«MockToken»0xe7f1..0512«Token A»«MockToken»0xe7f1..0512Nonce: 16Gas Price: 3.46992129 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 443,992Gas Used: 303,585Tx Fee: 0.001 ETHswap(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],swapper: 0xf39F..2266,recipient: 0xf39F..2266,fromCurrency: 0x9fE4..a6e0,swapAmount: 1,,000,000,000,000,000,000)279,833 gas0xa8b8b938271,167 gasprocess(calls: [0: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0xf3cd914c..00000000],1: [target: 0x9fE4..a6e0,callType: ,results: false,value: 0,data: 0x23b872dd..a7640000],2: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0],3: [target: 0xa513..C853,callType: 1,results: true,value: 0,data: 0x629881ce..00000000]])254,308 gaslock(data: 0x00000000..00000000)237,415 gaslockAcquired(encodedCalls: 0x00000000..00000000)228,040 gasswap(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 1,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],hookData: 0x)181,785 gasbeforeSwap(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 1,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],0x)882 gasselector: 0x575e24b4getFee(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 1,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],data: 0x)784 gasfee: 3,000afterSwap(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 1,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],delta: 340,282,366,920,938,463,803,656,974,352,706,674,918,,401,652,799,454,293,730,0x)862 gasselector: 0xb47b2fb1delta: 340,282,366,920,938,463,803,656,974,352,706,674,918,,401,652,799,454,293,730 179,257 gastransferFrom(from: 0xf39F..2266,to: 0x5FC8..5707,value: 1,,000,000,000,000,000,000)18,562 gastruesettle(currency: 0x9fE4..a6e0)7,132 gasbalanceOf(account: 0x5FC8..5707)562 gas31,,149,588,304,769,301,061paid: 1,,000,000,000,000,000,000 6,570 gasremoveSelector(data: 0x629881ce..00000000)1,638 gasremainingData: 0x00000000..00000000swapCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)25,609 gasswapCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)23,033 gastake(currency: 0xe7f1..0512,to: 0xf39F..2266,amount: 972,954,632,313,917,726)18,865 gastransfer(to: 0xf39F..2266,value: 972,954,632,313,917,726)12,888 gastrue 5,977 gas 4,168 gas 2,576 gas0x00000000..00000000result: 0x00000000..00000000 9,375 gasresults: [0: 0x00000000..b65baee2,1: 0x00000000..00000001,2: 0x00000000..a7640000,3: 0x] 16,893 gas 16,859 gasresults: [0: 0x00000000..b65baee2,1: 0x00000000..00000001,2: 0x00000000..a7640000,3: 0x] 8,666 gasSwap:id: 0x0509f27e..72fb7633,sender: 0x0165..Eb8F,amount0: 1,,000,000,000,000,000,000,amount1: -972954632313917726,sqrtPriceX96: 77,053,702,474,,015,074,578,386,241,425,liquidity: 30,,000,000,000,000,000,000,tick: -557,fee: 3,000Transfer:from: 0xf39F..2266,to: 0x5FC8..5707,value: 1,,000,000,000,000,000,000Transfer:from: 0x5FC8..5707,to: 0xf39F..2266,value: 972,954,632,313,917,726 \ No newline at end of file diff --git a/docs/dynamicFeeSwapSummary.svg b/docs/dynamicFeeSwapSummary.svg index 0a35cd0..b463c67 100644 --- a/docs/dynamicFeeSwapSummary.svg +++ b/docs/dynamicFeeSwapSummary.svg @@ -1 +1 @@ -Uniswap v4 - Swap Tokens0xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0«token1»«TestERC20»0xe7f1..0512swapprocesslocklockAcquiredswapbeforeSwapgetFeeafterSwaptransferFromsettlebalanceOftaketransfer \ No newline at end of file +Uniswap v4 - Swap Tokens0xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0«Token A»«MockToken»0xe7f1..0512swapprocesslocklockAcquiredswapbeforeSwapgetFeeafterSwaptransferFromsettlebalanceOftaketransfer \ No newline at end of file diff --git a/docs/dynamicFeeSwapValue.svg b/docs/dynamicFeeSwapValue.svg index e716d4c..b609f20 100644 --- a/docs/dynamicFeeSwapValue.svg +++ b/docs/dynamicFeeSwapValue.svg @@ -1 +1 @@ -Uniswap v4 - Swap Tokens0xf39F..2266«Uniswap v4 Core»«PoolManager»0xCf7E..0Fc9Transfer 1,000,000,000,000,000,000Transfer 972,954,632,313,917,726-1,000,000,000,000,000,000972,954,632,313,917,7261,000,000,000,000,000,000-972,954,632,313,917,726 \ No newline at end of file +Uniswap v4 - Swap Tokens0xf39F..2266«Uniswap v4 Core»«PoolManager»0x5FC8..5707Transfer 1.0 TOKBTransfer 0.972954632313917726 TOKA-1.0 TOKB+0.972954632313917726 TOKA+1.0 TOKB-0.972954632313917726 TOKA \ No newline at end of file diff --git a/docs/flashLoanDetailed.svg b/docs/flashLoanDetailed.svg index 769a05f..85aac4f 100644 --- a/docs/flashLoanDetailed.svg +++ b/docs/flashLoanDetailed.svg @@ -1 +1 @@ -Uniswap v4 - Flash Loannone, block 6, Mon, 18 Sep 2023 22:50:26 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«token0»«TestERC20»0x9fe4..a6e0«token0»«TestERC20»0x9fe4..a6e0«FlashLoanLogic»0x3aa5..443c«FlashLoanLogic»0x3aa5..443cNonce: 20Gas Price: 3.586031143 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 193,286Gas Used: 139,936Tx Fee: 0.001 ETHflashLoan(token: 0x9fE4..a6e0,amount: 10,000,000,000,000,callbackTarget: 0x3Aa5..443c,callbackType: 1,callbackData: 0x756fd550..4e72a000)121,424 gas0x39fe6b71115,072 gasprocess(calls: [0: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x0b0d9c09..4e72a000],1: [target: 0x3Aa5..443c,callType: 1,results: false,value: 0,data: 0x756fd550..4e72a000],2: [target: 0x9fE4..a6e0,callType: ,results: false,value: 0,data: 0xa9059cbb..4e72a000],3: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0]])104,444 gaslock(data: 0x00000000..00000000)91,662 gaslockAcquired(encodedCalls: 0x00000000..00000000)68,742 gastake(currency: 0x9fE4..a6e0,to: 0xDc64..F6C9,amount: 10,000,000,000,000)62,579 gastransfer(recipient: 0xDc64..F6C9,amount: 10,000,000,000,000)29,977 gastrue 32,602 gasflashLoanCallback(token: 0x9fE4..a6e0,amount: 10,000,000,000,000)293 gastransfer(recipient: 0xCf7E..0Fc9,amount: 10,000,000,000,000)2,622 gastruesettle(currency: 0x9fE4..a6e0)3,296 gasbalanceOf(0xCf7E..0Fc9)566 gas33,,125,499,066,867,325,885paid: 10,000,000,000,000 2,730 gas0x00000000..4e72a000result: 0x00000000..4e72a000 22,920 gasresults: [0: 0x,1: 0x,2: 0x00000000..00000001,3: 0x00000000..4e72a000] 12,782 gas 10,628 gasresults: [0: 0x,1: 0x,2: 0x00000000..00000001,3: 0x00000000..4e72a000] 6,352 gasTransfer:from: 0xCf7E..0Fc9,to: 0xDc64..F6C9,value: 10,000,000,000,000Transfer:from: 0xDc64..F6C9,to: 0xCf7E..0Fc9,value: 10,000,000,000,000 \ No newline at end of file +Uniswap v4 - Flash Loannone, block 8, Sun, 24 Sep 2023 01:02:28 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Token B»«MockToken»0x9fe4..a6e0«Token B»«MockToken»0x9fe4..a6e0«FlashLoanLogic»0x59b6..857b«FlashLoanLogic»0x59b6..857bNonce: 22Gas Price: 3.46992129 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 204,739Gas Used: 139,993Tx Fee: 0 ETHflashLoan(token: 0x9fE4..a6e0,amount: 10,000,000,000,000,callbackTarget: 0x59b6..857b,callbackType: 1,callbackData: 0x756fd550..4e72a000)121,481 gas0x39fe6b71115,129 gasprocess(calls: [0: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x0b0d9c09..4e72a000],1: [target: 0x59b6..857b,callType: 1,results: false,value: 0,data: 0x756fd550..4e72a000],2: [target: 0x9fE4..a6e0,callType: ,results: false,value: 0,data: 0xa9059cbb..4e72a000],3: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0]])104,500 gaslock(data: 0x00000000..00000000)91,719 gaslockAcquired(encodedCalls: 0x00000000..00000000)68,756 gastake(currency: 0x9fE4..a6e0,to: 0x0165..Eb8F,amount: 10,000,000,000,000)62,590 gastransfer(to: 0x0165..Eb8F,value: 10,000,000,000,000)29,988 gastrue 32,602 gasflashLoanCallback(token: 0x9fE4..a6e0,amount: 10,000,000,000,000)293 gastransfer(to: 0x5FC8..5707,value: 10,000,000,000,000)2,631 gastruesettle(currency: 0x9fE4..a6e0)3,292 gasbalanceOf(account: 0x5FC8..5707)562 gas33,,125,499,066,867,325,885paid: 10,000,000,000,000 2,730 gas0x00000000..4e72a000result: 0x00000000..4e72a000 22,963 gasresults: [0: 0x,1: 0x,2: 0x00000000..00000001,3: 0x00000000..4e72a000] 12,781 gas 10,629 gasresults: [0: 0x,1: 0x,2: 0x00000000..00000001,3: 0x00000000..4e72a000] 6,352 gasTransfer:from: 0x5FC8..5707,to: 0x0165..Eb8F,value: 10,000,000,000,000Transfer:from: 0x0165..Eb8F,to: 0x5FC8..5707,value: 10,000,000,000,000 \ No newline at end of file diff --git a/docs/flashLoanSummary.svg b/docs/flashLoanSummary.svg index 1589da9..896cdcf 100644 --- a/docs/flashLoanSummary.svg +++ b/docs/flashLoanSummary.svg @@ -1 +1 @@ -Uniswap v4 - Flash Loan0xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«token0»«TestERC20»0x9fe4..a6e0«FlashLoanLogic»0x3aa5..443cflashLoan0x39fe6b71processlocklockAcquiredtaketransferflashLoanCallbacktransfersettlebalanceOf \ No newline at end of file +Uniswap v4 - Flash Loan0xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Token B»«MockToken»0x9fe4..a6e0«FlashLoanLogic»0x59b6..857bflashLoan0x39fe6b71processlocklockAcquiredtaketransferflashLoanCallbacktransfersettlebalanceOf \ No newline at end of file diff --git a/docs/swapPoolManagerTokensDetailed.svg b/docs/swapPoolManagerTokensDetailed.svg index 6ca383c..e818bac 100644 --- a/docs/swapPoolManagerTokensDetailed.svg +++ b/docs/swapPoolManagerTokensDetailed.svg @@ -1 +1 @@ -Uniswap v4 - Swap ERC1155 Tokens in the Pool Managernone, block 6, Mon, 18 Sep 2023 22:50:26 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0«token0»«TestERC20»0x9fe4..a6e0Nonce: 21Gas Price: 3.586031143 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 327,665Gas Used: 237,224Tx Fee: 0.001 ETHswapManagerTokens(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],fromCurrency: 0x9fE4..a6e0,fromAmount: 2,,000,000,000,000,000,000,recipient: 0xf39F..2266)218,516 gas0xdf1e1711207,557 gasprocess(calls: [0: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x1e2817de..000276a4],1: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x0e9b7186..4ec80000],2: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0],3: [target: 0x5FC8..5707,callType: 1,results: true,value: 0,data: 0x2d4a8248..00000000]])194,544 gaslock(data: 0x00000000..00000000)181,039 gaslockAcquired(encodedCalls: 0x00000000..00000000)158,059 gasswap(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [zeroForOne: true,amountSpecified: 2,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740])84,414 gasbeforeSwap(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [zeroForOne: true,amountSpecified: 2,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740])625 gasselector: 0xb3f97f80getFee(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E])468 gasfee: 3,000afterSwap(sender: 0xDc64..F6C9,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3cB2..B33E],params: [zeroForOne: true,amountSpecified: 2,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],delta: 680,564,733,841,876,927,267,031,581,784,474,886,373,,603,074,499,964,793,910)604 gasselector: 0xa5aa370adelta: 680,564,733,841,876,927,267,031,581,784,474,886,373,,603,074,499,964,793,910 82,717 gastransferFromCallerToPoolManager(token: 0x9fE4..a6e0,amount: 2,,000,000,000,000,000,000)34,422 gassafeTransferFrom(from: 0xf39F..2266,to: 0xCf7E..0Fc9,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000,data: 0x)33,655 gasonERC1155Received(0x5FC8..5707,0xf39F..2266,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000,0x)5,190 gas0xf23a6e61 28,465 gas 767 gassettle(currency: 0x9fE4..a6e0)9,175 gasbalanceOf(0xCf7E..0Fc9)2,566 gas33,,125,499,066,867,325,885paid: 0 6,609 gasremoveSelector(data: 0x2d4a8248..00000000)1,714 gasremainingData: 0x00000000..00000000swapManagerTokensCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)29,582 gasswapManagerTokensCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)26,988 gasmint(currency: 0xe7f1..0512,to: 0xf39F..2266,amount: 1,,771,532,931,803,417,546)22,826 gas 4,162 gas 2,594 gas0x00000000..00000000result: 0x00000000..00000000 22,980 gasresults: [0: 0x00000000..3bf37436,1: 0x,2: 0x00000000..00000000,3: 0x] 13,505 gas 13,013 gasresults: [0: 0x00000000..3bf37436,1: 0x,2: 0x00000000..00000000,3: 0x] 10,959 gasSwap:id: 0xf49e1fc4..ade8fcab,sender: 0xDc64..F6C9,amount0: 2,,000,000,000,000,000,000,amount1: -1771532931803417546,sqrtPriceX96: 72,375,192,506,,671,997,003,446,127,876,liquidity: 30,,000,000,000,000,000,000,tick: -1810,fee: 3,000TransferSingle:operator: 0x5FC8..5707,from: 0xf39F..2266,to: 0xCf7E..0Fc9,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000TransferSingle:operator: 0xCf7E..0Fc9,from: 0xCf7E..0Fc9,to: 0x0000..0000,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000TransferSingle:operator: 0xDc64..F6C9,from: 0x0000..0000,to: 0xf39F..2266,id: 1,324,161,310,598,743,833,836,268,493,538,,283,093,091,898,295,570,value: 1,,771,532,931,803,417,546 \ No newline at end of file +Uniswap v4 - Swap ERC1155 Tokens in the Pool Managernone, block 9, Sun, 24 Sep 2023 01:02:29 GMT0xf39f..22660xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0«Token B»«MockToken»0x9fe4..a6e0Nonce: 23Gas Price: 3.415702794 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 349,809Gas Used: 239,186Tx Fee: 0.001 ETHswapManagerTokens(poolKey: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],fromCurrency: 0x9fE4..a6e0,fromAmount: 2,,000,000,000,000,000,000,recipient: 0xf39F..2266)220,479 gas0xdf1e1711209,520 gasprocess(calls: [0: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0xf3cd914c..00000000],1: [target: 0xa513..C853,callType: ,results: false,value: 0,data: 0x0e9b7186..4ec80000],2: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x6a256b29..3c7fa6e0],3: [target: 0xa513..C853,callType: 1,results: true,value: 0,data: 0x2d4a8248..00000000]])196,189 gaslock(data: 0x00000000..00000000)182,560 gaslockAcquired(encodedCalls: 0x00000000..00000000)159,528 gasswap(key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 2,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],hookData: 0x)86,172 gasbeforeSwap(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 2,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],0x)882 gasselector: 0x575e24b4getFee(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 2,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],data: 0x)784 gasfee: 3,000afterSwap(sender: 0x0165..Eb8F,key: [currency0: 0x9fE4..a6e0,currency1: 0xe7f1..0512,fee: 8,388,608,tickSpacing: 60,hooks: 0x3C92..0434],params: [zeroForOne: true,amountSpecified: 2,,000,000,000,000,000,000,sqrtPriceLimitX96: 4,295,128,740],delta: 680,564,733,841,876,927,267,031,581,784,474,886,373,,603,074,499,964,793,910,0x)862 gasselector: 0xb47b2fb1delta: 680,564,733,841,876,927,267,031,581,784,474,886,373,,603,074,499,964,793,910 83,644 gastransferFromCallerToPoolManager(token: 0x9fE4..a6e0,amount: 2,,000,000,000,000,000,000)34,387 gassafeTransferFrom(from: 0xf39F..2266,to: 0x5FC8..5707,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000,data: 0x)33,620 gasonERC1155Received(0xa513..C853,0xf39F..2266,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000,0x)5,172 gas0xf23a6e61 28,448 gas 767 gassettle(currency: 0x9fE4..a6e0)9,171 gasbalanceOf(account: 0x5FC8..5707)2,562 gas33,,125,499,066,867,325,885paid: 0 6,609 gasremoveSelector(data: 0x2d4a8248..00000000)1,714 gasremainingData: 0x00000000..00000000swapManagerTokensCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)29,564 gasswapManagerTokensCallback(callData: 0x00000000..00000001,resultData: 0x00000000..00000000)26,970 gasmint(currency: 0xe7f1..0512,to: 0xf39F..2266,amount: 1,,771,532,931,803,417,546)22,808 gas 4,162 gas 2,594 gas0x00000000..00000000result: 0x00000000..00000000 23,032 gasresults: [0: 0x00000000..3bf37436,1: 0x,2: 0x00000000..00000000,3: 0x] 13,629 gas 13,331 gasresults: [0: 0x00000000..3bf37436,1: 0x,2: 0x00000000..00000000,3: 0x] 10,959 gasSwap:id: 0x0509f27e..72fb7633,sender: 0x0165..Eb8F,amount0: 2,,000,000,000,000,000,000,amount1: -1771532931803417546,sqrtPriceX96: 72,375,192,506,,671,997,003,446,127,876,liquidity: 30,,000,000,000,000,000,000,tick: -1810,fee: 3,000TransferSingle:operator: 0xa513..C853,from: 0xf39F..2266,to: 0x5FC8..5707,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000TransferSingle:operator: 0x5FC8..5707,from: 0x5FC8..5707,to: 0x0000..0000,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 2,,000,000,000,000,000,000TransferSingle:operator: 0x0165..Eb8F,from: 0x0000..0000,to: 0xf39F..2266,id: 1,324,161,310,598,743,833,836,268,493,538,,283,093,091,898,295,570,value: 1,,771,532,931,803,417,546 \ No newline at end of file diff --git a/docs/swapPoolManagerTokensSummary.svg b/docs/swapPoolManagerTokensSummary.svg index 4923218..93ce351 100644 --- a/docs/swapPoolManagerTokensSummary.svg +++ b/docs/swapPoolManagerTokensSummary.svg @@ -1 +1 @@ -Uniswap v4 - Swap ERC1155 Tokens in the Pool Manager0xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«DynamicFeeHook»0x3cb2..b33e«token0»«TestERC20»0x9fe4..a6e0swapManagerTokens0xdf1e1711processlocklockAcquiredswapbeforeSwapgetFeeafterSwaptransferFromCallerToPoolManagersafeTransferFromonERC1155ReceivedsettlebalanceOfremoveSelectorswapManagerTokensCallbackswapManagerTokensCallbackmint \ No newline at end of file +Uniswap v4 - Swap ERC1155 Tokens in the Pool Manager0xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«DynamicFeeHook»0x3c92..0434«Token B»«MockToken»0x9fe4..a6e0swapManagerTokens0xdf1e1711processlocklockAcquiredswapbeforeSwapgetFeeafterSwaptransferFromCallerToPoolManagersafeTransferFromonERC1155ReceivedsettlebalanceOfremoveSelectorswapManagerTokensCallbackswapManagerTokensCallbackmint \ No newline at end of file diff --git a/docs/swapPoolManagerTokensValue.svg b/docs/swapPoolManagerTokensValue.svg new file mode 100644 index 0000000..5756d32 --- /dev/null +++ b/docs/swapPoolManagerTokensValue.svg @@ -0,0 +1 @@ +Uniswap v4 - Swap ERC1155 Tokens in the Pool Manager0xf39F..2266«Uniswap v4 Core»«PoolManager»0x5FC8..5707TransferSingle 2.0 TOKBin 0x5FC8..5707TransferSingle 2.0 TOKBin 0x5FC8..5707TransferSingle 1.771532931803417546 TOKAin 0x5FC8..5707-2.0 TOKBin 0x5FC8..5707+1.771532931803417546 TOKAin 0x5FC8..5707 \ No newline at end of file diff --git a/docs/withdrawDetailed.svg b/docs/withdrawDetailed.svg index a3cd0b4..5fcb7ff 100644 --- a/docs/withdrawDetailed.svg +++ b/docs/withdrawDetailed.svg @@ -1 +1 @@ -Uniswap v4 - Withdraw0xf39f..22660xf39f..2266«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«UniswapV4Caller»0x5fc8..5707«UniswapV4Caller»0x5fc8..5707«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0xdc64..f6c9«UniswapV4Router»0xdc64..f6c9«token0»«TestERC20»0x9fe4..a6e0«token0»«TestERC20»0x9fe4..a6e00x81ef52fae7c0a4d2421c1caf2d018f45e6ef9c1c0c3a5a13b39a90b8445c8baaNonce: 17Gas Price: 3.586031143 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 67,697Gas Used: 46,289Tx Fee: 0 ETHsetApprovalForAll(operator: 0x5FC8..5707,approved: true)24,717 gasApprovalForAll:account: 0xf39F..2266,operator: 0x5FC8..5707,approved: true0x976339bbf4dfb4145af25029d34fd5a2d5919fa065ad4cb0e34d30907e91b940Nonce: 18Gas Price: 3.586031143 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 194,347Gas Used: 140,704Tx Fee: 0.001 ETHwithdraw(token: 0x9fE4..a6e0,recipient: 0xf39F..2266,amount: 4,,000,000,000,000,000,000)123,104 gas0x028dd178114,334 gasprocess(calls: [0: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x0e9b7186..9d900000],1: [target: 0xCf7E..0Fc9,callType: ,results: false,value: 0,data: 0x0b0d9c09..9d900000]])107,385 gaslock(data: 0x00000000..00000000)98,968 gaslockAcquired(encodedCalls: 0x00000000..00000000)76,800 gastransferFromCallerToPoolManager(token: 0x9fE4..a6e0,amount: 4,,000,000,000,000,000,000)51,949 gassafeTransferFrom(from: 0xf39F..2266,to: 0xCf7E..0Fc9,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000,data: 0x)51,182 gasonERC1155Received(0x5FC8..5707,0xf39F..2266,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000,0x)22,717 gas0xf23a6e61 28,465 gas 767 gastake(currency: 0x9fE4..a6e0,to: 0xf39F..2266,amount: 4,,000,000,000,000,000,000)18,856 gastransfer(recipient: 0xf39F..2266,amount: 4,,000,000,000,000,000,000)12,877 gastrue 5,979 gas0x00000000..00000000 5,995 gasresult: 0x00000000..00000000 22,168 gasresults: [0: 0x,1: 0x] 8,417 gas 6,949 gasresults: [0: 0x,1: 0x] 8,770 gasTransferSingle:operator: 0x5FC8..5707,from: 0xf39F..2266,to: 0xCf7E..0Fc9,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000TransferSingle:operator: 0xCf7E..0Fc9,from: 0xCf7E..0Fc9,to: 0x0000..0000,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000Transfer:from: 0xCf7E..0Fc9,to: 0xf39F..2266,value: 4,,000,000,000,000,000,000none, block 6, Mon, 18 Sep 2023 22:50:26 GMTnone, block 6, Mon, 18 Sep 2023 22:50:26 GMT  \ No newline at end of file +Uniswap v4 - Withdraw0xf39f..22660xf39f..2266«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Uniswap v4 Core»«PoolManager»0x5fc8..5707«UniswapV4Caller»0xa513..c853«UniswapV4Caller»0xa513..c853«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4RouterLibrary»0x5fbd..0aa3«UniswapV4Router»0x0165..eb8f«UniswapV4Router»0x0165..eb8f«Token B»«MockToken»0x9fe4..a6e0«Token B»«MockToken»0x9fe4..a6e00x82da8e1120dcbc236d3b603db357923c8cc3691711a67fe259f3404c6ba23ad5Nonce: 19Gas Price: 3.46992129 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 67,697Gas Used: 46,289Tx Fee: 0 ETHsetApprovalForAll(operator: 0xa513..C853,approved: true)24,717 gasApprovalForAll:account: 0xf39F..2266,operator: 0xa513..C853,approved: true0x96939ca613e425db4493a7b70a81056e1dadcf81023216b404a2adc7c4a3ff30Nonce: 20Gas Price: 3.46992129 GweiMax Fee: 5.0 GweiMax Priority: 3.0 GweiGas Limit: 194,369Gas Used: 140,720Tx Fee: 0 ETHwithdraw(token: 0x9fE4..a6e0,recipient: 0xf39F..2266,amount: 4,,000,000,000,000,000,000)123,120 gas0x028dd178114,350 gasprocess(calls: [0: [target: 0xa513..C853,callType: ,results: false,value: 0,data: 0x0e9b7186..9d900000],1: [target: 0x5FC8..5707,callType: ,results: false,value: 0,data: 0x0b0d9c09..9d900000]])107,401 gaslock(data: 0x00000000..00000000)98,984 gaslockAcquired(encodedCalls: 0x00000000..00000000)76,773 gastransferFromCallerToPoolManager(token: 0x9fE4..a6e0,amount: 4,,000,000,000,000,000,000)51,914 gassafeTransferFrom(from: 0xf39F..2266,to: 0x5FC8..5707,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000,data: 0x)51,147 gasonERC1155Received(0xa513..C853,0xf39F..2266,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000,0x)22,700 gas0xf23a6e61 28,447 gas 767 gastake(currency: 0x9fE4..a6e0,to: 0xf39F..2266,amount: 4,,000,000,000,000,000,000)18,865 gastransfer(to: 0xf39F..2266,value: 4,,000,000,000,000,000,000)12,888 gastrue 5,977 gas0x00000000..00000000 5,994 gasresult: 0x00000000..00000000 22,211 gasresults: [0: 0x,1: 0x] 8,417 gas 6,949 gasresults: [0: 0x,1: 0x] 8,770 gasTransferSingle:operator: 0xa513..C853,from: 0xf39F..2266,to: 0x5FC8..5707,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000TransferSingle:operator: 0x5FC8..5707,from: 0x5FC8..5707,to: 0x0000..0000,id: 912,823,093,544,680,850,579,175,995,568,,783,282,090,442,467,040,value: 4,,000,000,000,000,000,000Transfer:from: 0x5FC8..5707,to: 0xf39F..2266,value: 4,,000,000,000,000,000,000none, block 8, Sun, 24 Sep 2023 01:02:28 GMTnone, block 8, Sun, 24 Sep 2023 01:02:28 GMT  \ No newline at end of file diff --git a/docs/withdrawSummary.svg b/docs/withdrawSummary.svg index 80a2ec0..2657817 100644 --- a/docs/withdrawSummary.svg +++ b/docs/withdrawSummary.svg @@ -1 +1 @@ -Uniswap v4 - Withdraw0xf39f..2266«UniswapV4Caller»0x5fc8..5707«UniswapV4Router»0xdc64..f6c9«Uniswap v4 Core»«PoolManager»0xcf7e..0fc9«token0»«TestERC20»0x9fe4..a6e0withdrawprocesslocklockAcquiredtransferFromCallerToPoolManagersafeTransferFromonERC1155Receivedtaketransfer \ No newline at end of file +Uniswap v4 - Withdraw0xf39f..2266«UniswapV4Caller»0xa513..c853«UniswapV4Router»0x0165..eb8f«Uniswap v4 Core»«PoolManager»0x5fc8..5707«Token B»«MockToken»0x9fe4..a6e0withdrawprocesslocklockAcquiredtransferFromCallerToPoolManagersafeTransferFromonERC1155Receivedtaketransfer \ No newline at end of file diff --git a/docs/withdrawValue.svg b/docs/withdrawValue.svg new file mode 100644 index 0000000..34f5d0c --- /dev/null +++ b/docs/withdrawValue.svg @@ -0,0 +1 @@ +Uniswap v4 - Withdraw Value Transfers0xf39F..2266«Uniswap v4 Core»«PoolManager»0x5FC8..5707TransferSingle 4.0 TOKBin 0x5FC8..5707TransferSingle 4.0 TOKBin 0x5FC8..5707Transfer 4.0 TOKB-4.0 TOKBin 0x5FC8..5707+4.0 TOKB-4.0 TOKB \ No newline at end of file diff --git a/dynamicFeeRemoveDetailed.svg b/dynamicFeeRemoveDetailed.svg new file mode 100644 index 0000000..e69de29