Skip to content

Commit

Permalink
feat: update snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
marktoda committed Nov 15, 2023
1 parent bbb9c1f commit a364561
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 61 deletions.
6 changes: 1 addition & 5 deletions contracts/UniversalRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ contract UniversalRouter is IUniversalRouter, Dispatcher, RewardsCollector {
UniswapImmutables(
UniswapParameters(params.v2Factory, params.v3Factory, params.pairInitCodeHash, params.poolInitCodeHash)
)
PaymentsImmutables(
PaymentsParameters(
params.permit2, params.weth9, params.openseaConduit, params.sudoswap
)
)
PaymentsImmutables(PaymentsParameters(params.permit2, params.weth9, params.openseaConduit, params.sudoswap))
NFTImmutables(
NFTParameters(
params.seaportV1_5,
Expand Down
2 changes: 1 addition & 1 deletion deploy-addresses/base-goerli.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"UniversalRouterV1_2": "0xd0872d928672ae2ff74bdb2f5130ac12229cafaf",
"UnsupportedProtocol": "0x7B46ee9BaB49bd5b37117494689A035b0F187B59"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
exports[`NFTX Gas Tests gas: buyAndRedeem w/ specific selection 1`] = `
Object {
"calldataByteLength": 964,
"gasUsed": 574870,
"gasUsed": 574873,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,42 @@ Object {
exports[`Payments Gas Tests Individual Command Tests gas: SWEEP with ERC20 1`] = `
Object {
"calldataByteLength": 356,
"gasUsed": 39235,
"gasUsed": 39247,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: SWEEP_WITH_FEE 1`] = `
Object {
"calldataByteLength": 516,
"gasUsed": 67925,
"gasUsed": 67949,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: TRANSFER with ERC20 1`] = `
Object {
"calldataByteLength": 356,
"gasUsed": 38248,
"gasUsed": 38260,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: TRANSFER with ETH 1`] = `
Object {
"calldataByteLength": 356,
"gasUsed": 33821,
"gasUsed": 33833,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: UNWRAP_WETH 1`] = `
Object {
"calldataByteLength": 324,
"gasUsed": 46765,
"gasUsed": 46768,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: UNWRAP_WETH_WITH_FEE 1`] = `
Object {
"calldataByteLength": 644,
"gasUsed": 53127,
"gasUsed": 53154,
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Seaport v1.4 Gas Tests ERC20 -> NFT gas: fulfillAdvancedOrder 1`] = `
Object {
"calldataByteLength": 2532,
"gasUsed": 237135,
"gasUsed": 237147,
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Seaport v1.5 Gas Tests ETH -> NFT gas: fulfillAdvancedOrder 1`] = `
Object {
"calldataByteLength": 2020,
"gasUsed": 152097,
"gasUsed": 152100,
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
exports[`Sudoswap Gas Tests ERC20 -> NFT gas: purchases NFTs with FRAX ERC20 token already approved 1`] = `
Object {
"calldataByteLength": 1380,
"gasUsed": 289920,
"gasUsed": 289932,
}
`;

exports[`Sudoswap Gas Tests ERC20 -> NFT gas: purchases tokens 2402, 2509 of Based Ghoul with FRAX ERC20 token 1`] = `
Object {
"calldataByteLength": 1508,
"gasUsed": 311549,
"gasUsed": 311561,
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,56 @@
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": 273152,
"gasUsed": 273118,
}
`;

exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Batch reverts gas: 2 sub-plans, neither fails 1`] = `
Object {
"calldataByteLength": 1764,
"gasUsed": 248874,
"gasUsed": 248840,
}
`;

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": 248874,
"gasUsed": 248840,
}
`;

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": 273152,
"gasUsed": 273118,
}
`;

exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Interleaving routes gas: V2, then V3 1`] = `
Object {
"calldataByteLength": 836,
"gasUsed": 196828,
"gasUsed": 196805,
}
`;

exports[`Uniswap Gas Tests Mixing V2 and V3 with Universal Router. Interleaving routes gas: V3, then V2 1`] = `
Object {
"calldataByteLength": 836,
"gasUsed": 189624,
"gasUsed": 189601,
}
`;

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": 305306,
"gasUsed": 305318,
}
`;

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 1`] = `
Object {
"calldataByteLength": 1220,
"gasUsed": 313366,
"gasUsed": 313390,
}
`;

Expand All @@ -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": 179794,
"gasUsed": 179783,
}
`;

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": 179569,
"gasUsed": 179558,
}
`;

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": 198235,
"gasUsed": 198193,
}
`;

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": 187631,
"gasUsed": 187611,
}
`;

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": 200312,
"gasUsed": 200301,
}
`;

Expand Down Expand Up @@ -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": 128824,
"gasUsed": 128848,
}
`;

Expand Down Expand Up @@ -206,21 +206,21 @@ Object {
exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ETH gas: exactIn, one trade, one hop 1`] = `
Object {
"calldataByteLength": 644,
"gasUsed": 125258,
"gasUsed": 125261,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ETH gas: exactOut, one trade, one hop 1`] = `
Object {
"calldataByteLength": 804,
"gasUsed": 130417,
"gasUsed": 130432,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV2 with Universal Router. ERC20 --> ETH gas: exactOut, with ETH fee 1`] = `
Object {
"calldataByteLength": 964,
"gasUsed": 138406,
"gasUsed": 138433,
}
`;

Expand All @@ -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": 127616,
"gasUsed": 127619,
}
`;

Expand Down Expand Up @@ -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": 117144,
"gasUsed": 117121,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactIn, one trade, three hops 1`] = `
Object {
"calldataByteLength": 548,
"gasUsed": 276366,
"gasUsed": 276297,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactIn, one trade, two hops 1`] = `
Object {
"calldataByteLength": 548,
"gasUsed": 192426,
"gasUsed": 192380,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, one hop 1`] = `
Object {
"calldataByteLength": 516,
"gasUsed": 118771,
"gasUsed": 118726,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, three hops 1`] = `
Object {
"calldataByteLength": 548,
"gasUsed": 421314,
"gasUsed": 421548,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ERC20 gas: exactOut, one trade, two hops 1`] = `
Object {
"calldataByteLength": 548,
"gasUsed": 315013,
"gasUsed": 315107,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ETH gas: exactIn swap 1`] = `
Object {
"calldataByteLength": 644,
"gasUsed": 133408,
"gasUsed": 133388,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ERC20 --> ETH gas: exactOut swap 1`] = `
Object {
"calldataByteLength": 644,
"gasUsed": 135107,
"gasUsed": 135065,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ETH --> ERC20 gas: exactIn swap 1`] = `
Object {
"calldataByteLength": 644,
"gasUsed": 242391,
"gasUsed": 242368,
}
`;

exports[`Uniswap Gas Tests Trade on UniswapV3 with Universal Router. ETH --> ERC20 gas: exactOut swap 1`] = `
Object {
"calldataByteLength": 772,
"gasUsed": 129590,
"gasUsed": 129549,
}
`;
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`UniversalRouter Gas Tests gas: bytecode size 1`] = `18307`;
exports[`UniversalRouter Gas Tests gas: bytecode size 1`] = `17917`;

exports[`UniversalRouter Gas Tests trading for NFTs gas: ERC20 --> ETH --> Seaport NFT 1`] = `
Object {
"calldataByteLength": 2468,
"gasUsed": 252703,
"gasUsed": 252709,
}
`;

exports[`UniversalRouter Gas Tests trading for NFTs gas: ETH --> Seaport NFT 1`] = `
Object {
"calldataByteLength": 2020,
"gasUsed": 152097,
"gasUsed": 152100,
}
`;

exports[`UniversalRouter Gas Tests trading for NFTs gas: WETH --> ETH --> Seaport NFT 1`] = `
Object {
"calldataByteLength": 2308,
"gasUsed": 186861,
"gasUsed": 186879,
}
`;
Loading

0 comments on commit a364561

Please sign in to comment.