-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
final decode in calldata #363
Merged
+76
−68
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,49 +3,49 @@ | |
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Batch reverts gas: 2 sub-plans, both fail but the transaction succeeds 1`] = ` | ||
Object { | ||
"calldataByteLength": 1764, | ||
"gasUsed": 269421, | ||
"gasUsed": 269286, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Batch reverts gas: 2 sub-plans, neither fails 1`] = ` | ||
Object { | ||
"calldataByteLength": 1764, | ||
"gasUsed": 245148, | ||
"gasUsed": 245013, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Batch reverts gas: 2 sub-plans, second sub plan fails 1`] = ` | ||
Object { | ||
"calldataByteLength": 1764, | ||
"gasUsed": 245148, | ||
"gasUsed": 245013, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Batch reverts gas: 2 sub-plans, the first fails 1`] = ` | ||
Object { | ||
"calldataByteLength": 1764, | ||
"gasUsed": 269421, | ||
"gasUsed": 269286, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Interleaving routes gas: V2, then V3 1`] = ` | ||
Object { | ||
"calldataByteLength": 836, | ||
"gasUsed": 189470, | ||
"gasUsed": 189429, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Interleaving routes gas: V3, then V2 1`] = ` | ||
Object { | ||
"calldataByteLength": 836, | ||
"gasUsed": 177054, | ||
"gasUsed": 177013, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Split routes gas: ERC20 --> ERC20 split V2 and V2 different routes, different input tokens, each two hop, with batch permit 1`] = ` | ||
Object { | ||
"calldataByteLength": 1540, | ||
"gasUsed": 298488, | ||
"gasUsed": 297045, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the most relevant gas test for this change |
||
} | ||
`; | ||
|
||
|
@@ -59,7 +59,7 @@ Object { | |
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Split routes gas: ERC20 --> ERC20 split V2 and V2 different routes, each two hop, with explicit permit transfer from batch 1`] = ` | ||
Object { | ||
"calldataByteLength": 1284, | ||
"gasUsed": 309785, | ||
"gasUsed": 308988, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this one :) |
||
} | ||
`; | ||
|
||
|
@@ -73,35 +73,35 @@ Object { | |
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Split routes gas: ERC20 --> ERC20 split V2 and V3, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 996, | ||
"gasUsed": 176845, | ||
"gasUsed": 176751, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Split routes gas: ERC20 --> ERC20 split V2 and V3, one hop, ADDRESS_THIS flag 1`] = ` | ||
Object { | ||
"calldataByteLength": 996, | ||
"gasUsed": 176620, | ||
"gasUsed": 176526, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Split routes gas: ERC20 --> ETH split V2 and V3, exactOut, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 964, | ||
"gasUsed": 194645, | ||
"gasUsed": 194568, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Split routes gas: ERC20 --> ETH split V2 and V3, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 964, | ||
"gasUsed": 184716, | ||
"gasUsed": 184675, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Split routes gas: ETH --> ERC20 split V2 and V3, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 1124, | ||
"gasUsed": 191723, | ||
"gasUsed": 191629, | ||
} | ||
`; | ||
|
||
|
@@ -143,7 +143,7 @@ Object { | |
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ERC20 gas: exactIn trade, where an output fee is taken 1`] = ` | ||
Object { | ||
"calldataByteLength": 836, | ||
"gasUsed": 126565, | ||
"gasUsed": 126459, | ||
} | ||
`; | ||
|
||
|
@@ -185,21 +185,21 @@ Object { | |
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 516, | ||
"gasUsed": 106926, | ||
"gasUsed": 106890, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, three hops 1`] = ` | ||
Object { | ||
"calldataByteLength": 580, | ||
"gasUsed": 246827, | ||
"gasUsed": 246791, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, two hops 1`] = ` | ||
Object { | ||
"calldataByteLength": 548, | ||
"gasUsed": 176950, | ||
"gasUsed": 176914, | ||
} | ||
`; | ||
|
||
|
@@ -213,14 +213,14 @@ Object { | |
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ETH gas: exactOut, one trade, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 804, | ||
"gasUsed": 128329, | ||
"gasUsed": 128240, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ETH gas: exactOut, with ETH fee 1`] = ` | ||
Object { | ||
"calldataByteLength": 964, | ||
"gasUsed": 136301, | ||
"gasUsed": 136159, | ||
} | ||
`; | ||
|
||
|
@@ -234,7 +234,7 @@ Object { | |
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ETH --> ERC20 gas: exactOut, one trade, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 772, | ||
"gasUsed": 125534, | ||
"gasUsed": 125498, | ||
} | ||
`; | ||
|
||
|
@@ -283,69 +283,69 @@ Object { | |
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactIn, one trade, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 516, | ||
"gasUsed": 105541, | ||
"gasUsed": 105500, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactIn, one trade, three hops 1`] = ` | ||
Object { | ||
"calldataByteLength": 548, | ||
"gasUsed": 254014, | ||
"gasUsed": 253891, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactIn, one trade, two hops 1`] = ` | ||
Object { | ||
"calldataByteLength": 548, | ||
"gasUsed": 177164, | ||
"gasUsed": 177082, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, one hop 1`] = ` | ||
Object { | ||
"calldataByteLength": 516, | ||
"gasUsed": 115071, | ||
"gasUsed": 115030, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, three hops 1`] = ` | ||
Object { | ||
"calldataByteLength": 548, | ||
"gasUsed": 251172, | ||
"gasUsed": 251049, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, two hops 1`] = ` | ||
Object { | ||
"calldataByteLength": 548, | ||
"gasUsed": 174826, | ||
"gasUsed": 174744, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ETH gas: exactIn swap 1`] = ` | ||
Object { | ||
"calldataByteLength": 644, | ||
"gasUsed": 121815, | ||
"gasUsed": 121774, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ETH gas: exactOut swap 1`] = ` | ||
Object { | ||
"calldataByteLength": 644, | ||
"gasUsed": 131417, | ||
"gasUsed": 131376, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ETH --> ERC20 gas: exactIn swap 1`] = ` | ||
Object { | ||
"calldataByteLength": 644, | ||
"gasUsed": 215384, | ||
"gasUsed": 215343, | ||
} | ||
`; | ||
|
||
exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ETH --> ERC20 gas: exactOut swap 1`] = ` | ||
Object { | ||
"calldataByteLength": 772, | ||
"gasUsed": 126560, | ||
"gasUsed": 126519, | ||
} | ||
`; |
2 changes: 1 addition & 1 deletion
2
test/integration-tests/gas-tests/__snapshots__/UniversalRouter.gas.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`UniversalRouter Gas Tests gas: bytecode size 1`] = `14355`; | ||
exports[`UniversalRouter Gas Tests gas: bytecode size 1`] = `13879`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i noticed that this could also be changed to calldata
universal-router/contracts/modules/uniswap/v2/UniswapV2Library.sol
Line 125 in c853d4e