@uniswap/universal-router-sdk 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/entities/Command.d.ts +7 -7
  2. package/dist/entities/NFTTrade.d.ts +41 -49
  3. package/dist/entities/index.d.ts +2 -2
  4. package/dist/entities/protocols/cryptopunk.d.ts +16 -16
  5. package/dist/entities/protocols/foundation.d.ts +19 -19
  6. package/dist/entities/protocols/index.d.ts +9 -9
  7. package/dist/entities/protocols/looksRare.d.ts +44 -43
  8. package/dist/entities/protocols/nft20.d.ts +21 -21
  9. package/dist/entities/protocols/nftx.d.ts +20 -20
  10. package/dist/entities/protocols/seaport.d.ts +57 -57
  11. package/dist/entities/protocols/sudoswap.d.ts +27 -27
  12. package/dist/entities/protocols/uniswap.d.ts +14 -47
  13. package/dist/entities/protocols/x2y2.d.ts +28 -19
  14. package/dist/index.d.ts +3 -2
  15. package/dist/index.js +2 -2
  16. package/dist/swapRouter.d.ts +32 -30
  17. package/dist/{narwhal-sdk.cjs.development.js → universal-router-sdk.cjs.development.js} +244 -2489
  18. package/dist/universal-router-sdk.cjs.development.js.map +1 -0
  19. package/dist/universal-router-sdk.cjs.production.min.js +2 -0
  20. package/dist/universal-router-sdk.cjs.production.min.js.map +1 -0
  21. package/dist/{narwhal-sdk.esm.js → universal-router-sdk.esm.js} +244 -2490
  22. package/dist/universal-router-sdk.esm.js.map +1 -0
  23. package/dist/utils/constants.d.ts +7 -5
  24. package/dist/utils/expandTo18Decimals.d.ts +4 -2
  25. package/dist/utils/getNativeCurrencyValue.d.ts +2 -2
  26. package/dist/utils/permit2.d.ts +6 -6
  27. package/dist/utils/routerCommands.d.ts +43 -43
  28. package/package.json +1 -1
  29. package/dist/narwhal-sdk.cjs.development.js.map +0 -1
  30. package/dist/narwhal-sdk.cjs.production.min.js +0 -2
  31. package/dist/narwhal-sdk.cjs.production.min.js.map +0 -1
  32. package/dist/narwhal-sdk.esm.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import invariant from 'tiny-invariant';
2
- import { abi as abi$8 } from '@uniswap/narwhal/artifacts/contracts/Router.sol/Router.json';
2
+ import { abi as abi$7 } from '@uniswap/universal-router/artifacts/contracts/UniversalRouter.sol/UniversalRouter.json';
3
3
  import { Interface } from '@ethersproject/abi';
4
- import { BigNumber, ethers } from 'ethers';
4
+ import { BigNumber } from 'ethers';
5
5
  import { TradeType, Percent, Token, Ether } from '@uniswap/sdk-core';
6
6
  import JSBI from 'jsbi';
7
7
  import { defaultAbiCoder } from 'ethers/lib/utils';
8
8
  import { Trade, Pair } from '@uniswap/v2-sdk';
9
9
  import { Trade as Trade$1, encodeRouteToPath, Pool } from '@uniswap/v3-sdk';
10
- import { Protocol, MixedRouteTrade, partitionMixedRouteByProtocol, getOutputOfPools, MixedRouteSDK, MixedRoute, encodeMixedRouteToPath, Trade as Trade$2 } from '@uniswap/router-sdk';
10
+ import { Protocol, MixedRouteTrade, partitionMixedRouteByProtocol, getOutputOfPools, MixedRouteSDK, MixedRoute, encodeMixedRouteToPath } from '@uniswap/router-sdk';
11
11
 
12
12
  function _inheritsLoose(subClass, superClass) {
13
13
  subClass.prototype = Object.create(superClass.prototype);
@@ -61,35 +61,38 @@ var _ABI_DEFINITION;
61
61
  */
62
62
  var CommandType;
63
63
  (function (CommandType) {
64
- CommandType[CommandType["PERMIT"] = 0] = "PERMIT";
65
- CommandType[CommandType["TRANSFER"] = 1] = "TRANSFER";
66
- CommandType[CommandType["V3_SWAP_EXACT_IN"] = 2] = "V3_SWAP_EXACT_IN";
67
- CommandType[CommandType["V3_SWAP_EXACT_OUT"] = 3] = "V3_SWAP_EXACT_OUT";
68
- CommandType[CommandType["V2_SWAP_EXACT_IN"] = 4] = "V2_SWAP_EXACT_IN";
69
- CommandType[CommandType["V2_SWAP_EXACT_OUT"] = 5] = "V2_SWAP_EXACT_OUT";
70
- CommandType[CommandType["SEAPORT"] = 6] = "SEAPORT";
71
- CommandType[CommandType["WRAP_ETH"] = 7] = "WRAP_ETH";
72
- CommandType[CommandType["UNWRAP_WETH"] = 8] = "UNWRAP_WETH";
73
- CommandType[CommandType["SWEEP"] = 9] = "SWEEP";
74
- CommandType[CommandType["NFTX"] = 10] = "NFTX";
75
- CommandType[CommandType["LOOKS_RARE_721"] = 11] = "LOOKS_RARE_721";
76
- CommandType[CommandType["X2Y2_721"] = 12] = "X2Y2_721";
77
- CommandType[CommandType["LOOKS_RARE_1155"] = 13] = "LOOKS_RARE_1155";
78
- CommandType[CommandType["X2Y2_1155"] = 14] = "X2Y2_1155";
79
- CommandType[CommandType["FOUNDATION"] = 15] = "FOUNDATION";
80
- CommandType[CommandType["PAY_PORTION"] = 16] = "PAY_PORTION";
81
- CommandType[CommandType["SUDOSWAP"] = 18] = "SUDOSWAP";
82
- CommandType[CommandType["NFT20"] = 19] = "NFT20";
83
- CommandType[CommandType["OWNER_CHECK_721"] = 20] = "OWNER_CHECK_721";
84
- CommandType[CommandType["OWNER_CHECK_1155"] = 21] = "OWNER_CHECK_1155";
85
- CommandType[CommandType["CRYPTOPUNKS"] = 22] = "CRYPTOPUNKS";
86
- CommandType[CommandType["PERMIT2_TRANSFER_FROM"] = 23] = "PERMIT2_TRANSFER_FROM";
87
- CommandType[CommandType["PERMIT2_TRANSFER_FROM_BATCH"] = 24] = "PERMIT2_TRANSFER_FROM_BATCH";
88
- CommandType[CommandType["PERMIT2_PERMIT_BATCH"] = 25] = "PERMIT2_PERMIT_BATCH";
64
+ CommandType[CommandType["V3_SWAP_EXACT_IN"] = 0] = "V3_SWAP_EXACT_IN";
65
+ CommandType[CommandType["V3_SWAP_EXACT_OUT"] = 1] = "V3_SWAP_EXACT_OUT";
66
+ CommandType[CommandType["PERMIT2_TRANSFER_FROM"] = 2] = "PERMIT2_TRANSFER_FROM";
67
+ CommandType[CommandType["PERMIT2_PERMIT_BATCH"] = 3] = "PERMIT2_PERMIT_BATCH";
68
+ CommandType[CommandType["SWEEP"] = 4] = "SWEEP";
69
+ CommandType[CommandType["TRANSFER"] = 5] = "TRANSFER";
70
+ CommandType[CommandType["PAY_PORTION"] = 6] = "PAY_PORTION";
71
+ CommandType[CommandType["V2_SWAP_EXACT_IN"] = 8] = "V2_SWAP_EXACT_IN";
72
+ CommandType[CommandType["V2_SWAP_EXACT_OUT"] = 9] = "V2_SWAP_EXACT_OUT";
73
+ CommandType[CommandType["PERMIT"] = 10] = "PERMIT";
74
+ CommandType[CommandType["WRAP_ETH"] = 11] = "WRAP_ETH";
75
+ CommandType[CommandType["UNWRAP_WETH"] = 12] = "UNWRAP_WETH";
76
+ CommandType[CommandType["PERMIT2_TRANSFER_FROM_BATCH"] = 13] = "PERMIT2_TRANSFER_FROM_BATCH";
77
+ // NFT-related command types
78
+ CommandType[CommandType["SEAPORT"] = 16] = "SEAPORT";
79
+ CommandType[CommandType["LOOKS_RARE_721"] = 17] = "LOOKS_RARE_721";
80
+ CommandType[CommandType["NFTX"] = 18] = "NFTX";
81
+ CommandType[CommandType["CRYPTOPUNKS"] = 19] = "CRYPTOPUNKS";
82
+ CommandType[CommandType["LOOKS_RARE_1155"] = 20] = "LOOKS_RARE_1155";
83
+ CommandType[CommandType["OWNER_CHECK_721"] = 21] = "OWNER_CHECK_721";
84
+ CommandType[CommandType["OWNER_CHECK_1155"] = 22] = "OWNER_CHECK_1155";
85
+ CommandType[CommandType["X2Y2_721"] = 24] = "X2Y2_721";
86
+ CommandType[CommandType["SUDOSWAP"] = 25] = "SUDOSWAP";
87
+ CommandType[CommandType["NFT20"] = 26] = "NFT20";
88
+ CommandType[CommandType["X2Y2_1155"] = 27] = "X2Y2_1155";
89
+ CommandType[CommandType["FOUNDATION"] = 28] = "FOUNDATION";
89
90
  })(CommandType || (CommandType = {}));
91
+ var PERMIT_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce) details, address spender, uint256 sigDeadline)';
92
+ var PERMIT_BATCH_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce)[] details, address spender, uint256 sigDeadline)';
90
93
  var ALLOW_REVERT_FLAG = 0x80;
91
94
  var REVERTABLE_COMMANDS = /*#__PURE__*/new Set([CommandType.SEAPORT, CommandType.NFTX, CommandType.LOOKS_RARE_721, CommandType.LOOKS_RARE_1155, CommandType.X2Y2_721, CommandType.X2Y2_1155, CommandType.FOUNDATION, CommandType.SUDOSWAP, CommandType.NFT20]);
92
- var ABI_DEFINITION = (_ABI_DEFINITION = {}, _ABI_DEFINITION[CommandType.PERMIT] = ['bytes'], _ABI_DEFINITION[CommandType.TRANSFER] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.V3_SWAP_EXACT_IN] = ['address', 'uint256', 'uint256', 'bytes', 'bool'], _ABI_DEFINITION[CommandType.V3_SWAP_EXACT_OUT] = ['address', 'uint256', 'uint256', 'bytes', 'bool'], _ABI_DEFINITION[CommandType.V2_SWAP_EXACT_IN] = ['uint256', 'uint256', 'address[]', 'address', 'bool'], _ABI_DEFINITION[CommandType.V2_SWAP_EXACT_OUT] = ['uint256', 'uint256', 'address[]', 'address', 'bool'], _ABI_DEFINITION[CommandType.SEAPORT] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.WRAP_ETH] = ['address', 'uint256'], _ABI_DEFINITION[CommandType.UNWRAP_WETH] = ['address', 'uint256'], _ABI_DEFINITION[CommandType.SWEEP] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.NFTX] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.LOOKS_RARE_721] = ['uint256', 'bytes', 'address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.X2Y2_721] = ['uint256', 'bytes', 'address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.LOOKS_RARE_1155] = ['uint256', 'bytes', 'address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.X2Y2_1155] = ['uint256', 'bytes', 'address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.FOUNDATION] = ['uint256', 'bytes', 'address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.PAY_PORTION] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.SUDOSWAP] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.OWNER_CHECK_721] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.OWNER_CHECK_1155] = ['address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.NFT20] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.CRYPTOPUNKS] = ['uint256', 'address', 'uint256'], _ABI_DEFINITION[CommandType.PERMIT2_TRANSFER_FROM] = ['address', 'address', 'uint160'], _ABI_DEFINITION[CommandType.PERMIT2_TRANSFER_FROM_BATCH] = ['bytes'], _ABI_DEFINITION[CommandType.PERMIT2_PERMIT_BATCH] = ['bytes'], _ABI_DEFINITION);
95
+ var ABI_DEFINITION = (_ABI_DEFINITION = {}, _ABI_DEFINITION[CommandType.PERMIT] = [PERMIT_STRUCT, 'bytes'], _ABI_DEFINITION[CommandType.PERMIT2_PERMIT_BATCH] = [PERMIT_BATCH_STRUCT, 'bytes'], _ABI_DEFINITION[CommandType.PERMIT2_TRANSFER_FROM] = ['address', 'address', 'uint160'], _ABI_DEFINITION[CommandType.PERMIT2_TRANSFER_FROM_BATCH] = ['bytes'], _ABI_DEFINITION[CommandType.TRANSFER] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.V3_SWAP_EXACT_IN] = ['address', 'uint256', 'uint256', 'bytes', 'bool'], _ABI_DEFINITION[CommandType.V3_SWAP_EXACT_OUT] = ['address', 'uint256', 'uint256', 'bytes', 'bool'], _ABI_DEFINITION[CommandType.V2_SWAP_EXACT_IN] = ['address', 'uint256', 'uint256', 'address[]', 'bool'], _ABI_DEFINITION[CommandType.V2_SWAP_EXACT_OUT] = ['address', 'uint256', 'uint256', 'address[]', 'bool'], _ABI_DEFINITION[CommandType.SEAPORT] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.WRAP_ETH] = ['address', 'uint256'], _ABI_DEFINITION[CommandType.UNWRAP_WETH] = ['address', 'uint256'], _ABI_DEFINITION[CommandType.SWEEP] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.NFTX] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.LOOKS_RARE_721] = ['uint256', 'bytes', 'address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.LOOKS_RARE_1155] = ['uint256', 'bytes', 'address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.X2Y2_721] = ['uint256', 'bytes', 'address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.X2Y2_1155] = ['uint256', 'bytes', 'address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.FOUNDATION] = ['uint256', 'bytes', 'address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.PAY_PORTION] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.SUDOSWAP] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.OWNER_CHECK_721] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.OWNER_CHECK_1155] = ['address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.NFT20] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.CRYPTOPUNKS] = ['uint256', 'address', 'uint256'], _ABI_DEFINITION);
93
96
  var RoutePlanner = /*#__PURE__*/function () {
94
97
  function RoutePlanner() {
95
98
  this.commands = '0x';
@@ -120,2447 +123,189 @@ function createCommand(type, parameters) {
120
123
  };
121
124
  }
122
125
 
123
- var NARWHAL_ADDRESS = '0x5393904db506415D941726f3Cf0404Bb167537A0';
124
- var CONTRACT_BALANCE = /*#__PURE__*/BigNumber.from(2).pow(255);
125
- var ETH_ADDRESS = '0x0000000000000000000000000000000000000000';
126
-
127
- var REFUND_ETH_PRICE_IMPACT_THRESHOLD = /*#__PURE__*/new Percent( /*#__PURE__*/JSBI.BigInt(50), /*#__PURE__*/JSBI.BigInt(100));
128
- // Wrapper for uniswap router-sdk trade entity to encode swaps for Narwhal
129
- // also translates trade objects from previous (v2, v3) SDKs
130
- var UniswapTrade = /*#__PURE__*/function () {
131
- function UniswapTrade(trade, options) {
132
- this.trade = trade;
133
- this.options = options;
134
- }
135
- UniswapTrade.fromAny = function fromAny(trades, options) {
136
- if (isRouterTrade(trades)) {
137
- return new UniswapTrade(trades, options);
138
- }
139
- if (Array.isArray(trades)) {
140
- return UniswapTrade.from(trades, options);
141
- }
142
- return UniswapTrade.from([trades], options);
143
- }
144
- // alternative constructor to create from protocol-specific sdks
145
- ;
146
- UniswapTrade.from = function from(trades, options) {
147
- !(trades.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO_TRADES') : invariant(false) : void 0;
148
- !trades.every(function (trade) {
149
- return trade.tradeType == trades[0].tradeType;
150
- }) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INCONSISTENT_TRADE_TYPES') : invariant(false) : void 0;
151
- return new UniswapTrade(
152
- // RouterTrade constructor handles validation of routes
153
- new Trade$2({
154
- v2Routes: trades.filter(function (trade) {
155
- return trade instanceof Trade;
156
- }).map(function (trade) {
157
- return {
158
- routev2: trade.route,
159
- inputAmount: trade.inputAmount,
160
- outputAmount: trade.outputAmount
161
- };
162
- }),
163
- v3Routes: trades.filter(function (trade) {
164
- return trade instanceof Trade$1;
165
- }).map(function (trade) {
166
- return {
167
- routev3: trade.route,
168
- inputAmount: trade.inputAmount,
169
- outputAmount: trade.outputAmount
170
- };
171
- }),
172
- mixedRoutes: trades.filter(function (trade) {
173
- return trade instanceof MixedRouteTrade;
174
- }).map(function (trade) {
175
- return {
176
- mixedRoute: trade.route,
177
- inputAmount: trade.inputAmount,
178
- outputAmount: trade.outputAmount
179
- };
180
- }),
181
- tradeType: trades[0].tradeType
182
- }), options);
183
- };
184
- var _proto = UniswapTrade.prototype;
185
- _proto.encode = function encode(planner, _config) {
186
- var payerIsUser = true;
187
- if (this.trade.inputAmount.currency.isNative) {
188
- // TODO: opti if only one v2 pool we can directly send this to the pool
189
- planner.addCommand(CommandType.WRAP_ETH, [NARWHAL_ADDRESS, this.trade.maximumAmountIn(this.options.slippageTolerance).quotient.toString()]);
190
- // since WETH is now owned by the router, the router pays for inputs
191
- payerIsUser = false;
192
- }
193
- for (var _iterator = _createForOfIteratorHelperLoose(this.trade.swaps), _step; !(_step = _iterator()).done;) {
194
- var swap = _step.value;
195
- switch (swap.route.protocol) {
196
- case Protocol.V2:
197
- addV2Swap(planner, swap, this.trade.tradeType, this.options, payerIsUser);
198
- break;
199
- case Protocol.V3:
200
- addV3Swap(planner, swap, this.trade.tradeType, this.options, payerIsUser);
201
- break;
202
- case Protocol.MIXED:
203
- addMixedSwap(planner, swap, this.trade.tradeType, this.options, payerIsUser);
204
- break;
205
- default:
206
- throw new Error('UNSUPPORTED_TRADE_PROTOCOL');
207
- }
208
- }
209
- if (this.trade.outputAmount.currency.isNative) {
210
- planner.addCommand(CommandType.UNWRAP_WETH, [this.options.recipient, this.trade.minimumAmountOut(this.options.slippageTolerance).quotient.toString()]);
211
- } else if (this.trade.inputAmount.currency.isNative && (this.trade.tradeType === TradeType.EXACT_OUTPUT || riskOfPartialFill(this.trade))) {
212
- // for exactOutput swaps that take native currency as input
213
- // we need to send back the change to the user
214
- planner.addCommand(CommandType.UNWRAP_WETH, [this.options.recipient, 0]);
215
- }
216
- };
217
- return UniswapTrade;
218
- }();
219
- // encode a uniswap v2 swap
220
- function addV2Swap(planner, _ref, tradeType, options, payerIsUser) {
221
- var route = _ref.route,
222
- inputAmount = _ref.inputAmount,
223
- outputAmount = _ref.outputAmount;
224
- var trade = new Trade(route, tradeType == TradeType.EXACT_INPUT ? inputAmount : outputAmount, tradeType);
225
- if (tradeType == TradeType.EXACT_INPUT) {
226
- planner.addCommand(CommandType.V2_SWAP_EXACT_IN, [trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), route.path.map(function (pool) {
227
- return pool.address;
228
- }),
229
- // if native, we have to unwrap so keep in the router for now
230
- trade.outputAmount.currency.isNative ? NARWHAL_ADDRESS : options.recipient, payerIsUser]);
231
- } else if (tradeType == TradeType.EXACT_OUTPUT) {
232
- planner.addCommand(CommandType.V2_SWAP_EXACT_OUT, [trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), route.path.map(function (pool) {
233
- return pool.address;
234
- }), trade.outputAmount.currency.isNative ? NARWHAL_ADDRESS : options.recipient, payerIsUser]);
235
- }
236
- }
237
- // encode a uniswap v3 swap
238
- function addV3Swap(planner, _ref2, tradeType, options, payerIsUser) {
239
- var route = _ref2.route,
240
- inputAmount = _ref2.inputAmount,
241
- outputAmount = _ref2.outputAmount;
242
- var trade = Trade$1.createUncheckedTrade({
243
- route: route,
244
- inputAmount: inputAmount,
245
- outputAmount: outputAmount,
246
- tradeType: tradeType
247
- });
248
- var path = encodeRouteToPath(route, trade.tradeType === TradeType.EXACT_OUTPUT);
249
- if (tradeType == TradeType.EXACT_INPUT) {
250
- planner.addCommand(CommandType.V3_SWAP_EXACT_IN, [trade.outputAmount.currency.isNative ? NARWHAL_ADDRESS : options.recipient, trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), path, payerIsUser]);
251
- } else if (tradeType == TradeType.EXACT_OUTPUT) {
252
- planner.addCommand(CommandType.V3_SWAP_EXACT_OUT, [trade.outputAmount.currency.isNative ? NARWHAL_ADDRESS : options.recipient, trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), path, payerIsUser]);
253
- }
254
- }
255
- // encode a mixed route swap, i.e. including both v2 and v3 pools
256
- function addMixedSwap(planner, swap, tradeType, options, payerIsUser) {
257
- var route = swap.route,
258
- inputAmount = swap.inputAmount,
259
- outputAmount = swap.outputAmount;
260
- // single hop, so it can be reduced to plain v2 or v3 swap logic
261
- if (route.pools.length === 1) {
262
- if (route.pools[0] instanceof Pool) {
263
- return addV3Swap(planner, swap, tradeType, options, payerIsUser);
264
- } else if (route.pools[0] instanceof Pair) {
265
- return addV2Swap(planner, swap, tradeType, options, payerIsUser);
266
- } else {
267
- throw new Error('Invalid route type');
268
- }
269
- }
270
- var trade = MixedRouteTrade.createUncheckedTrade({
271
- route: route,
272
- inputAmount: inputAmount,
273
- outputAmount: outputAmount,
274
- tradeType: tradeType
275
- });
276
- var amountIn = trade.maximumAmountIn(options.slippageTolerance, inputAmount).quotient.toString();
277
- var amountOut = trade.minimumAmountOut(options.slippageTolerance, outputAmount).quotient.toString();
278
- // logic from
279
- // https://github.com/Uniswap/router-sdk/blob/d8eed164e6c79519983844ca8b6a3fc24ebcb8f8/src/swapRouter.ts#L276
280
- var sections = partitionMixedRouteByProtocol(route);
281
- var isLastSectionInRoute = function isLastSectionInRoute(i) {
282
- return i === sections.length - 1;
283
- };
284
- var outputToken;
285
- var inputToken = route.input.wrapped;
286
- for (var i = 0; i < sections.length; i++) {
287
- var section = sections[i];
288
- /// Now, we get output of this section
289
- outputToken = getOutputOfPools(section, inputToken);
290
- var newRouteOriginal = new MixedRouteSDK([].concat(section), section[0].token0.equals(inputToken) ? section[0].token0 : section[0].token1, outputToken);
291
- var newRoute = new MixedRoute(newRouteOriginal);
292
- /// Previous output is now input
293
- inputToken = outputToken;
294
- var mixedRouteIsAllV3 = function mixedRouteIsAllV3(route) {
295
- return route.pools.every(function (pool) {
296
- return pool instanceof Pool;
297
- });
298
- };
299
- if (mixedRouteIsAllV3(newRoute)) {
300
- var path = encodeMixedRouteToPath(newRoute);
301
- // if output is native we keep tokens in the router for unwrap
302
- var recipient = isLastSectionInRoute(i) ? trade.outputAmount.currency.isNative ? NARWHAL_ADDRESS : options.recipient :
303
- // send tokens directly to the first v2 pair of the next section
304
- // note: because of the partitioning function we can be sure that the next section is v2
305
- sections[i + 1][0].liquidityToken.address;
306
- planner.addCommand(CommandType.V3_SWAP_EXACT_IN, [recipient, i == 0 ? amountIn : CONTRACT_BALANCE, !isLastSectionInRoute(i) ? 0 : amountOut, path, payerIsUser && i === 0]);
307
- } else {
308
- planner.addCommand(CommandType.V2_SWAP_EXACT_IN, [i === 0 ? amountIn : CONTRACT_BALANCE, !isLastSectionInRoute(i) ? 0 : amountOut, newRoute.path.map(function (pool) {
309
- return pool.address;
310
- }), isLastSectionInRoute(i) && !trade.outputAmount.currency.isNative ? options.recipient : NARWHAL_ADDRESS, payerIsUser && i === 0]);
311
- }
312
- }
313
- }
314
- // if price impact is very high, there's a chance of hitting max/min prices resulting in a partial fill of the swap
315
- function riskOfPartialFill(trade) {
316
- return trade.priceImpact.greaterThan(REFUND_ETH_PRICE_IMPACT_THRESHOLD);
317
- }
318
- // Checks whether a given trade object is a router-sdk RouterTrade
319
- // simple instanceof check might not work for dependent packages
320
- function isRouterTrade(trade) {
321
- return trade instanceof Trade$2 || !Array.isArray(trade) && trade.hasOwnProperty('routes');
322
- }
323
-
324
- var abi = [
325
- {
326
- inputs: [
327
- {
328
- internalType: "uint256",
329
- name: "deadline",
330
- type: "uint256"
331
- }
332
- ],
333
- name: "AllowanceExpired",
334
- type: "error"
335
- },
336
- {
337
- inputs: [
338
- ],
339
- name: "ExcessiveInvalidation",
340
- type: "error"
341
- },
342
- {
343
- inputs: [
344
- {
345
- internalType: "uint256",
346
- name: "amount",
347
- type: "uint256"
348
- }
349
- ],
350
- name: "InsufficientAllowance",
351
- type: "error"
352
- },
353
- {
354
- inputs: [
355
- {
356
- internalType: "uint256",
357
- name: "maxAmount",
358
- type: "uint256"
359
- }
360
- ],
361
- name: "InvalidAmount",
362
- type: "error"
363
- },
364
- {
365
- inputs: [
366
- ],
367
- name: "InvalidContractSignature",
368
- type: "error"
369
- },
370
- {
371
- inputs: [
372
- ],
373
- name: "InvalidNonce",
374
- type: "error"
375
- },
376
- {
377
- inputs: [
378
- ],
379
- name: "InvalidSignature",
380
- type: "error"
381
- },
382
- {
383
- inputs: [
384
- ],
385
- name: "InvalidSignatureLength",
386
- type: "error"
387
- },
388
- {
389
- inputs: [
390
- ],
391
- name: "InvalidSigner",
392
- type: "error"
393
- },
394
- {
395
- inputs: [
396
- ],
397
- name: "LengthMismatch",
398
- type: "error"
399
- },
400
- {
401
- inputs: [
402
- ],
403
- name: "NotSpender",
404
- type: "error"
405
- },
406
- {
407
- inputs: [
408
- {
409
- internalType: "uint256",
410
- name: "signatureDeadline",
411
- type: "uint256"
412
- }
413
- ],
414
- name: "SignatureExpired",
415
- type: "error"
416
- },
417
- {
418
- anonymous: false,
419
- inputs: [
420
- {
421
- indexed: true,
422
- internalType: "address",
423
- name: "owner",
424
- type: "address"
425
- },
426
- {
427
- indexed: true,
428
- internalType: "address",
429
- name: "token",
430
- type: "address"
431
- },
432
- {
433
- indexed: true,
434
- internalType: "address",
435
- name: "spender",
436
- type: "address"
437
- },
438
- {
439
- indexed: false,
440
- internalType: "uint160",
441
- name: "amount",
442
- type: "uint160"
443
- },
444
- {
445
- indexed: false,
446
- internalType: "uint48",
447
- name: "expiration",
448
- type: "uint48"
449
- }
450
- ],
451
- name: "Approval",
452
- type: "event"
453
- },
454
- {
455
- anonymous: false,
456
- inputs: [
457
- {
458
- indexed: true,
459
- internalType: "address",
460
- name: "owner",
461
- type: "address"
462
- },
463
- {
464
- indexed: false,
465
- internalType: "address",
466
- name: "token",
467
- type: "address"
468
- },
469
- {
470
- indexed: false,
471
- internalType: "address",
472
- name: "spender",
473
- type: "address"
474
- }
475
- ],
476
- name: "Lockdown",
477
- type: "event"
478
- },
479
- {
480
- anonymous: false,
481
- inputs: [
482
- {
483
- indexed: true,
484
- internalType: "address",
485
- name: "owner",
486
- type: "address"
487
- },
488
- {
489
- indexed: true,
490
- internalType: "address",
491
- name: "token",
492
- type: "address"
493
- },
494
- {
495
- indexed: true,
496
- internalType: "address",
497
- name: "spender",
498
- type: "address"
499
- },
500
- {
501
- indexed: false,
502
- internalType: "uint48",
503
- name: "newNonce",
504
- type: "uint48"
505
- },
506
- {
507
- indexed: false,
508
- internalType: "uint48",
509
- name: "oldNonce",
510
- type: "uint48"
511
- }
512
- ],
513
- name: "NonceInvalidation",
514
- type: "event"
515
- },
516
- {
517
- anonymous: false,
518
- inputs: [
519
- {
520
- indexed: true,
521
- internalType: "address",
522
- name: "owner",
523
- type: "address"
524
- },
525
- {
526
- indexed: false,
527
- internalType: "uint256",
528
- name: "word",
529
- type: "uint256"
530
- },
531
- {
532
- indexed: false,
533
- internalType: "uint256",
534
- name: "mask",
535
- type: "uint256"
536
- }
537
- ],
538
- name: "UnorderedNonceInvalidation",
539
- type: "event"
540
- },
541
- {
542
- inputs: [
543
- ],
544
- name: "DOMAIN_SEPARATOR",
545
- outputs: [
546
- {
547
- internalType: "bytes32",
548
- name: "",
549
- type: "bytes32"
550
- }
551
- ],
552
- stateMutability: "view",
553
- type: "function"
554
- },
555
- {
556
- inputs: [
557
- {
558
- internalType: "address",
559
- name: "",
560
- type: "address"
561
- },
562
- {
563
- internalType: "address",
564
- name: "",
565
- type: "address"
566
- },
567
- {
568
- internalType: "address",
569
- name: "",
570
- type: "address"
571
- }
572
- ],
573
- name: "allowance",
574
- outputs: [
575
- {
576
- internalType: "uint160",
577
- name: "amount",
578
- type: "uint160"
579
- },
580
- {
581
- internalType: "uint48",
582
- name: "expiration",
583
- type: "uint48"
584
- },
585
- {
586
- internalType: "uint48",
587
- name: "nonce",
588
- type: "uint48"
589
- }
590
- ],
591
- stateMutability: "view",
592
- type: "function"
593
- },
594
- {
595
- inputs: [
596
- {
597
- internalType: "address",
598
- name: "token",
599
- type: "address"
600
- },
601
- {
602
- internalType: "address",
603
- name: "spender",
604
- type: "address"
605
- },
606
- {
607
- internalType: "uint160",
608
- name: "amount",
609
- type: "uint160"
610
- },
611
- {
612
- internalType: "uint48",
613
- name: "expiration",
614
- type: "uint48"
615
- }
616
- ],
617
- name: "approve",
618
- outputs: [
619
- ],
620
- stateMutability: "nonpayable",
621
- type: "function"
622
- },
623
- {
624
- inputs: [
625
- {
626
- internalType: "address",
627
- name: "token",
628
- type: "address"
629
- },
630
- {
631
- internalType: "address",
632
- name: "spender",
633
- type: "address"
634
- },
635
- {
636
- internalType: "uint48",
637
- name: "newNonce",
638
- type: "uint48"
639
- }
640
- ],
641
- name: "invalidateNonces",
642
- outputs: [
643
- ],
644
- stateMutability: "nonpayable",
645
- type: "function"
646
- },
647
- {
648
- inputs: [
649
- {
650
- internalType: "uint256",
651
- name: "wordPos",
652
- type: "uint256"
653
- },
654
- {
655
- internalType: "uint256",
656
- name: "mask",
657
- type: "uint256"
658
- }
659
- ],
660
- name: "invalidateUnorderedNonces",
661
- outputs: [
662
- ],
663
- stateMutability: "nonpayable",
664
- type: "function"
665
- },
666
- {
667
- inputs: [
668
- {
669
- components: [
670
- {
671
- internalType: "address",
672
- name: "token",
673
- type: "address"
674
- },
675
- {
676
- internalType: "address",
677
- name: "spender",
678
- type: "address"
679
- }
680
- ],
681
- internalType: "struct IAllowanceTransfer.TokenSpenderPair[]",
682
- name: "approvals",
683
- type: "tuple[]"
684
- }
685
- ],
686
- name: "lockdown",
687
- outputs: [
688
- ],
689
- stateMutability: "nonpayable",
690
- type: "function"
691
- },
692
- {
693
- inputs: [
694
- {
695
- internalType: "address",
696
- name: "",
697
- type: "address"
698
- },
699
- {
700
- internalType: "uint256",
701
- name: "",
702
- type: "uint256"
703
- }
704
- ],
705
- name: "nonceBitmap",
706
- outputs: [
707
- {
708
- internalType: "uint256",
709
- name: "",
710
- type: "uint256"
711
- }
712
- ],
713
- stateMutability: "view",
714
- type: "function"
715
- },
716
- {
717
- inputs: [
718
- {
719
- internalType: "address",
720
- name: "owner",
721
- type: "address"
722
- },
723
- {
724
- components: [
725
- {
726
- components: [
727
- {
728
- internalType: "address",
729
- name: "token",
730
- type: "address"
731
- },
732
- {
733
- internalType: "uint160",
734
- name: "amount",
735
- type: "uint160"
736
- },
737
- {
738
- internalType: "uint48",
739
- name: "expiration",
740
- type: "uint48"
741
- },
742
- {
743
- internalType: "uint48",
744
- name: "nonce",
745
- type: "uint48"
746
- }
747
- ],
748
- internalType: "struct IAllowanceTransfer.PermitDetails[]",
749
- name: "details",
750
- type: "tuple[]"
751
- },
752
- {
753
- internalType: "address",
754
- name: "spender",
755
- type: "address"
756
- },
757
- {
758
- internalType: "uint256",
759
- name: "sigDeadline",
760
- type: "uint256"
761
- }
762
- ],
763
- internalType: "struct IAllowanceTransfer.PermitBatch",
764
- name: "permitBatch",
765
- type: "tuple"
766
- },
767
- {
768
- internalType: "bytes",
769
- name: "signature",
770
- type: "bytes"
771
- }
772
- ],
773
- name: "permit",
774
- outputs: [
775
- ],
776
- stateMutability: "nonpayable",
777
- type: "function"
778
- },
779
- {
780
- inputs: [
781
- {
782
- internalType: "address",
783
- name: "owner",
784
- type: "address"
785
- },
786
- {
787
- components: [
788
- {
789
- components: [
790
- {
791
- internalType: "address",
792
- name: "token",
793
- type: "address"
794
- },
795
- {
796
- internalType: "uint160",
797
- name: "amount",
798
- type: "uint160"
799
- },
800
- {
801
- internalType: "uint48",
802
- name: "expiration",
803
- type: "uint48"
804
- },
805
- {
806
- internalType: "uint48",
807
- name: "nonce",
808
- type: "uint48"
809
- }
810
- ],
811
- internalType: "struct IAllowanceTransfer.PermitDetails",
812
- name: "details",
813
- type: "tuple"
814
- },
815
- {
816
- internalType: "address",
817
- name: "spender",
818
- type: "address"
819
- },
820
- {
821
- internalType: "uint256",
822
- name: "sigDeadline",
823
- type: "uint256"
824
- }
825
- ],
826
- internalType: "struct IAllowanceTransfer.PermitSingle",
827
- name: "permitSingle",
828
- type: "tuple"
829
- },
830
- {
831
- internalType: "bytes",
832
- name: "signature",
833
- type: "bytes"
834
- }
835
- ],
836
- name: "permit",
837
- outputs: [
838
- ],
839
- stateMutability: "nonpayable",
840
- type: "function"
841
- },
842
- {
843
- inputs: [
844
- {
845
- components: [
846
- {
847
- components: [
848
- {
849
- internalType: "address",
850
- name: "token",
851
- type: "address"
852
- },
853
- {
854
- internalType: "uint256",
855
- name: "amount",
856
- type: "uint256"
857
- }
858
- ],
859
- internalType: "struct ISignatureTransfer.TokenPermissions[]",
860
- name: "permitted",
861
- type: "tuple[]"
862
- },
863
- {
864
- internalType: "uint256",
865
- name: "nonce",
866
- type: "uint256"
867
- },
868
- {
869
- internalType: "uint256",
870
- name: "deadline",
871
- type: "uint256"
872
- }
873
- ],
874
- internalType: "struct ISignatureTransfer.PermitBatchTransferFrom",
875
- name: "permit",
876
- type: "tuple"
877
- },
878
- {
879
- internalType: "address",
880
- name: "owner",
881
- type: "address"
882
- },
883
- {
884
- components: [
885
- {
886
- internalType: "address",
887
- name: "to",
888
- type: "address"
889
- },
890
- {
891
- internalType: "uint256",
892
- name: "requestedAmount",
893
- type: "uint256"
894
- }
895
- ],
896
- internalType: "struct ISignatureTransfer.SignatureTransferDetails[]",
897
- name: "transferDetails",
898
- type: "tuple[]"
899
- },
900
- {
901
- internalType: "bytes",
902
- name: "signature",
903
- type: "bytes"
904
- }
905
- ],
906
- name: "permitTransferFrom",
907
- outputs: [
908
- ],
909
- stateMutability: "nonpayable",
910
- type: "function"
911
- },
912
- {
913
- inputs: [
914
- {
915
- components: [
916
- {
917
- components: [
918
- {
919
- internalType: "address",
920
- name: "token",
921
- type: "address"
922
- },
923
- {
924
- internalType: "uint256",
925
- name: "amount",
926
- type: "uint256"
927
- }
928
- ],
929
- internalType: "struct ISignatureTransfer.TokenPermissions",
930
- name: "permitted",
931
- type: "tuple"
932
- },
933
- {
934
- internalType: "uint256",
935
- name: "nonce",
936
- type: "uint256"
937
- },
938
- {
939
- internalType: "uint256",
940
- name: "deadline",
941
- type: "uint256"
942
- }
943
- ],
944
- internalType: "struct ISignatureTransfer.PermitTransferFrom",
945
- name: "permit",
946
- type: "tuple"
947
- },
948
- {
949
- internalType: "address",
950
- name: "owner",
951
- type: "address"
952
- },
953
- {
954
- internalType: "address",
955
- name: "to",
956
- type: "address"
957
- },
958
- {
959
- internalType: "uint256",
960
- name: "requestedAmount",
961
- type: "uint256"
962
- },
963
- {
964
- internalType: "bytes",
965
- name: "signature",
966
- type: "bytes"
967
- }
968
- ],
969
- name: "permitTransferFrom",
970
- outputs: [
971
- ],
972
- stateMutability: "nonpayable",
973
- type: "function"
974
- },
975
- {
976
- inputs: [
977
- {
978
- components: [
979
- {
980
- components: [
981
- {
982
- internalType: "address",
983
- name: "token",
984
- type: "address"
985
- },
986
- {
987
- internalType: "uint256",
988
- name: "amount",
989
- type: "uint256"
990
- }
991
- ],
992
- internalType: "struct ISignatureTransfer.TokenPermissions[]",
993
- name: "permitted",
994
- type: "tuple[]"
995
- },
996
- {
997
- internalType: "uint256",
998
- name: "nonce",
999
- type: "uint256"
1000
- },
1001
- {
1002
- internalType: "uint256",
1003
- name: "deadline",
1004
- type: "uint256"
1005
- }
1006
- ],
1007
- internalType: "struct ISignatureTransfer.PermitBatchTransferFrom",
1008
- name: "permit",
1009
- type: "tuple"
1010
- },
1011
- {
1012
- internalType: "address",
1013
- name: "owner",
1014
- type: "address"
1015
- },
1016
- {
1017
- components: [
1018
- {
1019
- internalType: "address",
1020
- name: "to",
1021
- type: "address"
1022
- },
1023
- {
1024
- internalType: "uint256",
1025
- name: "requestedAmount",
1026
- type: "uint256"
1027
- }
1028
- ],
1029
- internalType: "struct ISignatureTransfer.SignatureTransferDetails[]",
1030
- name: "transferDetails",
1031
- type: "tuple[]"
1032
- },
1033
- {
1034
- internalType: "bytes32",
1035
- name: "witness",
1036
- type: "bytes32"
1037
- },
1038
- {
1039
- internalType: "string",
1040
- name: "witnessTypeString",
1041
- type: "string"
1042
- },
1043
- {
1044
- internalType: "bytes",
1045
- name: "signature",
1046
- type: "bytes"
1047
- }
1048
- ],
1049
- name: "permitWitnessTransferFrom",
1050
- outputs: [
1051
- ],
1052
- stateMutability: "nonpayable",
1053
- type: "function"
1054
- },
1055
- {
1056
- inputs: [
1057
- {
1058
- components: [
1059
- {
1060
- components: [
1061
- {
1062
- internalType: "address",
1063
- name: "token",
1064
- type: "address"
1065
- },
1066
- {
1067
- internalType: "uint256",
1068
- name: "amount",
1069
- type: "uint256"
1070
- }
1071
- ],
1072
- internalType: "struct ISignatureTransfer.TokenPermissions",
1073
- name: "permitted",
1074
- type: "tuple"
1075
- },
1076
- {
1077
- internalType: "uint256",
1078
- name: "nonce",
1079
- type: "uint256"
1080
- },
1081
- {
1082
- internalType: "uint256",
1083
- name: "deadline",
1084
- type: "uint256"
1085
- }
1086
- ],
1087
- internalType: "struct ISignatureTransfer.PermitTransferFrom",
1088
- name: "permit",
1089
- type: "tuple"
1090
- },
1091
- {
1092
- internalType: "address",
1093
- name: "owner",
1094
- type: "address"
1095
- },
1096
- {
1097
- internalType: "address",
1098
- name: "to",
1099
- type: "address"
1100
- },
1101
- {
1102
- internalType: "uint256",
1103
- name: "requestedAmount",
1104
- type: "uint256"
1105
- },
1106
- {
1107
- internalType: "bytes32",
1108
- name: "witness",
1109
- type: "bytes32"
1110
- },
1111
- {
1112
- internalType: "string",
1113
- name: "witnessTypeString",
1114
- type: "string"
1115
- },
1116
- {
1117
- internalType: "bytes",
1118
- name: "signature",
1119
- type: "bytes"
1120
- }
1121
- ],
1122
- name: "permitWitnessTransferFrom",
1123
- outputs: [
1124
- ],
1125
- stateMutability: "nonpayable",
1126
- type: "function"
1127
- },
1128
- {
1129
- inputs: [
1130
- {
1131
- components: [
1132
- {
1133
- internalType: "address",
1134
- name: "from",
1135
- type: "address"
1136
- },
1137
- {
1138
- internalType: "address",
1139
- name: "to",
1140
- type: "address"
1141
- },
1142
- {
1143
- internalType: "uint160",
1144
- name: "amount",
1145
- type: "uint160"
1146
- },
1147
- {
1148
- internalType: "address",
1149
- name: "token",
1150
- type: "address"
1151
- }
1152
- ],
1153
- internalType: "struct IAllowanceTransfer.AllowanceTransferDetails[]",
1154
- name: "transferDetails",
1155
- type: "tuple[]"
1156
- }
1157
- ],
1158
- name: "transferFrom",
1159
- outputs: [
1160
- ],
1161
- stateMutability: "nonpayable",
1162
- type: "function"
1163
- },
1164
- {
1165
- inputs: [
1166
- {
1167
- internalType: "address",
1168
- name: "from",
1169
- type: "address"
1170
- },
1171
- {
1172
- internalType: "address",
1173
- name: "to",
1174
- type: "address"
1175
- },
1176
- {
1177
- internalType: "uint160",
1178
- name: "amount",
1179
- type: "uint160"
1180
- },
1181
- {
1182
- internalType: "address",
1183
- name: "token",
1184
- type: "address"
1185
- }
1186
- ],
1187
- name: "transferFrom",
1188
- outputs: [
1189
- ],
1190
- stateMutability: "nonpayable",
1191
- type: "function"
1192
- }
1193
- ];
1194
- var bytecode = {
1195
- object: "0x60c0346100bb574660a052602081017f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681527f9ac997416e8ff9d2ff6bebeb7149f65cdae5e32e2b90440b566bb3044041d36a60408301524660608301523060808301526080825260a082019180831060018060401b038411176100a55782604052519020608052611b8e90816100c18239608051816114dd015260a051816114b70152f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe6040608081526004908136101561001557600080fd5b600091823560e01c80630d58b1db14610ea95780632389609614610d975780632a2d80d114610b295780632b67b570146109b65780633644e5151461099257806336c78516146109455780633ff9dcb1146108e45780634fe02b44146108a457806365d9723c146107955780637d4a8c52146106df57806387517c45146105df578063927da10514610563578063b0468e7714610347578063cc53287f146102635763eb76df79146100c657600080fd5b3461025f5761014036600319011261025f576100e136611233565b6100e961108a565b926100f2611074565b6001600160401b03946101043586811161025b5761011390369087016111f3565b610124959195359788116102575761013461024797610254993691016111f3565b97909686519061014382610fd5565b606482527f5065726d69745769746e6573735472616e7366657246726f6d28546f6b656e5060208301527f65726d697373696f6e73207065726d69747465642c6164647265737320737065888301527f6e6465722c75696e74323536206e6f6e63652c75696e7432353620646561646c6060830152631a5b994b60e21b60808301528751938491816101d96020850180966117f3565b918237018c815203926101f4601f199485810183528261100b565b5190209161020284516118a5565b6020858101518987015199519182019586526040820192909252336060820152608081019190915260a081019790975260e43560c088015260e090810187528661100b565b60c43594519020906115a0565b80f35b8880fd5b8780fd5b8280fd5b503461025f5760209081600319360112610343578035906001600160401b03821161033f57610294913691016111c3565b929091845b8481106102a4578580f35b806102ba6102b5600193888861138b565b61139b565b6102cf846102c9848a8a61138b565b0161139b565b33895283855285892091848060a01b0380911692838b528652868a20911690818a5285528589206bffffffffffffffffffffffff60a01b81541690558551918252848201527f89b1add15eff56b3dfe299ad94e01f2b52fbcb80ae1a3baea6ae8c04cb2b98a4853392a201610299565b8480fd5b8380fd5b5091903461055f5760c036600319011261055f576001600160401b0383358181116103435761037990369086016110ca565b93610382611043565b9060443583811161055b5761039a90369083016111c3565b92909160843585811161025b576103b490369083016111f3565b91909560a435908111610257576103cd913691016111f3565b9690958151906103dc82610fd5565b606b82527f5065726d697442617463685769746e6573735472616e7366657246726f6d285460208301527f6f6b656e5065726d697373696f6e735b5d207065726d69747465642c61646472838301527f657373207370656e6465722c75696e74323536206e6f6e63652c75696e74323560608301526a0d88191958591b1a5b994b60aa1b60808301528251938491816104796020850180966117f3565b918237018a81520392610494601f199485810183528261100b565b519020918951516104a48161176f565b908a5b81811061052d5750508291610524916102549b9c9594516104dc816104d06020820180956117c6565b0384810183528261100b565b5190206020868101518588015195519182019687526040820192909252336060820152608081019190915260a081019390935260643560c084015260e090810183528261100b565b51902090611623565b806105466105408f93610556945161129e565b516118a5565b610550828661129e565b526117a1565b6104a7565b8580fd5b5080fd5b50503461055f57606036600319011261055f57908160609261058361105e565b9261058c611043565b6105946110a0565b9060018060a01b03809616835260016020528584842091168352602052848383209116825260205220548151928116835265ffffffffffff8160a01c16602084015260d01c90820152f35b50503461055f57608036600319011261055f576105fa61105e565b610602611043565b9161060b6110a0565b906064359265ffffffffffff938481169283820361025b577fda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b936106d193338a526001602052828a209760018060a01b0380921698898c5260205281848c209a16998a8c52602052838b2092156000146106d7574216905b82546001600160d01b03191660a09290921b65ffffffffffff60a01b1691909117908716179055516001600160a01b03909416845265ffffffffffff16602084015233929081906040820190565b0390a480f35b508390610683565b50903461025f5761010036600319011261025f576106fc36611233565b61070461108a565b9161070d611074565b60e4356001600160401b038111610791576102549561072e913691016111f3565b94909361073b81516118a5565b936020820151818301519082519660208801937f939c21a48a8dbe3a9a2404a1d46691e4d39f6583d6ec6b35714604c986d801068552880152336060880152608087015260a086015260a0855261024785610ff0565b8680fd5b503461025f57606036600319011261025f576107af61105e565b906107b8611043565b9265ffffffffffff604435818116939084810361025b57338852602091600183528489209660018060a01b0380911697888b528452858a20981697888a5283528489205460d01c93848711156108955761ffff90858403161161088757503380895260018352848920878a528352848920888a52835284892080546001600160d01b031660d09390931b6001600160d01b03191692909217909155835194855290840191909152917f55eb90d810e1700b35a8e7e25395ff7f2b2259abd7415ca2284dfb1c246418f39190a480f35b8451631269ad1360e11b8152fd5b508451633ab3447f60e11b8152fd5b50503461055f578060031936011261055f5760209181906001600160a01b036108cb61105e565b1681528084528181206024358252845220549051908152f35b503461025f578160031936011261025f577f3704902f963766a4e561bbaab6e6cdc1b1dd12f6e9e99648da8843b3f46b918d90359160243533855284602052818520848652602052818520818154179055815193845260208401523392a280f35b833461098f57608036600319011261098f5761095f61105e565b610967611043565b61096f6110a0565b606435929091906001600160a01b038416840361033f57610254936112c8565b80fd5b50503461055f578160031936011261055f576020906109af6114b4565b9051908152f35b5082903461055f5761010036600319011261055f576109d361105e565b366023190160c081126103435760808551916109ee83610fba565b12610343578451906109ff82610f89565b6001600160a01b03916024358381168103610791578152604435838116810361079157602082015265ffffffffffff606435818116810361025b578883015260843590811681036107915760608201528152610a59611074565b936020820194855260c4359087830182815260e4356001600160401b03811161025757610a8990369084016111f3565b929093804211610b13575050918591610b03610254999a610b0995610aae885161181e565b90898c511690519083519260208401947ff3841cd1ff0085026a6327b620b67997ce40f282c88a8e905a7a5626e310f3d086528401526060830152608082015260808152610afb81610fd5565b51902061156f565b9161190a565b51925116916113af565b8a5163cd21db4f60e01b81529182015260249150fd5b5082903461055f57606060031993818536011261034357610b4861105e565b926024908135926001600160401b039788851161025b57859085360301126107915780519785890189811082821117610d85578252848301358181116102575785019036602383011215610257578382013591610ba48361102c565b90610bb18551928361100b565b838252602093878584019160071b83010191368311610d81578801905b828210610d24575050508a526044610be78688016110b6565b96838c01978852013594838b0191868352604435908111610d2057610c0f90369087016111f3565b959096804211610d0e575050508998995151610c2a8161176f565b908b5b818110610ceb57505092889492610b0392610cb897958351610c6481610c5686820180956117c6565b03601f19810183528261100b565b5190209060018060a01b039a8b8b51169151928551948501957faf1b0d30d2cab0380e68f0689007e3254993c596f2fdd0aaa7f4d04f794408638752850152830152608082015260808152610afb81610fd5565b51169082515192845b848110610ccc578580f35b80610ce58585610cdf600195875161129e565b516113af565b01610cc1565b80610546610d008e9f9e93610d06945161129e565b5161181e565b9b9a9b610c2d565b855163cd21db4f60e01b815291820152fd5b8a80fd5b608082360312610d8157856080918851610d3d81610f89565b610d46856110b6565b8152610d538386016110b6565b83820152610d628a8601611220565b8a8201528d610d72818701611220565b90820152815201910190610bce565b8c80fd5b634e487b7160e01b8952604184528489fd5b5091903461055f57608036600319011261055f576001600160401b0390833582811161034357610dca90369086016110ca565b93610dd3611043565b9260443581811161055b57610deb90369084016111c3565b92909160643590811161079157610e04913691016111f3565b949093875151610e138161176f565b90885b818110610e92575050906102549798918151610e3a81610c566020820180956117c6565b5190206020830151828401519083519260208401947ffcf35f5ac6a2c28868dc44c302166470266239195f02b0ee408334829333b7668652840152336060840152608083015260a082015260a0815261052481610ff0565b80610546610540610ea4938e5161129e565b610e16565b503461025f57602091826003193601126103435781356001600160401b039283821161055b573660238301121561055b5781013592831161033f576024906007368386831b8401011161079157865b858110610f03578780f35b80821b8301906080602319833603011261025757610f83886001936060898051610f2c81610f89565b610f686084610f3c8d87016110b6565b95868452610f4c604482016110b6565b8098850152610f5d606482016110b6565b8095850152016110b6565b9283910152868060a01b0380808093169516931691166112c8565b01610ef8565b608081019081106001600160401b03821117610fa457604052565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b03821117610fa457604052565b60a081019081106001600160401b03821117610fa457604052565b60c081019081106001600160401b03821117610fa457604052565b90601f801991011681019081106001600160401b03821117610fa457604052565b6001600160401b038111610fa45760051b60200190565b602435906001600160a01b038216820361105957565b600080fd5b600435906001600160a01b038216820361105957565b60a435906001600160a01b038216820361105957565b608435906001600160a01b038216820361105957565b604435906001600160a01b038216820361105957565b35906001600160a01b038216820361105957565b9190916060818403126110595760408051916110e583610fba565b829481356001600160401b039081811161105957830182601f820112156110595780356111118161102c565b9261111e8751948561100b565b818452602094858086019360061b85010193818511611059579086899897969594939201925b848410611161575050505050855280820135908501520135910152565b9091929394959697848303126110595788519089820190828210858311176111ae578a9289928452611192876110b6565b8152828701358382015281520193019190889796959493611144565b60246000634e487b7160e01b81526041600452fd5b9181601f84011215611059578235916001600160401b038311611059576020808501948460061b01011161105957565b9181601f84011215611059578235916001600160401b038311611059576020838186019501011161105957565b359065ffffffffffff8216820361105957565b60031901906080821261105957604080519061124e82610fba565b808294126110595780518181018181106001600160401b03821117610fa45782526004356001600160a01b0381168103611059578152602435602082015282526044356020830152606435910152565b80518210156112b25760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b919060018060a01b03604060008284168152600160205282828220961695868252602052818120338252602052209485549565ffffffffffff8760a01c1680421161137357508287169683880361132a575b505061132895501692611adc565b565b878484161160001461134f5760405163f96fb07160e01b815260048101899052602490fd5b8383611328990316906bffffffffffffffffffffffff60a01b16179055388061131a565b60249060405190636c0d979760e11b82526004820152fd5b91908110156112b25760061b0190565b356001600160a01b03811681036110595790565b9065ffffffffffff908160608401511660018060a01b03938481511694806020830151169281866040809501511695169560009287845260016020528484208985526020528484209916988984526020528383209282845460d01c036114a3579480949261149794927fda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b989750871560001461149c5742165b600190910160d01b6001600160d01b03191660a09190911b65ffffffffffff60a01b1617179055516001600160a01b03909216825265ffffffffffff9290921660208201529081906040820190565b0390a4565b5086611448565b8451633ab3447f60e11b8152600490fd5b467f0000000000000000000000000000000000000000000000000000000000000000036114ff577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86682527f9ac997416e8ff9d2ff6bebeb7149f65cdae5e32e2b90440b566bb3044041d36a60408201524660608201523060808201526080815261156981610fd5565b51902090565b6115776114b4565b9060405190602082019261190160f01b8452602283015260428201526042815261156981610f89565b91929394969590604083015180421161160b57506020835101518087116115f3575061132896976115e392610b0386936115de602088015186611721565b61156f565b51516001600160a01b0316611adc565b60249060405190633728b83d60e01b82526004820152fd5b6024906040519063cd21db4f60e01b82526004820152fd5b95909593919293805151956040928383015180421161170a57508488036116f65761165d918691610b0360209b6115de8d88015186611721565b60005b868110611671575050505050505050565b61167c81835161129e565b518861168983878a61138b565b013590898101518083116116df5750918188888860019685966116b3575b50505050505001611660565b6116d4956116ce926102b5928a8060a01b039051169561138b565b91611adc565b8038888888836116a7565b602490865190633728b83d60e01b82526004820152fd5b83516001621398b960e31b03198152600490fd5b60249085519063cd21db4f60e01b82526004820152fd5b90600160ff82161b9160018060a01b0316600052600060205260406000209060081c600052602052604060002081815418809155161561175d57565b604051633ab3447f60e11b8152600490fd5b906117798261102c565b611786604051918261100b565b8281528092611797601f199161102c565b0190602036910137565b60001981146117b05760010190565b634e487b7160e01b600052601160045260246000fd5b805160208092019160005b8281106117df575050505090565b8351855293810193928101926001016117d1565b9081519160005b83811061180b575050016000815290565b80602080928401015181850152016117fa565b60405160208101917f65626cad6cb96493bf6f5ebea28756c966f023ab9e8a83a7101849d5573b3678835260018060a01b038082511660408401526020820151166060830152606065ffffffffffff9182604082015116608085015201511660a082015260a0815260c081018181106001600160401b03821117610fa45760405251902090565b6040516020808201927f618358ac3db8dc274f0cd8829da7e234bd48cd73c4a740aede1adec9846d06a1845260018060a01b038151166040840152015160608201526060815261156981610f89565b9190826040910312611059576020823592013590565b6000843b611a035750604182036119b357611927828201826118f4565b939092604010156112b25760209360009360ff6040608095013560f81c5b60405194855216868401526040830152606082015282805260015afa156119a7576000516001600160a01b0390811691821561199557160361198357565b604051632057875960e21b8152600490fd5b604051638baa579f60e01b8152600490fd5b6040513d6000823e3d90fd5b604082036119f1576119c7918101906118f4565b6001600160ff1b0381169260ff91821c601b019182116117b05760209360009360ff608094611945565b604051634be6321b60e01b8152600490fd5b918093946020926064604051809781958294630b135d3f60e11b9b8c8552600485015260406024850152816044850152848401378181018301889052601f01601f191681010301916001600160a01b03165afa918215611acf578192611a89575b50506001600160e01b03191603611a7757565b604051632c19a72f60e21b8152600490fd5b9091506020813d8211611ac7575b81611aa46020938361100b565b8101031261055f5751906001600160e01b03198216820361098f57503880611a64565b3d9150611a97565b50604051903d90823e3d90fd5b9060006064926020958295604051946323b872dd60e01b86526004860152602485015260448401525af13d15601f3d1160016000511416171615611b1c57565b60405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606490fdfea26469706673582212201c55c56fb05ff96a2b5d5b14227f19373707c4389af7e87c18375c2033b1d0e164736f6c63430008110033",
1196
- sourceMap: "176:59:16:-:0;;;;856:13:15;837:32;;1560:60;;;726:80;176:59:16;;654:20:15;176:59:16;;;;856:13:15;176:59:16;;;;1614:4:15;176:59:16;;;;;1560:60:15;;837:32;176:59:16;;;;;;;;;;;;;;;;;;;;1550:71:15;;176:59:16;879:74:15;176:59:16;;;;;;;;;;;;837:32:15;176:59:16;;;;;;;;;;-1:-1:-1;176:59:16;;;;;-1:-1:-1;176:59:16;;;;",
1197
- linkReferences: {
1198
- }
1199
- };
1200
- var deployedBytecode = {
1201
- object: "0x6040608081526004908136101561001557600080fd5b600091823560e01c80630d58b1db14610ea95780632389609614610d975780632a2d80d114610b295780632b67b570146109b65780633644e5151461099257806336c78516146109455780633ff9dcb1146108e45780634fe02b44146108a457806365d9723c146107955780637d4a8c52146106df57806387517c45146105df578063927da10514610563578063b0468e7714610347578063cc53287f146102635763eb76df79146100c657600080fd5b3461025f5761014036600319011261025f576100e136611233565b6100e961108a565b926100f2611074565b6001600160401b03946101043586811161025b5761011390369087016111f3565b610124959195359788116102575761013461024797610254993691016111f3565b97909686519061014382610fd5565b606482527f5065726d69745769746e6573735472616e7366657246726f6d28546f6b656e5060208301527f65726d697373696f6e73207065726d69747465642c6164647265737320737065888301527f6e6465722c75696e74323536206e6f6e63652c75696e7432353620646561646c6060830152631a5b994b60e21b60808301528751938491816101d96020850180966117f3565b918237018c815203926101f4601f199485810183528261100b565b5190209161020284516118a5565b6020858101518987015199519182019586526040820192909252336060820152608081019190915260a081019790975260e43560c088015260e090810187528661100b565b60c43594519020906115a0565b80f35b8880fd5b8780fd5b8280fd5b503461025f5760209081600319360112610343578035906001600160401b03821161033f57610294913691016111c3565b929091845b8481106102a4578580f35b806102ba6102b5600193888861138b565b61139b565b6102cf846102c9848a8a61138b565b0161139b565b33895283855285892091848060a01b0380911692838b528652868a20911690818a5285528589206bffffffffffffffffffffffff60a01b81541690558551918252848201527f89b1add15eff56b3dfe299ad94e01f2b52fbcb80ae1a3baea6ae8c04cb2b98a4853392a201610299565b8480fd5b8380fd5b5091903461055f5760c036600319011261055f576001600160401b0383358181116103435761037990369086016110ca565b93610382611043565b9060443583811161055b5761039a90369083016111c3565b92909160843585811161025b576103b490369083016111f3565b91909560a435908111610257576103cd913691016111f3565b9690958151906103dc82610fd5565b606b82527f5065726d697442617463685769746e6573735472616e7366657246726f6d285460208301527f6f6b656e5065726d697373696f6e735b5d207065726d69747465642c61646472838301527f657373207370656e6465722c75696e74323536206e6f6e63652c75696e74323560608301526a0d88191958591b1a5b994b60aa1b60808301528251938491816104796020850180966117f3565b918237018a81520392610494601f199485810183528261100b565b519020918951516104a48161176f565b908a5b81811061052d5750508291610524916102549b9c9594516104dc816104d06020820180956117c6565b0384810183528261100b565b5190206020868101518588015195519182019687526040820192909252336060820152608081019190915260a081019390935260643560c084015260e090810183528261100b565b51902090611623565b806105466105408f93610556945161129e565b516118a5565b610550828661129e565b526117a1565b6104a7565b8580fd5b5080fd5b50503461055f57606036600319011261055f57908160609261058361105e565b9261058c611043565b6105946110a0565b9060018060a01b03809616835260016020528584842091168352602052848383209116825260205220548151928116835265ffffffffffff8160a01c16602084015260d01c90820152f35b50503461055f57608036600319011261055f576105fa61105e565b610602611043565b9161060b6110a0565b906064359265ffffffffffff938481169283820361025b577fda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b936106d193338a526001602052828a209760018060a01b0380921698898c5260205281848c209a16998a8c52602052838b2092156000146106d7574216905b82546001600160d01b03191660a09290921b65ffffffffffff60a01b1691909117908716179055516001600160a01b03909416845265ffffffffffff16602084015233929081906040820190565b0390a480f35b508390610683565b50903461025f5761010036600319011261025f576106fc36611233565b61070461108a565b9161070d611074565b60e4356001600160401b038111610791576102549561072e913691016111f3565b94909361073b81516118a5565b936020820151818301519082519660208801937f939c21a48a8dbe3a9a2404a1d46691e4d39f6583d6ec6b35714604c986d801068552880152336060880152608087015260a086015260a0855261024785610ff0565b8680fd5b503461025f57606036600319011261025f576107af61105e565b906107b8611043565b9265ffffffffffff604435818116939084810361025b57338852602091600183528489209660018060a01b0380911697888b528452858a20981697888a5283528489205460d01c93848711156108955761ffff90858403161161088757503380895260018352848920878a528352848920888a52835284892080546001600160d01b031660d09390931b6001600160d01b03191692909217909155835194855290840191909152917f55eb90d810e1700b35a8e7e25395ff7f2b2259abd7415ca2284dfb1c246418f39190a480f35b8451631269ad1360e11b8152fd5b508451633ab3447f60e11b8152fd5b50503461055f578060031936011261055f5760209181906001600160a01b036108cb61105e565b1681528084528181206024358252845220549051908152f35b503461025f578160031936011261025f577f3704902f963766a4e561bbaab6e6cdc1b1dd12f6e9e99648da8843b3f46b918d90359160243533855284602052818520848652602052818520818154179055815193845260208401523392a280f35b833461098f57608036600319011261098f5761095f61105e565b610967611043565b61096f6110a0565b606435929091906001600160a01b038416840361033f57610254936112c8565b80fd5b50503461055f578160031936011261055f576020906109af6114b4565b9051908152f35b5082903461055f5761010036600319011261055f576109d361105e565b366023190160c081126103435760808551916109ee83610fba565b12610343578451906109ff82610f89565b6001600160a01b03916024358381168103610791578152604435838116810361079157602082015265ffffffffffff606435818116810361025b578883015260843590811681036107915760608201528152610a59611074565b936020820194855260c4359087830182815260e4356001600160401b03811161025757610a8990369084016111f3565b929093804211610b13575050918591610b03610254999a610b0995610aae885161181e565b90898c511690519083519260208401947ff3841cd1ff0085026a6327b620b67997ce40f282c88a8e905a7a5626e310f3d086528401526060830152608082015260808152610afb81610fd5565b51902061156f565b9161190a565b51925116916113af565b8a5163cd21db4f60e01b81529182015260249150fd5b5082903461055f57606060031993818536011261034357610b4861105e565b926024908135926001600160401b039788851161025b57859085360301126107915780519785890189811082821117610d85578252848301358181116102575785019036602383011215610257578382013591610ba48361102c565b90610bb18551928361100b565b838252602093878584019160071b83010191368311610d81578801905b828210610d24575050508a526044610be78688016110b6565b96838c01978852013594838b0191868352604435908111610d2057610c0f90369087016111f3565b959096804211610d0e575050508998995151610c2a8161176f565b908b5b818110610ceb57505092889492610b0392610cb897958351610c6481610c5686820180956117c6565b03601f19810183528261100b565b5190209060018060a01b039a8b8b51169151928551948501957faf1b0d30d2cab0380e68f0689007e3254993c596f2fdd0aaa7f4d04f794408638752850152830152608082015260808152610afb81610fd5565b51169082515192845b848110610ccc578580f35b80610ce58585610cdf600195875161129e565b516113af565b01610cc1565b80610546610d008e9f9e93610d06945161129e565b5161181e565b9b9a9b610c2d565b855163cd21db4f60e01b815291820152fd5b8a80fd5b608082360312610d8157856080918851610d3d81610f89565b610d46856110b6565b8152610d538386016110b6565b83820152610d628a8601611220565b8a8201528d610d72818701611220565b90820152815201910190610bce565b8c80fd5b634e487b7160e01b8952604184528489fd5b5091903461055f57608036600319011261055f576001600160401b0390833582811161034357610dca90369086016110ca565b93610dd3611043565b9260443581811161055b57610deb90369084016111c3565b92909160643590811161079157610e04913691016111f3565b949093875151610e138161176f565b90885b818110610e92575050906102549798918151610e3a81610c566020820180956117c6565b5190206020830151828401519083519260208401947ffcf35f5ac6a2c28868dc44c302166470266239195f02b0ee408334829333b7668652840152336060840152608083015260a082015260a0815261052481610ff0565b80610546610540610ea4938e5161129e565b610e16565b503461025f57602091826003193601126103435781356001600160401b039283821161055b573660238301121561055b5781013592831161033f576024906007368386831b8401011161079157865b858110610f03578780f35b80821b8301906080602319833603011261025757610f83886001936060898051610f2c81610f89565b610f686084610f3c8d87016110b6565b95868452610f4c604482016110b6565b8098850152610f5d606482016110b6565b8095850152016110b6565b9283910152868060a01b0380808093169516931691166112c8565b01610ef8565b608081019081106001600160401b03821117610fa457604052565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b03821117610fa457604052565b60a081019081106001600160401b03821117610fa457604052565b60c081019081106001600160401b03821117610fa457604052565b90601f801991011681019081106001600160401b03821117610fa457604052565b6001600160401b038111610fa45760051b60200190565b602435906001600160a01b038216820361105957565b600080fd5b600435906001600160a01b038216820361105957565b60a435906001600160a01b038216820361105957565b608435906001600160a01b038216820361105957565b604435906001600160a01b038216820361105957565b35906001600160a01b038216820361105957565b9190916060818403126110595760408051916110e583610fba565b829481356001600160401b039081811161105957830182601f820112156110595780356111118161102c565b9261111e8751948561100b565b818452602094858086019360061b85010193818511611059579086899897969594939201925b848410611161575050505050855280820135908501520135910152565b9091929394959697848303126110595788519089820190828210858311176111ae578a9289928452611192876110b6565b8152828701358382015281520193019190889796959493611144565b60246000634e487b7160e01b81526041600452fd5b9181601f84011215611059578235916001600160401b038311611059576020808501948460061b01011161105957565b9181601f84011215611059578235916001600160401b038311611059576020838186019501011161105957565b359065ffffffffffff8216820361105957565b60031901906080821261105957604080519061124e82610fba565b808294126110595780518181018181106001600160401b03821117610fa45782526004356001600160a01b0381168103611059578152602435602082015282526044356020830152606435910152565b80518210156112b25760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b919060018060a01b03604060008284168152600160205282828220961695868252602052818120338252602052209485549565ffffffffffff8760a01c1680421161137357508287169683880361132a575b505061132895501692611adc565b565b878484161160001461134f5760405163f96fb07160e01b815260048101899052602490fd5b8383611328990316906bffffffffffffffffffffffff60a01b16179055388061131a565b60249060405190636c0d979760e11b82526004820152fd5b91908110156112b25760061b0190565b356001600160a01b03811681036110595790565b9065ffffffffffff908160608401511660018060a01b03938481511694806020830151169281866040809501511695169560009287845260016020528484208985526020528484209916988984526020528383209282845460d01c036114a3579480949261149794927fda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b989750871560001461149c5742165b600190910160d01b6001600160d01b03191660a09190911b65ffffffffffff60a01b1617179055516001600160a01b03909216825265ffffffffffff9290921660208201529081906040820190565b0390a4565b5086611448565b8451633ab3447f60e11b8152600490fd5b467f0000000000000000000000000000000000000000000000000000000000000000036114ff577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86682527f9ac997416e8ff9d2ff6bebeb7149f65cdae5e32e2b90440b566bb3044041d36a60408201524660608201523060808201526080815261156981610fd5565b51902090565b6115776114b4565b9060405190602082019261190160f01b8452602283015260428201526042815261156981610f89565b91929394969590604083015180421161160b57506020835101518087116115f3575061132896976115e392610b0386936115de602088015186611721565b61156f565b51516001600160a01b0316611adc565b60249060405190633728b83d60e01b82526004820152fd5b6024906040519063cd21db4f60e01b82526004820152fd5b95909593919293805151956040928383015180421161170a57508488036116f65761165d918691610b0360209b6115de8d88015186611721565b60005b868110611671575050505050505050565b61167c81835161129e565b518861168983878a61138b565b013590898101518083116116df5750918188888860019685966116b3575b50505050505001611660565b6116d4956116ce926102b5928a8060a01b039051169561138b565b91611adc565b8038888888836116a7565b602490865190633728b83d60e01b82526004820152fd5b83516001621398b960e31b03198152600490fd5b60249085519063cd21db4f60e01b82526004820152fd5b90600160ff82161b9160018060a01b0316600052600060205260406000209060081c600052602052604060002081815418809155161561175d57565b604051633ab3447f60e11b8152600490fd5b906117798261102c565b611786604051918261100b565b8281528092611797601f199161102c565b0190602036910137565b60001981146117b05760010190565b634e487b7160e01b600052601160045260246000fd5b805160208092019160005b8281106117df575050505090565b8351855293810193928101926001016117d1565b9081519160005b83811061180b575050016000815290565b80602080928401015181850152016117fa565b60405160208101917f65626cad6cb96493bf6f5ebea28756c966f023ab9e8a83a7101849d5573b3678835260018060a01b038082511660408401526020820151166060830152606065ffffffffffff9182604082015116608085015201511660a082015260a0815260c081018181106001600160401b03821117610fa45760405251902090565b6040516020808201927f618358ac3db8dc274f0cd8829da7e234bd48cd73c4a740aede1adec9846d06a1845260018060a01b038151166040840152015160608201526060815261156981610f89565b9190826040910312611059576020823592013590565b6000843b611a035750604182036119b357611927828201826118f4565b939092604010156112b25760209360009360ff6040608095013560f81c5b60405194855216868401526040830152606082015282805260015afa156119a7576000516001600160a01b0390811691821561199557160361198357565b604051632057875960e21b8152600490fd5b604051638baa579f60e01b8152600490fd5b6040513d6000823e3d90fd5b604082036119f1576119c7918101906118f4565b6001600160ff1b0381169260ff91821c601b019182116117b05760209360009360ff608094611945565b604051634be6321b60e01b8152600490fd5b918093946020926064604051809781958294630b135d3f60e11b9b8c8552600485015260406024850152816044850152848401378181018301889052601f01601f191681010301916001600160a01b03165afa918215611acf578192611a89575b50506001600160e01b03191603611a7757565b604051632c19a72f60e21b8152600490fd5b9091506020813d8211611ac7575b81611aa46020938361100b565b8101031261055f5751906001600160e01b03198216820361098f57503880611a64565b3d9150611a97565b50604051903d90823e3d90fd5b9060006064926020958295604051946323b872dd60e01b86526004860152602485015260448401525af13d15601f3d1160016000511416171615611b1c57565b60405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606490fdfea26469706673582212201c55c56fb05ff96a2b5d5b14227f19373707c4389af7e87c18375c2033b1d0e164736f6c63430008110033",
1202
- sourceMap: "176:59:16:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;176:59:16;;;;;;;:::i;:::-;;;:::i;:::-;;;;:::i;:::-;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;4322:94:23;176:59:16;1610:9:18;176:59:16;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;176:59:16;;;;;;4133:80:23;;;;1621:102;176:59:16;4133:80:23;;1621:102;;;:::i;:::-;;;;;;;;4133:80;3734:39;4133:80;3734:39;;4133:80;;;;;;;;:::i;:::-;176:59:16;4123:91:23;;4278:16;4256:39;4278:16;;4256:39;:::i;:::-;176:59:16;4377:12:23;;;176:59:16;4391:15:23;;;176:59:16;;;4322:94:23;;;176:59:16;;;1621:102:23;;;176:59:16;;;;4365:10:23;1621:102;;;176:59:16;1621:102:23;;;176:59:16;;;;;1621:102:23;;176:59:16;;;;;;1621:102:23;;;176:59:16;1621:102:23;4322:94;;;;;176:59:16;4322:94:23;:::i;:::-;176:59:16;;;;4312:105:23;;1610:9:18;;:::i;:::-;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;:::i;:::-;4511:13:14;;;;4526:10;;;;;;176:59:16;;;4538:3:14;4577:12;:18;:12;176:59:16;4577:12:14;;;;:::i;:::-;:18;:::i;:::-;4631:20;:12;;;;;;:::i;:::-;:20;;:::i;:::-;4348:10;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4736:31:14;4348:10;;4736:31;;176:59:16;4511:13:14;;176:59:16;;;;;;;;;;;;;;;;;-1:-1:-1;;176:59:16;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;176:59:16;;;;;;4678:86:23;;;;1621:102;176:59:16;4678:86:23;;1621:102;;;:::i;:::-;;;;;;;;4678:86;3734:39;4678:86;3734:39;;4678:86;;;;;;;;:::i;:::-;176:59:16;4668:97:23;;4799:16;;;176:59:16;4873:27:23;;;:::i;:::-;4916:13;;4931:16;;;;;;176:59:16;;;;5088:234:23;176:59:16;3569:9:18;176:59:16;;;;;5152:39:23;;661:173;176:59:16;5152:39:23;;661:173;;;:::i;:::-;5152:39;;;;;;;;:::i;:::-;176:59:16;5142:50:23;;176:59:16;5238:12:23;;;176:59:16;5268:15:23;;;176:59:16;;;5088:234:23;;;176:59:16;;;1621:102:23;;;176:59:16;;;;5210:10:23;1621:102;;;176:59:16;1621:102:23;;;176:59:16;;;;;1621:102:23;;176:59:16;;;;;;1621:102:23;;;176:59:16;1621:102:23;5088:234;;;;;176:59:16;5088:234:23;:::i;:::-;176:59:16;5065:267:23;;3569:9:18;;:::i;4949:3:23:-;5017:16;4995:42;5017:19;:16;;4949:3;5017:16;;:19;:::i;:::-;;4995:42;:::i;:::-;4968:69;;;;:::i;:::-;176:59:16;4949:3:23;:::i;:::-;4916:13;;176:59:16;;;;;;;;;;;;;;;;-1:-1:-1;;176:59:16;;;;;;;;;;:::i;:::-;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;176:59:16;;;;;;:::i;:::-;;;:::i;:::-;;;;:::i;:::-;;;;;;;;;;;;;;;;1480:56:14;1375:10;1480:56;1375:10;;176:59:16;;1365:9:14;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1332:54:22;:15;:54;176:59:16;;;1357:15:22;176:59:16;1332:54:22;;176:59:16;;-1:-1:-1;;;;;;176:59:16;;;;;;-1:-1:-1;;;176:59:16;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;1375:10:14;;176:59:16;;;;;;;;1480:56:14;;;;176:59:16;;1332:54:22;;;;;;176:59:16;;;;;;;;-1:-1:-1;;176:59:16;;;;;;;:::i;:::-;;;:::i;:::-;;;;:::i;:::-;;;-1:-1:-1;;;;;176:59:16;;;;1147:9:18;176:59:16;;;;;;;:::i;:::-;3029:16:23;;;3007:39;3029:16;;3007:39;:::i;:::-;3163:12;;;;176:59:16;3177:15:23;;;176:59:16;;;;3086:107:23;3163:12;3086:107;;176:59:16;1018:166:23;176:59:16;;1018:166:23;;176:59:16;3151:10:23;1018:166;;;176:59:16;1018:166:23;;;176:59:16;1018:166:23;;;176:59:16;1018:166:23;3086:107;;;;;:::i;176:59:16:-;;;;;;;;;;;-1:-1:-1;;176:59:16;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;;;;;;;;;;4963:10:14;176:59:16;;;;4953:9:14;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5011:20:14;;;;;5007:47;;176:59:16;;;;;;5223:24:14;5219:60;;-1:-1:-1;4963:10:14;176:59:16;;;4953:9:14;176:59:16;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;-1:-1:-1;;;;;;176:59:16;;;;;;;;;;;;;;;;;;;;4963:10:14;5369:65;;4963:10;5369:65;176:59:16;;5219:60:14;176:59:16;;-1:-1:-1;;;5256:23:14;;;5007:47;-1:-1:-1;176:59:16;;-1:-1:-1;;;5040:14:14;;;176:59:16;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5381:53:18;176:59:16;;;;;5337:10:18;176:59:16;;;;;;;;;;;;;;;;;;;5325:40:18;176:59:16;;;;;;;;;;;5337:10:18;5381:53;;176:59:16;;;;;;;;;-1:-1:-1;;176:59:16;;;;;;:::i;:::-;;;:::i;:::-;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;2832:6:14;;;:::i;176:59:16:-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;;176:59:16;;;;;;:::i;:::-;;-1:-1:-1;;176:59:16;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;:::i;:::-;1702:15:14;;;;;:42;1698:97;;2078:20:23;;;;;1880:35:14;1979:20;2078::23;;1917:5:14;2078:20:23;2059:40;2078:20;;2059:40;:::i;:::-;176:59:16;;;;;;;;;;2138:95:23;176:59:16;2138:95:23;;176:59:16;433:172:23;176:59:16;;433:172:23;;176:59:16;;433:172:23;;176:59:16;;433:172:23;;176:59:16;;2138:95:23;;;;;:::i;:::-;176:59:16;2128:106:23;;1880:35:14;:::i;:::-;1917:5;;:::i;:::-;1950:20;176:59:16;;;1979:20:14;;:::i;1698:97::-;176:59:16;;-1:-1:-1;;;1753:42:14;;;;;176:59:16;;;-1:-1:-1;1753:42:14;176:59:16;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2164:15:14;;;;;:41;2160:95;;2375:19:23;;;;;;;176:59:16;2443:25:23;;;:::i;:::-;2483:13;;2498:14;;;;;;176:59:16;;;;;;2340:34:14;176:59:16;2376:5:14;176:59:16;;;;2721:30:23;;661:173;2721:30;;;661:173;;;:::i;:::-;2721:30;3734:39;;2721:30;;;;;;:::i;:::-;176:59:16;2711:41:23;;176:59:16;;;;;;;;;;;;;;;;2643:201:23;;;176:59:16;661:173:23;176:59:16;;433:172:23;;176:59:16;433:172:23;;176:59:16;;433:172:23;;176:59:16;;2643:201:23;;;;;:::i;2376:5:14:-;176:59:16;;2481:19:14;;;176:59:16;2526:13:14;;2541:10;;;;;;176:59:16;;;2553:3:14;2592:19;2623:7;2592:19;;:22;176:59:16;2592:19:14;;;:22;:::i;:::-;;2623:7;:::i;:::-;176:59:16;2526:13:14;;2514:3:23;2570:19;2551:42;2570:22;:19;;;;2514:3;2570:19;;:22;:::i;:::-;;2551:42;:::i;2514:3::-;2483:13;;;;;2160:95:14;176:59:16;;-1:-1:-1;;;2214:41:14;;;;;176:59:16;2214:41:14;176:59:16;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;-1:-1:-1;;;176:59:16;;;;;;;;;;;;;;;;;-1:-1:-1;;176:59:16;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::i;:::-;3353:16:23;;;;;176:59:16;3427:27:23;;;:::i;:::-;3470:13;;3485:16;;;;;;176:59:16;;;3097:9:18;176:59:16;;;;;3734:39:23;;661:173;176:59:16;3734:39:23;;661:173;;;:::i;3734:39::-;176:59:16;3724:50:23;;176:59:16;3820:12:23;;176:59:16;3850:15:23;;;176:59:16;;;;3642:237:23;176:59:16;3642:237:23;;176:59:16;1254:173:23;176:59:16;;1018:166:23;;176:59:16;3792:10:23;1018:166;;;176:59:16;;1018:166:23;;176:59:16;1018:166:23;;;176:59:16;1018:166:23;3642:237;;;;;:::i;3503:3::-;3571:16;3549:42;3571:19;3503:3;3571:16;;;:19;:::i;3503:3::-;3470:13;;176:59:16;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3067:13:14;3082:10;;;;;;176:59:16;;;3094:3:14;176:59:16;;;;;;;;;;;;;;;;3274:21:14;176:59:16;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;3274:21:14;:::i;:::-;176:59:16;3067:13:14;;176:59:16;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;:::o;:::-;433:172:23;176:59:16;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;:::o;:::-;1018:166:23;176:59:16;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;:::o;:::-;;3734:39:23;;;176:59:16;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;:::o;:::-;-1:-1:-1;;;;;176:59:16;;;;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;176:59:16;;;;;;:::o;:::-;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;176:59:16;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;176:59:16;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;176:59:16;;;;;;:::o;:::-;;;-1:-1:-1;;;;;176:59:16;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;176:59:16;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;:::o;:::-;-1:-1:-1;;176:59:16;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;3474:737:14;;;176:59:16;;;;;;-1:-1:-1;176:59:16;;;;;;;;;;;;;;;;;;;;;;;3625:10:14;176:59:16;;;;;;;;;;;;;;3651:15:14;;:36;3647:85;;176:59:16;;;;3791:30:14;;;;3787:289;;3474:737;176:59:16;;4157:47:14;176:59:16;;;4157:47:14;;:::i;:::-;3474:737::o;3787:289::-;176:59:16;;;;3841:18:14;3837:229;3841:18;;;176:59:16;;-1:-1:-1;;;3886:32:14;;;;;176:59:16;;;;;3886:32:14;3837:229;176:59:16;;4157:47:14;176:59:16;;;;;;;;;;;3787:289:14;;;;3647:85;176:59:16;;;;3696:36:14;;;;;;;;;176:59:16;3696:36:14;176:59:16;;;;;;;;;;;;:::o;:::-;;-1:-1:-1;;;;;176:59:16;;;;;;;:::o;5674:525:14:-;;176:59:16;5794:13:14;;;;;176:59:16;;;;;;;;;;;;5873:14:14;;;;;176:59:16;;5917:18:14;;;;;;;176:59:16;;;;-1:-1:-1;;176:59:16;;;;;5873:14:14;176:59:16;;;;;;;5873:14:14;176:59:16;;;;;;;;;;5873:14:14;176:59:16;;;;;;;;;;6026:22:14;6022:49;;690:54:22;;;;6141:51:14;690:54:22;;6141:51:14;690:54:22;;:15;;;:54;176:59:16;;;715:15:22;176:59:16;690:54:22;176:59:16;;;;;;-1:-1:-1;;;;;;176:59:16;;;;;;-1:-1:-1;;;176:59:16;1656:52:22;:61;823:59;;176::16;-1:-1:-1;;;;;176:59:16;;;;;;;;;;;;;;;;;;;;;;6141:51:14;;;;5674:525::o;690:54:22:-;;;;;6022:49:14;176:59:16;;-1:-1:-1;;;6057:14:14;;;;;1123:216:15;1198:13;1215:16;1198:33;1215:16;;1246:24;1123:216;:::o;1198:134::-;176:59:16;;1560:60:15;;;176:59:16;726:80:15;176:59:16;;654:20:15;176:59:16;;;;1198:13:15;176:59:16;;;;1614:4:15;176:59:16;;;;;1560:60:15;;;;;:::i;:::-;176:59:16;1550:71:15;;1123:216;:::o;1685:167::-;1815:18;;:::i;:::-;176:59:16;;;1786:58:15;;;;176:59:16;;;;;;;;;;;;;;;1786:58:15;;;;;:::i;2153:614:18:-;;;;;;;;2407:15;;;176:59:16;2389:15:18;;:33;2385:79;;2496:16;:23;:16;;:23;176:59:16;2478:41:18;;;2474:92;;2602:12;2744:15;2602:12;;2669:5;2602:12;2643:24;2602:12;;;2496:23;2602:12;;176:59:16;2602:12:18;;:::i;:::-;2643:24;:::i;2669:5::-;2692:16;176:59:16;-1:-1:-1;;;;;176:59:16;2744:15:18;:::i;2474:92::-;176:59:16;;2407:15:18;176:59:16;2528:38:18;;;;;;;;;176:59:16;2528:38:18;2385:79;176:59:16;;2407:15:18;176:59:16;2214:41:14;;;;2431:33:18;;;;;176:59:16;2431:33:18;4000:1195;;;;;;;;4268:16;;176:59:16;4324:15:18;;;;;;176:59:16;4306:15:18;;:33;4302:79;;4395:38;;;;4391:67;;4561:5;4495:12;;;4535:24;4495:12;;;;;;176:59:16;4495:12:18;;:::i;4561:5::-;-1:-1:-1;4622:16:18;;;;;;4000:1195;;;;;;;;:::o;4640:3::-;4699:19;:16;;;:19;:::i;:::-;;4762:18;;;;;;:::i;:::-;:34;176:59:16;4837:16:18;;;;176:59:16;4819:34:18;;;4815:78;;4916:20;;;;;;176:59:16;4916:20:18;;;4912:253;;4640:3;;;;;;;176:59:16;4607:13:18;;4912:253;5130:15;176:59:16;5107:21:18;176:59:16;5107:18:18;176:59:16;;;;;;;;;5107:18:18;;:::i;:21::-;5130:15;;:::i;:::-;4912:253;;;;;;;;4815:78;176:59:16;;;;2528:38:18;;;;4862:31;;;;;176:59:16;4862:31:18;4391:67;176:59:16;;-1:-1:-1;;;;;;4442:16:18;;;;;4302:79;176:59:16;;;;2214:41:14;;;;4348:33:18;;;;;176:59:16;4348:33:18;6314:293;;6472:1;176:59:16;;;;;;;;;;;-1:-1:-1;176:59:16;-1:-1:-1;176:59:16;;;-1:-1:-1;176:59:16;;6056:1:18;176:59:16;-1:-1:-1;176:59:16;;;;-1:-1:-1;176:59:16;;;;6511:33:18;176:59:16;;;6559:13:18;:18;6555:45;;6314:293::o;6555:45::-;176:59:16;;-1:-1:-1;;;6586:14:18;;;;;176:59:16;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;3734:39:23;176:59:16;3734:39:23;;176:59:16;;:::i;:::-;;;;;;;;:::o;:::-;-1:-1:-1;;176:59:16;;;;;;;:::o;:::-;;;;;;;;;;;;661:173:23;176:59:16;;;;;;661:173:23;;;;;;;;;;;;;:::o;:::-;;;176:59:16;;661:173:23;;;;;;;;;;;;1621:102;;176:59:16;;1621:102:23;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;5345:188;176:59:16;;5480:45:23;;;176:59:16;289:87:23;176:59:16;;;;;;;289:87:23;;;176:59:16;;289:87:23;;176:59:16;5480:45:23;289:87;;;176:59:16;289:87:23;;;176:59:16;289:87:23;176:59:16;289:87:23;;176:59:16;289:87:23;;;176:59:16;289:87:23;;;176:59:16;289:87:23;;176:59:16;;289:87:23;;176:59:16;;5480:45:23;;289:87;176:59:16;;;;;-1:-1:-1;;;;;176:59:16;;;;;;;;5470:56:23;;5345:188;:::o;5539:229::-;176:59:16;;5710:50:23;;;;176:59:16;895::23;176::16;;;;;;;895::23;;176::16;;895::23;;176::16;895::23;;;;;176::16;895::23;5710:50;;;;;:::i;176:59:16:-;;;;;;;;;;;;;;;;;:::o;389:1109:24:-;-1:-1:-1;552:25:24;;;;-1:-1:-1;622:2:24;602:22;;622:2;;653:41;;;;;;:::i;:::-;644:50;;314:68;732:2;314:68;;;;;;-1:-1:-1;314:68:24;176:59:16;732:2:24;314:68;;;722:13;314:68;;598:490;176:59:16;;;;;;314:68:24;;;;176:59:16;314:68:24;;176:59:16;314:68:24;;;176:59:16;1118:24:24;;;;;;;;;-1:-1:-1;1118:24:24;-1:-1:-1;;;;;176:59:16;;;;1160:20:24;;1156:51;;176:59:16;1225:23:24;1221:51;;389:1109::o;1221:51::-;176:59:16;;-1:-1:-1;;;1257:15:24;;;;;1156:51;176:59:16;;-1:-1:-1;;;1189:18:24;;;;;1118:24;176:59:16;;;-1:-1:-1;176:59:16;;;;;598:490:24;781:2;761:22;;781:2;;869:41;;;;;;:::i;:::-;-1:-1:-1;;;;;932:19:24;;;315:66;176:59:16;;;1001:2:24;314:68;;;;;;;969:34;-1:-1:-1;969:34:24;176:59:16;314:68:24;969:34;598:490;;757:331;781:2;176:59:16;-1:-1:-1;;;1049:24:24;;;;;548:944;176:59:16;;;;1323:57:24;176:59:16;;;;;;;;;;;;;1323:57:24;;;;;;;176:59:16;;;;;;;;;;;;;;1621:102:23;;;;;;;;;3734:39;176:59:16;-1:-1:-1;;176:59:16;;;1323:57:24;;;-1:-1:-1;;;;;176:59:16;1323:57:24;;;;;;;;;;;548:944;-1:-1:-1;;;;;;;;176:59:16;1398:48:24;1394:87;;389:1109::o;1394:87::-;176:59:16;;-1:-1:-1;;;1455:26:24;;1323:57;;1455:26;1323:57;;;;;;;;;;;;;;;;;;:::i;:::-;;;176:59:16;;;;;;-1:-1:-1;;;;;;176:59:16;;;;;;1323:57:24;;;;;;;;-1:-1:-1;1323:57:24;;;176:59:16;;;;;;;;;;;1328:1616:28;;-1:-1:-1;1532:1355:28;1328:1616;1532:1355;1328:1616;;;1532:1355;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1532:1355:28;;;;;176:59:16;;;1328:1616:28:o;176:59:16:-;1532:1355:28;176:59:16;-1:-1:-1;;;176:59:16;;1532:1355:28;;176:59:16;;;;1532:1355:28;176:59:16;;;-1:-1:-1;;;1532:1355:28;176:59:16;;;1532:1355:28;;176:59:16",
1203
- linkReferences: {
1204
- },
1205
- immutableReferences: {
1206
- "24979": [
1207
- {
1208
- start: 5341,
1209
- length: 32
1210
- }
1211
- ],
1212
- "24981": [
1213
- {
1214
- start: 5303,
1215
- length: 32
1216
- }
1217
- ]
1218
- }
1219
- };
1220
- var methodIdentifiers = {
1221
- "DOMAIN_SEPARATOR()": "3644e515",
1222
- "allowance(address,address,address)": "927da105",
1223
- "approve(address,address,uint160,uint48)": "87517c45",
1224
- "invalidateNonces(address,address,uint48)": "65d9723c",
1225
- "invalidateUnorderedNonces(uint256,uint256)": "3ff9dcb1",
1226
- "lockdown((address,address)[])": "cc53287f",
1227
- "nonceBitmap(address,uint256)": "4fe02b44",
1228
- "permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)": "2b67b570",
1229
- "permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)": "2a2d80d1",
1230
- "permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)": "7d4a8c52",
1231
- "permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)": "23896096",
1232
- "permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,bytes)": "eb76df79",
1233
- "permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,bytes)": "b0468e77",
1234
- "transferFrom((address,address,uint160,address)[])": "0d58b1db",
1235
- "transferFrom(address,address,uint160,address)": "36c78516"
1236
- };
1237
- var rawMetadata = "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"AllowanceExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExcessiveInvalidation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxAmount\",\"type\":\"uint256\"}],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidContractSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"signatureDeadline\",\"type\":\"uint256\"}],\"name\":\"SignatureExpired\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"Lockdown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"newNonce\",\"type\":\"uint48\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"oldNonce\",\"type\":\"uint48\"}],\"name\":\"NonceInvalidation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"word\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mask\",\"type\":\"uint256\"}],\"name\":\"UnorderedNonceInvalidation\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint48\",\"name\":\"newNonce\",\"type\":\"uint48\"}],\"name\":\"invalidateNonces\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wordPos\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mask\",\"type\":\"uint256\"}],\"name\":\"invalidateUnorderedNonces\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"internalType\":\"struct IAllowanceTransfer.TokenSpenderPair[]\",\"name\":\"approvals\",\"type\":\"tuple[]\"}],\"name\":\"lockdown\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"nonceBitmap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"}],\"internalType\":\"struct IAllowanceTransfer.PermitDetails[]\",\"name\":\"details\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sigDeadline\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowanceTransfer.PermitBatch\",\"name\":\"permitBatch\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"}],\"internalType\":\"struct IAllowanceTransfer.PermitDetails\",\"name\":\"details\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sigDeadline\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowanceTransfer.PermitSingle\",\"name\":\"permitSingle\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.TokenPermissions[]\",\"name\":\"permitted\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.PermitBatchTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.SignatureTransferDetails[]\",\"name\":\"transferDetails\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.TokenPermissions\",\"name\":\"permitted\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.PermitTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.TokenPermissions[]\",\"name\":\"permitted\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.PermitBatchTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.SignatureTransferDetails[]\",\"name\":\"transferDetails\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes32\",\"name\":\"witness\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"witnessTypeString\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitWitnessTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.TokenPermissions\",\"name\":\"permitted\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct ISignatureTransfer.PermitTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"witness\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"witnessTypeString\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitWitnessTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"internalType\":\"struct IAllowanceTransfer.AllowanceTransferDetails[]\",\"name\":\"transferDetails\",\"type\":\"tuple[]\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AllowanceExpired(uint256)\":[{\"params\":{\"deadline\":\"The timestamp at which the allowed amount is no longer valid\"}}],\"InsufficientAllowance(uint256)\":[{\"params\":{\"amount\":\"The maximum amount allowed\"}}],\"InvalidAmount(uint256)\":[{\"params\":{\"maxAmount\":\"The maximum amount a spender can request to transfer\"}}],\"SignatureExpired(uint256)\":[{\"params\":{\"signatureDeadline\":\"The timestamp at which a signature is no longer valid\"}}]},\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"Uses cached version if chainid and address are unchanged from construction.\"},\"approve(address,address,uint160,uint48)\":{\"details\":\"The packed allowance also holds a nonce, which will stay unchanged in approve\",\"params\":{\"amount\":\"The approved amount of the token\",\"expiration\":\"The timestamp at which the approval is no longer valid\",\"spender\":\"The spender address to approve\",\"token\":\"The token to approve\"}},\"invalidateNonces(address,address,uint48)\":{\"details\":\"Can't invalidate more than 2**16 nonces per transaction.\",\"params\":{\"newNonce\":\"The new nonce to set. Invalidates all nonces less than it.\",\"spender\":\"The spender to invalidate nonces for\",\"token\":\"The token to invalidate nonces for\"}},\"invalidateUnorderedNonces(uint256,uint256)\":{\"details\":\"The wordPos is maxed at type(uint248).max\",\"params\":{\"mask\":\"A bitmap masked against msg.sender's current bitmap at the word position\",\"wordPos\":\"A number to index the nonceBitmap at\"}},\"lockdown((address,address)[])\":{\"params\":{\"approvals\":\"Array of approvals to revoke.\"}},\"permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)\":{\"details\":\"May fail if the owner's nonce was invalidated in-flight by invalidateNonce\",\"params\":{\"owner\":\"The owner of the tokens being approved\",\"permitSingle\":\"Data signed over by the owner specifying the terms of approval\",\"signature\":\"The owner's signature over the permit data\"}},\"permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)\":{\"details\":\"May fail if the owner's nonce was invalidated in-flight by invalidateNonce\",\"params\":{\"owner\":\"The owner of the tokens being approved\",\"permitBatch\":\"Data signed over by the owner specifying the terms of approval\",\"signature\":\"The owner's signature over the permit data\"}},\"permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)\":{\"details\":\"If to is the zero address, the tokens are sent to the signed spender\",\"params\":{\"owner\":\"The owner of the tokens to transfer\",\"permit\":\"The permit data signed over by the owner\",\"requestedAmount\":\"The amount of tokens to transfer\",\"signature\":\"The signature to verify\",\"to\":\"The recipient of the tokens\"}},\"permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)\":{\"params\":{\"owner\":\"The owner of the tokens to transfer\",\"permit\":\"The permit data signed over by the owner\",\"signature\":\"The signature to verify\"}},\"permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,bytes)\":{\"details\":\"If to is the zero address, the tokens are sent to the spenderThe witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition\",\"params\":{\"owner\":\"The owner of the tokens to transfer\",\"permit\":\"The permit data signed over by the owner\",\"requestedAmount\":\"The amount of tokens to transfer\",\"signature\":\"The signature to verify\",\"to\":\"The recipient of the tokens\",\"witness\":\"Extra data to include when checking the user signature\",\"witnessTypeString\":\"The EIP-712 type definition for the witness type\"}},\"permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,bytes)\":{\"details\":\"The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition\",\"params\":{\"owner\":\"The owner of the tokens to transfer\",\"permit\":\"The permit data signed over by the owner\",\"signature\":\"The signature to verify\",\"witness\":\"Extra data to include when checking the user signature\",\"witnessTypeString\":\"The EIP-712 type definition for the witness type\"}},\"transferFrom((address,address,uint160,address)[])\":{\"details\":\"Requires the from address to have approved at least the desired amount of tokens to msg.sender.\",\"params\":{\"transferDetails\":\"Array of recipients for the transfers\"}},\"transferFrom(address,address,uint160,address)\":{\"details\":\"Requires the from address to have approved at least the desired amount of tokens to msg.sender.\",\"params\":{\"from\":\"The address to transfer from.\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"InvalidNonce()\":[{\"notice\":\"Thrown when validating that the inputted nonce has not been used\"}],\"SignatureExpired(uint256)\":[{\"notice\":\"Thrown when validating an inputted signature that is stale\"}]},\"events\":{\"Approval(address,address,address,uint160,uint48)\":{\"notice\":\"Emits an event when the owner successfully sets permissions on a token for the spender.\"},\"Lockdown(address,address,address)\":{\"notice\":\"Emits an event when the owner sets the allowance back to 0 with the lockdown function.\"},\"NonceInvalidation(address,address,address,uint48,uint48)\":{\"notice\":\"Emits an event when the owner successfully invalidates an ordered nonce.\"},\"UnorderedNonceInvalidation(address,uint256,uint256)\":{\"notice\":\"Emits an event when the owner successfully invalidates an unordered nonce.\"}},\"kind\":\"user\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"notice\":\"Returns the domain separator for the current chain.\"},\"allowance(address,address,address)\":{\"notice\":\"Maps users to tokens to spender addresses and information about the approval on the token\"},\"approve(address,address,uint160,uint48)\":{\"notice\":\"Approves the spender to use up to amount of the specified token up until the expiration\"},\"invalidateNonces(address,address,uint48)\":{\"notice\":\"Invalidate nonces for a given (token, spender) pair\"},\"invalidateUnorderedNonces(uint256,uint256)\":{\"notice\":\"Invalidates the bits specified in mask for the bitmap at the word position\"},\"lockdown((address,address)[])\":{\"notice\":\"Enables performing a \\\"lockdown\\\" of the sender's Permit2 identity by batch revoking approvals\"},\"nonceBitmap(address,uint256)\":{\"notice\":\"A bitmap used for replay protection\"},\"permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)\":{\"notice\":\"Permit a spender to a given amount of the owners token via the owner's EIP-712 signature\"},\"permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)\":{\"notice\":\"Permit a spender to the signed amounts of the owners tokens via the owner's EIP-712 signature\"},\"permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)\":{\"notice\":\"Transfers a token using a signed permit message\"},\"permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)\":{\"notice\":\"Transfers multiple tokens using a signed permit message\"},\"permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,bytes)\":{\"notice\":\"Transfers a token using a signed permit messageIncludes extra data provided by the caller to verify signature over\"},\"permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,bytes)\":{\"notice\":\"Transfers multiple tokens using a signed permit messageIncludes extra data provided by the caller to verify signature over\"},\"transferFrom((address,address,uint160,address)[])\":{\"notice\":\"Transfer approved tokens in a batch\"},\"transferFrom(address,address,uint160,address)\":{\"notice\":\"Transfer approved tokens from one address to another.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"lib/permit2/src/Permit2.sol\":\"Permit2\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@ensdomains/=node_modules/@uniswap/narwhal/node_modules/@ensdomains/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":@uniswap/=node_modules/@uniswap/\",\":base64-sol/=node_modules/base64-sol/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/\",\":forge-std/=lib/forge-std/src/\",\":hardhat/=node_modules/@uniswap/narwhal/node_modules/hardhat/\",\":narwhal/=node_modules/@uniswap/narwhal/contracts/\",\":openzeppelin-contracts/=node_modules/openzeppelin-contracts/\",\":openzeppelin-contracts/contracts/=node_modules/openzeppelin-contracts/\",\":permit2/=lib/permit2/\",\":solmate/=lib/solmate/src/\",\":v2-core/=node_modules/@uniswap/narwhal/lib/v2-core/\",\":v3-core/=node_modules/@uniswap/narwhal/lib/v3-core/\"],\"viaIR\":true},\"sources\":{\"lib/permit2/src/AllowanceTransfer.sol\":{\"keccak256\":\"0x416199602ce396a8e075d3a386fc490fa676d27dc6bc915b1daa3f729ce14228\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ed5cb300c53a37be5e9731d8c530493000e3ab19c13f817dbe2be7679399a456\",\"dweb:/ipfs/QmaCe9cGb91ocubBeBEyLaTHgoWwU32tFYkMWWvEEP7ihU\"]},\"lib/permit2/src/EIP712.sol\":{\"keccak256\":\"0x973d4358c262467a4c2a0c2867c676a8a138102968d8b89355c42f655d1a7a68\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7219a31ace8c0a959392cc2ee06817c7c98dfc491e96d27f71a09fb23860b62c\",\"dweb:/ipfs/QmUGRLgddHZ3GoouEBoMYbRS4wVGapJrsD2nBxVwxLBibb\"]},\"lib/permit2/src/Permit2.sol\":{\"keccak256\":\"0x4a550c6185306292e4c79e0867940e11f509830e5dc83d80a128590b8208785d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://79852589685430a04c5df74a9a64fd10ccc996d0e62a3b5dc22f319a02d12734\",\"dweb:/ipfs/QmTJxgFNwC2gGTfqPQDsr5AU7qnA4WirETKFh7mBTKcwP2\"]},\"lib/permit2/src/PermitErrors.sol\":{\"keccak256\":\"0x9fd1192bbc3ffa9354f2bfc534d7a1cdf2be2c940c96ed4ac7bc37991e1e5dfe\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://77f8b2e2c040c33e2c78f05e7e768a17f433c07adb699235c35c4dac92115070\",\"dweb:/ipfs/QmYX2VTyTm6QLtgp54kCrkAGY8uPxkx28urwLNEJsxTHJs\"]},\"lib/permit2/src/SignatureTransfer.sol\":{\"keccak256\":\"0xe95e5e2cf1d166fcc1844c857a96859a46f33a24bc2f76b2a66df8ed535a1a5b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://67c6e12923579a072953a552db3a198018277b9c0215898b14e5e5dfe49db9d1\",\"dweb:/ipfs/QmT7q5CWDtig6EVLVKfaaZRBfiV4c2mgxaKjQbjqkzpvGW\"]},\"lib/permit2/src/interfaces/IAllowanceTransfer.sol\":{\"keccak256\":\"0x7af3d23aa1a0ede5a649051395ea1fb5a54c3e68d50db7e02f00e201f2afb9c6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2309065f58069ace887997953192b6d9e6185ca9d8eb54266fbcbaec3e65af56\",\"dweb:/ipfs/QmbuEKJCupdWMqY5APmG8bnFqiNYGc6kERQNXpasdsZrsz\"]},\"lib/permit2/src/interfaces/IERC1271.sol\":{\"keccak256\":\"0x96f516510d08da5b1d05d81b0bd88af6f9928bb757ba55c27e203654dfcd4fa0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c0942604688c369aed50905d7cef2ece68e1ff457c95a14c9f913babac29a09a\",\"dweb:/ipfs/Qmf4ZBYCKqQHfnACciz8GEMhwxPw7mhQ6fjGXwpgr8CQF8\"]},\"lib/permit2/src/interfaces/ISignatureTransfer.sol\":{\"keccak256\":\"0x4079172a6b068b6fb7575c8558ae5ed181b16e3370ffe85f1f0eb632c848918b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a4cd29908a0261ae2abca79cdc34ae8d4bc4b4ee15024e2b447cb886089d81d9\",\"dweb:/ipfs/QmSVZdXJVY5vDjb5RD7fWAqWD4VcRdtFRr855Nxqp9sG51\"]},\"lib/permit2/src/libraries/Allowance.sol\":{\"keccak256\":\"0x1e6bb822d9d99d96a05ae08f05503530f60edcd8faedd2c832858f5ce15b7338\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0fe391785aff4b402b5fa40cdf3f1629007d5368e8322fc008b8b7cee9c7a2e7\",\"dweb:/ipfs/QmbsrVA3ZuLThnXus59A5S5inwJFa6TkRXg7LPPmiphnPy\"]},\"lib/permit2/src/libraries/PermitHash.sol\":{\"keccak256\":\"0x54af80d9c3193934c6947c31f59b8f3d7918f83676fe92ed6136593ad591d478\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5264001770be2cdeb7651e4d22af7edbc4e16da6d38747efeb4f54b5472ca5c5\",\"dweb:/ipfs/QmPvwau7DXw6stGQ14hpyTeLdYDYrrrdMnUfkQTPpMXQxz\"]},\"lib/permit2/src/libraries/SignatureVerification.sol\":{\"keccak256\":\"0x11ee84c2af88753814851205b33000dbae7ba8fc24e2d9e291f4ca55b9770619\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://38325182d5be74f7ec54b5e4b2ec80cfa6bf086c40f8e1e24eb427eb15f60951\",\"dweb:/ipfs/QmQy4sVzHcxRc8PVx6xWGDKjwYa5pA2R1Fqkmk3X8xouKB\"]},\"lib/solmate/src/tokens/ERC20.sol\":{\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\",\"urls\":[\"bzz-raw://57b3ab70cde374af1cf2c9888636e8de6cf660f087b1c9abd805e9271e19fa35\",\"dweb:/ipfs/QmNrLDBAHYFjpjSd12jerm1AdBkDqEYUUaXgnT854BUZ97\"]},\"lib/solmate/src/utils/SafeTransferLib.sol\":{\"keccak256\":\"0xbadf3d708cf532b12f75f78a1d423135954b63774a6d4ba15914a551d348db8a\",\"license\":\"AGPL-3.0-only\",\"urls\":[\"bzz-raw://88ac8256bd520d1b8e6f9c4ac9e8777bffdc4a6c8afb1a848f596665779a55b4\",\"dweb:/ipfs/QmXx7X1dxe6f5VM91vgQ5BA4r2eF97GWDcQDrgHytcvfjU\"]}},\"version\":1}";
1238
- var metadata = {
1239
- compiler: {
1240
- version: "0.8.17+commit.8df45f5f"
1241
- },
1242
- language: "Solidity",
1243
- output: {
1244
- abi: [
1245
- {
1246
- inputs: [
1247
- {
1248
- internalType: "uint256",
1249
- name: "deadline",
1250
- type: "uint256"
1251
- }
1252
- ],
1253
- type: "error",
1254
- name: "AllowanceExpired"
1255
- },
1256
- {
1257
- inputs: [
1258
- ],
1259
- type: "error",
1260
- name: "ExcessiveInvalidation"
1261
- },
1262
- {
1263
- inputs: [
1264
- {
1265
- internalType: "uint256",
1266
- name: "amount",
1267
- type: "uint256"
1268
- }
1269
- ],
1270
- type: "error",
1271
- name: "InsufficientAllowance"
1272
- },
1273
- {
1274
- inputs: [
1275
- {
1276
- internalType: "uint256",
1277
- name: "maxAmount",
1278
- type: "uint256"
1279
- }
1280
- ],
1281
- type: "error",
1282
- name: "InvalidAmount"
1283
- },
1284
- {
1285
- inputs: [
1286
- ],
1287
- type: "error",
1288
- name: "InvalidContractSignature"
1289
- },
1290
- {
1291
- inputs: [
1292
- ],
1293
- type: "error",
1294
- name: "InvalidNonce"
1295
- },
1296
- {
1297
- inputs: [
1298
- ],
1299
- type: "error",
1300
- name: "InvalidSignature"
1301
- },
1302
- {
1303
- inputs: [
1304
- ],
1305
- type: "error",
1306
- name: "InvalidSignatureLength"
1307
- },
1308
- {
1309
- inputs: [
1310
- ],
1311
- type: "error",
1312
- name: "InvalidSigner"
1313
- },
1314
- {
1315
- inputs: [
1316
- ],
1317
- type: "error",
1318
- name: "LengthMismatch"
1319
- },
1320
- {
1321
- inputs: [
1322
- ],
1323
- type: "error",
1324
- name: "NotSpender"
1325
- },
1326
- {
1327
- inputs: [
1328
- {
1329
- internalType: "uint256",
1330
- name: "signatureDeadline",
1331
- type: "uint256"
1332
- }
1333
- ],
1334
- type: "error",
1335
- name: "SignatureExpired"
1336
- },
1337
- {
1338
- inputs: [
1339
- {
1340
- internalType: "address",
1341
- name: "owner",
1342
- type: "address",
1343
- indexed: true
1344
- },
1345
- {
1346
- internalType: "address",
1347
- name: "token",
1348
- type: "address",
1349
- indexed: true
1350
- },
1351
- {
1352
- internalType: "address",
1353
- name: "spender",
1354
- type: "address",
1355
- indexed: true
1356
- },
1357
- {
1358
- internalType: "uint160",
1359
- name: "amount",
1360
- type: "uint160",
1361
- indexed: false
1362
- },
1363
- {
1364
- internalType: "uint48",
1365
- name: "expiration",
1366
- type: "uint48",
1367
- indexed: false
1368
- }
1369
- ],
1370
- type: "event",
1371
- name: "Approval",
1372
- anonymous: false
1373
- },
1374
- {
1375
- inputs: [
1376
- {
1377
- internalType: "address",
1378
- name: "owner",
1379
- type: "address",
1380
- indexed: true
1381
- },
1382
- {
1383
- internalType: "address",
1384
- name: "token",
1385
- type: "address",
1386
- indexed: false
1387
- },
1388
- {
1389
- internalType: "address",
1390
- name: "spender",
1391
- type: "address",
1392
- indexed: false
1393
- }
1394
- ],
1395
- type: "event",
1396
- name: "Lockdown",
1397
- anonymous: false
1398
- },
1399
- {
1400
- inputs: [
1401
- {
1402
- internalType: "address",
1403
- name: "owner",
1404
- type: "address",
1405
- indexed: true
1406
- },
1407
- {
1408
- internalType: "address",
1409
- name: "token",
1410
- type: "address",
1411
- indexed: true
1412
- },
1413
- {
1414
- internalType: "address",
1415
- name: "spender",
1416
- type: "address",
1417
- indexed: true
1418
- },
1419
- {
1420
- internalType: "uint48",
1421
- name: "newNonce",
1422
- type: "uint48",
1423
- indexed: false
1424
- },
1425
- {
1426
- internalType: "uint48",
1427
- name: "oldNonce",
1428
- type: "uint48",
1429
- indexed: false
1430
- }
1431
- ],
1432
- type: "event",
1433
- name: "NonceInvalidation",
1434
- anonymous: false
1435
- },
1436
- {
1437
- inputs: [
1438
- {
1439
- internalType: "address",
1440
- name: "owner",
1441
- type: "address",
1442
- indexed: true
1443
- },
1444
- {
1445
- internalType: "uint256",
1446
- name: "word",
1447
- type: "uint256",
1448
- indexed: false
1449
- },
1450
- {
1451
- internalType: "uint256",
1452
- name: "mask",
1453
- type: "uint256",
1454
- indexed: false
1455
- }
1456
- ],
1457
- type: "event",
1458
- name: "UnorderedNonceInvalidation",
1459
- anonymous: false
1460
- },
1461
- {
1462
- inputs: [
1463
- ],
1464
- stateMutability: "view",
1465
- type: "function",
1466
- name: "DOMAIN_SEPARATOR",
1467
- outputs: [
1468
- {
1469
- internalType: "bytes32",
1470
- name: "",
1471
- type: "bytes32"
1472
- }
1473
- ]
1474
- },
1475
- {
1476
- inputs: [
1477
- {
1478
- internalType: "address",
1479
- name: "",
1480
- type: "address"
1481
- },
1482
- {
1483
- internalType: "address",
1484
- name: "",
1485
- type: "address"
1486
- },
1487
- {
1488
- internalType: "address",
1489
- name: "",
1490
- type: "address"
1491
- }
1492
- ],
1493
- stateMutability: "view",
1494
- type: "function",
1495
- name: "allowance",
1496
- outputs: [
1497
- {
1498
- internalType: "uint160",
1499
- name: "amount",
1500
- type: "uint160"
1501
- },
1502
- {
1503
- internalType: "uint48",
1504
- name: "expiration",
1505
- type: "uint48"
1506
- },
1507
- {
1508
- internalType: "uint48",
1509
- name: "nonce",
1510
- type: "uint48"
1511
- }
1512
- ]
1513
- },
1514
- {
1515
- inputs: [
1516
- {
1517
- internalType: "address",
1518
- name: "token",
1519
- type: "address"
1520
- },
1521
- {
1522
- internalType: "address",
1523
- name: "spender",
1524
- type: "address"
1525
- },
1526
- {
1527
- internalType: "uint160",
1528
- name: "amount",
1529
- type: "uint160"
1530
- },
1531
- {
1532
- internalType: "uint48",
1533
- name: "expiration",
1534
- type: "uint48"
1535
- }
1536
- ],
1537
- stateMutability: "nonpayable",
1538
- type: "function",
1539
- name: "approve"
1540
- },
1541
- {
1542
- inputs: [
1543
- {
1544
- internalType: "address",
1545
- name: "token",
1546
- type: "address"
1547
- },
1548
- {
1549
- internalType: "address",
1550
- name: "spender",
1551
- type: "address"
1552
- },
1553
- {
1554
- internalType: "uint48",
1555
- name: "newNonce",
1556
- type: "uint48"
1557
- }
1558
- ],
1559
- stateMutability: "nonpayable",
1560
- type: "function",
1561
- name: "invalidateNonces"
1562
- },
1563
- {
1564
- inputs: [
1565
- {
1566
- internalType: "uint256",
1567
- name: "wordPos",
1568
- type: "uint256"
1569
- },
1570
- {
1571
- internalType: "uint256",
1572
- name: "mask",
1573
- type: "uint256"
1574
- }
1575
- ],
1576
- stateMutability: "nonpayable",
1577
- type: "function",
1578
- name: "invalidateUnorderedNonces"
1579
- },
1580
- {
1581
- inputs: [
1582
- {
1583
- internalType: "struct IAllowanceTransfer.TokenSpenderPair[]",
1584
- name: "approvals",
1585
- type: "tuple[]",
1586
- components: [
1587
- {
1588
- internalType: "address",
1589
- name: "token",
1590
- type: "address"
1591
- },
1592
- {
1593
- internalType: "address",
1594
- name: "spender",
1595
- type: "address"
1596
- }
1597
- ]
1598
- }
1599
- ],
1600
- stateMutability: "nonpayable",
1601
- type: "function",
1602
- name: "lockdown"
1603
- },
1604
- {
1605
- inputs: [
1606
- {
1607
- internalType: "address",
1608
- name: "",
1609
- type: "address"
1610
- },
1611
- {
1612
- internalType: "uint256",
1613
- name: "",
1614
- type: "uint256"
1615
- }
1616
- ],
1617
- stateMutability: "view",
1618
- type: "function",
1619
- name: "nonceBitmap",
1620
- outputs: [
1621
- {
1622
- internalType: "uint256",
1623
- name: "",
1624
- type: "uint256"
1625
- }
1626
- ]
1627
- },
1628
- {
1629
- inputs: [
1630
- {
1631
- internalType: "address",
1632
- name: "owner",
1633
- type: "address"
1634
- },
1635
- {
1636
- internalType: "struct IAllowanceTransfer.PermitBatch",
1637
- name: "permitBatch",
1638
- type: "tuple",
1639
- components: [
1640
- {
1641
- internalType: "struct IAllowanceTransfer.PermitDetails[]",
1642
- name: "details",
1643
- type: "tuple[]",
1644
- components: [
1645
- {
1646
- internalType: "address",
1647
- name: "token",
1648
- type: "address"
1649
- },
1650
- {
1651
- internalType: "uint160",
1652
- name: "amount",
1653
- type: "uint160"
1654
- },
1655
- {
1656
- internalType: "uint48",
1657
- name: "expiration",
1658
- type: "uint48"
1659
- },
1660
- {
1661
- internalType: "uint48",
1662
- name: "nonce",
1663
- type: "uint48"
1664
- }
1665
- ]
1666
- },
1667
- {
1668
- internalType: "address",
1669
- name: "spender",
1670
- type: "address"
1671
- },
1672
- {
1673
- internalType: "uint256",
1674
- name: "sigDeadline",
1675
- type: "uint256"
1676
- }
1677
- ]
1678
- },
1679
- {
1680
- internalType: "bytes",
1681
- name: "signature",
1682
- type: "bytes"
1683
- }
1684
- ],
1685
- stateMutability: "nonpayable",
1686
- type: "function",
1687
- name: "permit"
1688
- },
1689
- {
1690
- inputs: [
1691
- {
1692
- internalType: "address",
1693
- name: "owner",
1694
- type: "address"
1695
- },
1696
- {
1697
- internalType: "struct IAllowanceTransfer.PermitSingle",
1698
- name: "permitSingle",
1699
- type: "tuple",
1700
- components: [
1701
- {
1702
- internalType: "struct IAllowanceTransfer.PermitDetails",
1703
- name: "details",
1704
- type: "tuple",
1705
- components: [
1706
- {
1707
- internalType: "address",
1708
- name: "token",
1709
- type: "address"
1710
- },
1711
- {
1712
- internalType: "uint160",
1713
- name: "amount",
1714
- type: "uint160"
1715
- },
1716
- {
1717
- internalType: "uint48",
1718
- name: "expiration",
1719
- type: "uint48"
1720
- },
1721
- {
1722
- internalType: "uint48",
1723
- name: "nonce",
1724
- type: "uint48"
1725
- }
1726
- ]
1727
- },
1728
- {
1729
- internalType: "address",
1730
- name: "spender",
1731
- type: "address"
1732
- },
1733
- {
1734
- internalType: "uint256",
1735
- name: "sigDeadline",
1736
- type: "uint256"
1737
- }
1738
- ]
1739
- },
1740
- {
1741
- internalType: "bytes",
1742
- name: "signature",
1743
- type: "bytes"
1744
- }
1745
- ],
1746
- stateMutability: "nonpayable",
1747
- type: "function",
1748
- name: "permit"
1749
- },
1750
- {
1751
- inputs: [
1752
- {
1753
- internalType: "struct ISignatureTransfer.PermitBatchTransferFrom",
1754
- name: "permit",
1755
- type: "tuple",
1756
- components: [
1757
- {
1758
- internalType: "struct ISignatureTransfer.TokenPermissions[]",
1759
- name: "permitted",
1760
- type: "tuple[]",
1761
- components: [
1762
- {
1763
- internalType: "address",
1764
- name: "token",
1765
- type: "address"
1766
- },
1767
- {
1768
- internalType: "uint256",
1769
- name: "amount",
1770
- type: "uint256"
1771
- }
1772
- ]
1773
- },
1774
- {
1775
- internalType: "uint256",
1776
- name: "nonce",
1777
- type: "uint256"
1778
- },
1779
- {
1780
- internalType: "uint256",
1781
- name: "deadline",
1782
- type: "uint256"
1783
- }
1784
- ]
1785
- },
1786
- {
1787
- internalType: "address",
1788
- name: "owner",
1789
- type: "address"
1790
- },
1791
- {
1792
- internalType: "struct ISignatureTransfer.SignatureTransferDetails[]",
1793
- name: "transferDetails",
1794
- type: "tuple[]",
1795
- components: [
1796
- {
1797
- internalType: "address",
1798
- name: "to",
1799
- type: "address"
1800
- },
1801
- {
1802
- internalType: "uint256",
1803
- name: "requestedAmount",
1804
- type: "uint256"
1805
- }
1806
- ]
1807
- },
1808
- {
1809
- internalType: "bytes",
1810
- name: "signature",
1811
- type: "bytes"
1812
- }
1813
- ],
1814
- stateMutability: "nonpayable",
1815
- type: "function",
1816
- name: "permitTransferFrom"
1817
- },
1818
- {
1819
- inputs: [
1820
- {
1821
- internalType: "struct ISignatureTransfer.PermitTransferFrom",
1822
- name: "permit",
1823
- type: "tuple",
1824
- components: [
1825
- {
1826
- internalType: "struct ISignatureTransfer.TokenPermissions",
1827
- name: "permitted",
1828
- type: "tuple",
1829
- components: [
1830
- {
1831
- internalType: "address",
1832
- name: "token",
1833
- type: "address"
1834
- },
1835
- {
1836
- internalType: "uint256",
1837
- name: "amount",
1838
- type: "uint256"
1839
- }
1840
- ]
1841
- },
1842
- {
1843
- internalType: "uint256",
1844
- name: "nonce",
1845
- type: "uint256"
1846
- },
1847
- {
1848
- internalType: "uint256",
1849
- name: "deadline",
1850
- type: "uint256"
1851
- }
1852
- ]
1853
- },
1854
- {
1855
- internalType: "address",
1856
- name: "owner",
1857
- type: "address"
1858
- },
1859
- {
1860
- internalType: "address",
1861
- name: "to",
1862
- type: "address"
1863
- },
1864
- {
1865
- internalType: "uint256",
1866
- name: "requestedAmount",
1867
- type: "uint256"
1868
- },
1869
- {
1870
- internalType: "bytes",
1871
- name: "signature",
1872
- type: "bytes"
1873
- }
1874
- ],
1875
- stateMutability: "nonpayable",
1876
- type: "function",
1877
- name: "permitTransferFrom"
1878
- },
1879
- {
1880
- inputs: [
1881
- {
1882
- internalType: "struct ISignatureTransfer.PermitBatchTransferFrom",
1883
- name: "permit",
1884
- type: "tuple",
1885
- components: [
1886
- {
1887
- internalType: "struct ISignatureTransfer.TokenPermissions[]",
1888
- name: "permitted",
1889
- type: "tuple[]",
1890
- components: [
1891
- {
1892
- internalType: "address",
1893
- name: "token",
1894
- type: "address"
1895
- },
1896
- {
1897
- internalType: "uint256",
1898
- name: "amount",
1899
- type: "uint256"
1900
- }
1901
- ]
1902
- },
1903
- {
1904
- internalType: "uint256",
1905
- name: "nonce",
1906
- type: "uint256"
1907
- },
1908
- {
1909
- internalType: "uint256",
1910
- name: "deadline",
1911
- type: "uint256"
1912
- }
1913
- ]
1914
- },
1915
- {
1916
- internalType: "address",
1917
- name: "owner",
1918
- type: "address"
1919
- },
1920
- {
1921
- internalType: "struct ISignatureTransfer.SignatureTransferDetails[]",
1922
- name: "transferDetails",
1923
- type: "tuple[]",
1924
- components: [
1925
- {
1926
- internalType: "address",
1927
- name: "to",
1928
- type: "address"
1929
- },
1930
- {
1931
- internalType: "uint256",
1932
- name: "requestedAmount",
1933
- type: "uint256"
1934
- }
1935
- ]
1936
- },
1937
- {
1938
- internalType: "bytes32",
1939
- name: "witness",
1940
- type: "bytes32"
1941
- },
1942
- {
1943
- internalType: "string",
1944
- name: "witnessTypeString",
1945
- type: "string"
1946
- },
1947
- {
1948
- internalType: "bytes",
1949
- name: "signature",
1950
- type: "bytes"
1951
- }
1952
- ],
1953
- stateMutability: "nonpayable",
1954
- type: "function",
1955
- name: "permitWitnessTransferFrom"
1956
- },
1957
- {
1958
- inputs: [
1959
- {
1960
- internalType: "struct ISignatureTransfer.PermitTransferFrom",
1961
- name: "permit",
1962
- type: "tuple",
1963
- components: [
1964
- {
1965
- internalType: "struct ISignatureTransfer.TokenPermissions",
1966
- name: "permitted",
1967
- type: "tuple",
1968
- components: [
1969
- {
1970
- internalType: "address",
1971
- name: "token",
1972
- type: "address"
1973
- },
1974
- {
1975
- internalType: "uint256",
1976
- name: "amount",
1977
- type: "uint256"
1978
- }
1979
- ]
1980
- },
1981
- {
1982
- internalType: "uint256",
1983
- name: "nonce",
1984
- type: "uint256"
1985
- },
1986
- {
1987
- internalType: "uint256",
1988
- name: "deadline",
1989
- type: "uint256"
1990
- }
1991
- ]
1992
- },
1993
- {
1994
- internalType: "address",
1995
- name: "owner",
1996
- type: "address"
1997
- },
1998
- {
1999
- internalType: "address",
2000
- name: "to",
2001
- type: "address"
2002
- },
2003
- {
2004
- internalType: "uint256",
2005
- name: "requestedAmount",
2006
- type: "uint256"
2007
- },
2008
- {
2009
- internalType: "bytes32",
2010
- name: "witness",
2011
- type: "bytes32"
2012
- },
2013
- {
2014
- internalType: "string",
2015
- name: "witnessTypeString",
2016
- type: "string"
2017
- },
2018
- {
2019
- internalType: "bytes",
2020
- name: "signature",
2021
- type: "bytes"
2022
- }
2023
- ],
2024
- stateMutability: "nonpayable",
2025
- type: "function",
2026
- name: "permitWitnessTransferFrom"
2027
- },
2028
- {
2029
- inputs: [
2030
- {
2031
- internalType: "struct IAllowanceTransfer.AllowanceTransferDetails[]",
2032
- name: "transferDetails",
2033
- type: "tuple[]",
2034
- components: [
2035
- {
2036
- internalType: "address",
2037
- name: "from",
2038
- type: "address"
2039
- },
2040
- {
2041
- internalType: "address",
2042
- name: "to",
2043
- type: "address"
2044
- },
2045
- {
2046
- internalType: "uint160",
2047
- name: "amount",
2048
- type: "uint160"
2049
- },
2050
- {
2051
- internalType: "address",
2052
- name: "token",
2053
- type: "address"
2054
- }
2055
- ]
2056
- }
2057
- ],
2058
- stateMutability: "nonpayable",
2059
- type: "function",
2060
- name: "transferFrom"
2061
- },
2062
- {
2063
- inputs: [
2064
- {
2065
- internalType: "address",
2066
- name: "from",
2067
- type: "address"
2068
- },
2069
- {
2070
- internalType: "address",
2071
- name: "to",
2072
- type: "address"
2073
- },
2074
- {
2075
- internalType: "uint160",
2076
- name: "amount",
2077
- type: "uint160"
2078
- },
2079
- {
2080
- internalType: "address",
2081
- name: "token",
2082
- type: "address"
2083
- }
2084
- ],
2085
- stateMutability: "nonpayable",
2086
- type: "function",
2087
- name: "transferFrom"
2088
- }
2089
- ],
2090
- devdoc: {
2091
- kind: "dev",
2092
- methods: {
2093
- "DOMAIN_SEPARATOR()": {
2094
- details: "Uses cached version if chainid and address are unchanged from construction."
2095
- },
2096
- "approve(address,address,uint160,uint48)": {
2097
- details: "The packed allowance also holds a nonce, which will stay unchanged in approve",
2098
- params: {
2099
- amount: "The approved amount of the token",
2100
- expiration: "The timestamp at which the approval is no longer valid",
2101
- spender: "The spender address to approve",
2102
- token: "The token to approve"
2103
- }
2104
- },
2105
- "invalidateNonces(address,address,uint48)": {
2106
- details: "Can't invalidate more than 2**16 nonces per transaction.",
2107
- params: {
2108
- newNonce: "The new nonce to set. Invalidates all nonces less than it.",
2109
- spender: "The spender to invalidate nonces for",
2110
- token: "The token to invalidate nonces for"
2111
- }
2112
- },
2113
- "invalidateUnorderedNonces(uint256,uint256)": {
2114
- details: "The wordPos is maxed at type(uint248).max",
2115
- params: {
2116
- mask: "A bitmap masked against msg.sender's current bitmap at the word position",
2117
- wordPos: "A number to index the nonceBitmap at"
2118
- }
2119
- },
2120
- "lockdown((address,address)[])": {
2121
- params: {
2122
- approvals: "Array of approvals to revoke."
2123
- }
2124
- },
2125
- "permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)": {
2126
- details: "May fail if the owner's nonce was invalidated in-flight by invalidateNonce",
2127
- params: {
2128
- owner: "The owner of the tokens being approved",
2129
- permitSingle: "Data signed over by the owner specifying the terms of approval",
2130
- signature: "The owner's signature over the permit data"
2131
- }
2132
- },
2133
- "permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)": {
2134
- details: "May fail if the owner's nonce was invalidated in-flight by invalidateNonce",
2135
- params: {
2136
- owner: "The owner of the tokens being approved",
2137
- permitBatch: "Data signed over by the owner specifying the terms of approval",
2138
- signature: "The owner's signature over the permit data"
2139
- }
2140
- },
2141
- "permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)": {
2142
- details: "If to is the zero address, the tokens are sent to the signed spender",
2143
- params: {
2144
- owner: "The owner of the tokens to transfer",
2145
- permit: "The permit data signed over by the owner",
2146
- requestedAmount: "The amount of tokens to transfer",
2147
- signature: "The signature to verify",
2148
- to: "The recipient of the tokens"
2149
- }
2150
- },
2151
- "permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)": {
2152
- params: {
2153
- owner: "The owner of the tokens to transfer",
2154
- permit: "The permit data signed over by the owner",
2155
- signature: "The signature to verify"
2156
- }
2157
- },
2158
- "permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,bytes)": {
2159
- details: "If to is the zero address, the tokens are sent to the spenderThe witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition",
2160
- params: {
2161
- owner: "The owner of the tokens to transfer",
2162
- permit: "The permit data signed over by the owner",
2163
- requestedAmount: "The amount of tokens to transfer",
2164
- signature: "The signature to verify",
2165
- to: "The recipient of the tokens",
2166
- witness: "Extra data to include when checking the user signature",
2167
- witnessTypeString: "The EIP-712 type definition for the witness type"
2168
- }
2169
- },
2170
- "permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,bytes)": {
2171
- details: "The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition",
2172
- params: {
2173
- owner: "The owner of the tokens to transfer",
2174
- permit: "The permit data signed over by the owner",
2175
- signature: "The signature to verify",
2176
- witness: "Extra data to include when checking the user signature",
2177
- witnessTypeString: "The EIP-712 type definition for the witness type"
2178
- }
2179
- },
2180
- "transferFrom((address,address,uint160,address)[])": {
2181
- details: "Requires the from address to have approved at least the desired amount of tokens to msg.sender.",
2182
- params: {
2183
- transferDetails: "Array of recipients for the transfers"
2184
- }
2185
- },
2186
- "transferFrom(address,address,uint160,address)": {
2187
- details: "Requires the from address to have approved at least the desired amount of tokens to msg.sender.",
2188
- params: {
2189
- from: "The address to transfer from."
2190
- }
2191
- }
2192
- },
2193
- version: 1
2194
- },
2195
- userdoc: {
2196
- kind: "user",
2197
- methods: {
2198
- "DOMAIN_SEPARATOR()": {
2199
- notice: "Returns the domain separator for the current chain."
2200
- },
2201
- "allowance(address,address,address)": {
2202
- notice: "Maps users to tokens to spender addresses and information about the approval on the token"
2203
- },
2204
- "approve(address,address,uint160,uint48)": {
2205
- notice: "Approves the spender to use up to amount of the specified token up until the expiration"
2206
- },
2207
- "invalidateNonces(address,address,uint48)": {
2208
- notice: "Invalidate nonces for a given (token, spender) pair"
2209
- },
2210
- "invalidateUnorderedNonces(uint256,uint256)": {
2211
- notice: "Invalidates the bits specified in mask for the bitmap at the word position"
2212
- },
2213
- "lockdown((address,address)[])": {
2214
- notice: "Enables performing a \"lockdown\" of the sender's Permit2 identity by batch revoking approvals"
2215
- },
2216
- "nonceBitmap(address,uint256)": {
2217
- notice: "A bitmap used for replay protection"
2218
- },
2219
- "permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)": {
2220
- notice: "Permit a spender to a given amount of the owners token via the owner's EIP-712 signature"
2221
- },
2222
- "permit(address,((address,uint160,uint48,uint48)[],address,uint256),bytes)": {
2223
- notice: "Permit a spender to the signed amounts of the owners tokens via the owner's EIP-712 signature"
2224
- },
2225
- "permitTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes)": {
2226
- notice: "Transfers a token using a signed permit message"
2227
- },
2228
- "permitTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes)": {
2229
- notice: "Transfers multiple tokens using a signed permit message"
2230
- },
2231
- "permitWitnessTransferFrom(((address,uint256),uint256,uint256),address,address,uint256,bytes32,string,bytes)": {
2232
- notice: "Transfers a token using a signed permit messageIncludes extra data provided by the caller to verify signature over"
2233
- },
2234
- "permitWitnessTransferFrom(((address,uint256)[],uint256,uint256),address,(address,uint256)[],bytes32,string,bytes)": {
2235
- notice: "Transfers multiple tokens using a signed permit messageIncludes extra data provided by the caller to verify signature over"
2236
- },
2237
- "transferFrom((address,address,uint160,address)[])": {
2238
- notice: "Transfer approved tokens in a batch"
2239
- },
2240
- "transferFrom(address,address,uint160,address)": {
2241
- notice: "Transfer approved tokens from one address to another."
2242
- }
2243
- },
2244
- version: 1
2245
- }
2246
- },
2247
- settings: {
2248
- remappings: [
2249
- ":@ensdomains/=node_modules/@uniswap/narwhal/node_modules/@ensdomains/",
2250
- ":@openzeppelin/=node_modules/@openzeppelin/",
2251
- ":@uniswap/=node_modules/@uniswap/",
2252
- ":base64-sol/=node_modules/base64-sol/",
2253
- ":ds-test/=lib/forge-std/lib/ds-test/src/",
2254
- ":forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/",
2255
- ":forge-std/=lib/forge-std/src/",
2256
- ":hardhat/=node_modules/@uniswap/narwhal/node_modules/hardhat/",
2257
- ":narwhal/=node_modules/@uniswap/narwhal/contracts/",
2258
- ":openzeppelin-contracts/=node_modules/openzeppelin-contracts/",
2259
- ":openzeppelin-contracts/contracts/=node_modules/openzeppelin-contracts/",
2260
- ":permit2/=lib/permit2/",
2261
- ":solmate/=lib/solmate/src/",
2262
- ":v2-core/=node_modules/@uniswap/narwhal/lib/v2-core/",
2263
- ":v3-core/=node_modules/@uniswap/narwhal/lib/v3-core/"
2264
- ],
2265
- optimizer: {
2266
- enabled: true,
2267
- runs: 200
2268
- },
2269
- metadata: {
2270
- bytecodeHash: "ipfs"
2271
- },
2272
- compilationTarget: {
2273
- "lib/permit2/src/Permit2.sol": "Permit2"
2274
- },
2275
- libraries: {
2276
- },
2277
- viaIR: true
2278
- },
2279
- sources: {
2280
- "lib/permit2/src/AllowanceTransfer.sol": {
2281
- keccak256: "0x416199602ce396a8e075d3a386fc490fa676d27dc6bc915b1daa3f729ce14228",
2282
- urls: [
2283
- "bzz-raw://ed5cb300c53a37be5e9731d8c530493000e3ab19c13f817dbe2be7679399a456",
2284
- "dweb:/ipfs/QmaCe9cGb91ocubBeBEyLaTHgoWwU32tFYkMWWvEEP7ihU"
2285
- ],
2286
- license: "MIT"
2287
- },
2288
- "lib/permit2/src/EIP712.sol": {
2289
- keccak256: "0x973d4358c262467a4c2a0c2867c676a8a138102968d8b89355c42f655d1a7a68",
2290
- urls: [
2291
- "bzz-raw://7219a31ace8c0a959392cc2ee06817c7c98dfc491e96d27f71a09fb23860b62c",
2292
- "dweb:/ipfs/QmUGRLgddHZ3GoouEBoMYbRS4wVGapJrsD2nBxVwxLBibb"
2293
- ],
2294
- license: "MIT"
2295
- },
2296
- "lib/permit2/src/Permit2.sol": {
2297
- keccak256: "0x4a550c6185306292e4c79e0867940e11f509830e5dc83d80a128590b8208785d",
2298
- urls: [
2299
- "bzz-raw://79852589685430a04c5df74a9a64fd10ccc996d0e62a3b5dc22f319a02d12734",
2300
- "dweb:/ipfs/QmTJxgFNwC2gGTfqPQDsr5AU7qnA4WirETKFh7mBTKcwP2"
2301
- ],
2302
- license: "MIT"
2303
- },
2304
- "lib/permit2/src/PermitErrors.sol": {
2305
- keccak256: "0x9fd1192bbc3ffa9354f2bfc534d7a1cdf2be2c940c96ed4ac7bc37991e1e5dfe",
2306
- urls: [
2307
- "bzz-raw://77f8b2e2c040c33e2c78f05e7e768a17f433c07adb699235c35c4dac92115070",
2308
- "dweb:/ipfs/QmYX2VTyTm6QLtgp54kCrkAGY8uPxkx28urwLNEJsxTHJs"
2309
- ],
2310
- license: "MIT"
2311
- },
2312
- "lib/permit2/src/SignatureTransfer.sol": {
2313
- keccak256: "0xe95e5e2cf1d166fcc1844c857a96859a46f33a24bc2f76b2a66df8ed535a1a5b",
2314
- urls: [
2315
- "bzz-raw://67c6e12923579a072953a552db3a198018277b9c0215898b14e5e5dfe49db9d1",
2316
- "dweb:/ipfs/QmT7q5CWDtig6EVLVKfaaZRBfiV4c2mgxaKjQbjqkzpvGW"
2317
- ],
2318
- license: "MIT"
2319
- },
2320
- "lib/permit2/src/interfaces/IAllowanceTransfer.sol": {
2321
- keccak256: "0x7af3d23aa1a0ede5a649051395ea1fb5a54c3e68d50db7e02f00e201f2afb9c6",
2322
- urls: [
2323
- "bzz-raw://2309065f58069ace887997953192b6d9e6185ca9d8eb54266fbcbaec3e65af56",
2324
- "dweb:/ipfs/QmbuEKJCupdWMqY5APmG8bnFqiNYGc6kERQNXpasdsZrsz"
2325
- ],
2326
- license: "MIT"
2327
- },
2328
- "lib/permit2/src/interfaces/IERC1271.sol": {
2329
- keccak256: "0x96f516510d08da5b1d05d81b0bd88af6f9928bb757ba55c27e203654dfcd4fa0",
2330
- urls: [
2331
- "bzz-raw://c0942604688c369aed50905d7cef2ece68e1ff457c95a14c9f913babac29a09a",
2332
- "dweb:/ipfs/Qmf4ZBYCKqQHfnACciz8GEMhwxPw7mhQ6fjGXwpgr8CQF8"
2333
- ],
2334
- license: "MIT"
2335
- },
2336
- "lib/permit2/src/interfaces/ISignatureTransfer.sol": {
2337
- keccak256: "0x4079172a6b068b6fb7575c8558ae5ed181b16e3370ffe85f1f0eb632c848918b",
2338
- urls: [
2339
- "bzz-raw://a4cd29908a0261ae2abca79cdc34ae8d4bc4b4ee15024e2b447cb886089d81d9",
2340
- "dweb:/ipfs/QmSVZdXJVY5vDjb5RD7fWAqWD4VcRdtFRr855Nxqp9sG51"
2341
- ],
2342
- license: "MIT"
2343
- },
2344
- "lib/permit2/src/libraries/Allowance.sol": {
2345
- keccak256: "0x1e6bb822d9d99d96a05ae08f05503530f60edcd8faedd2c832858f5ce15b7338",
2346
- urls: [
2347
- "bzz-raw://0fe391785aff4b402b5fa40cdf3f1629007d5368e8322fc008b8b7cee9c7a2e7",
2348
- "dweb:/ipfs/QmbsrVA3ZuLThnXus59A5S5inwJFa6TkRXg7LPPmiphnPy"
2349
- ],
2350
- license: "MIT"
2351
- },
2352
- "lib/permit2/src/libraries/PermitHash.sol": {
2353
- keccak256: "0x54af80d9c3193934c6947c31f59b8f3d7918f83676fe92ed6136593ad591d478",
2354
- urls: [
2355
- "bzz-raw://5264001770be2cdeb7651e4d22af7edbc4e16da6d38747efeb4f54b5472ca5c5",
2356
- "dweb:/ipfs/QmPvwau7DXw6stGQ14hpyTeLdYDYrrrdMnUfkQTPpMXQxz"
2357
- ],
2358
- license: "MIT"
2359
- },
2360
- "lib/permit2/src/libraries/SignatureVerification.sol": {
2361
- keccak256: "0x11ee84c2af88753814851205b33000dbae7ba8fc24e2d9e291f4ca55b9770619",
2362
- urls: [
2363
- "bzz-raw://38325182d5be74f7ec54b5e4b2ec80cfa6bf086c40f8e1e24eb427eb15f60951",
2364
- "dweb:/ipfs/QmQy4sVzHcxRc8PVx6xWGDKjwYa5pA2R1Fqkmk3X8xouKB"
2365
- ],
2366
- license: "MIT"
2367
- },
2368
- "lib/solmate/src/tokens/ERC20.sol": {
2369
- keccak256: "0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10",
2370
- urls: [
2371
- "bzz-raw://57b3ab70cde374af1cf2c9888636e8de6cf660f087b1c9abd805e9271e19fa35",
2372
- "dweb:/ipfs/QmNrLDBAHYFjpjSd12jerm1AdBkDqEYUUaXgnT854BUZ97"
2373
- ],
2374
- license: "AGPL-3.0-only"
2375
- },
2376
- "lib/solmate/src/utils/SafeTransferLib.sol": {
2377
- keccak256: "0xbadf3d708cf532b12f75f78a1d423135954b63774a6d4ba15914a551d348db8a",
2378
- urls: [
2379
- "bzz-raw://88ac8256bd520d1b8e6f9c4ac9e8777bffdc4a6c8afb1a848f596665779a55b4",
2380
- "dweb:/ipfs/QmXx7X1dxe6f5VM91vgQ5BA4r2eF97GWDcQDrgHytcvfjU"
2381
- ],
2382
- license: "AGPL-3.0-only"
2383
- }
2384
- },
2385
- version: 1
2386
- };
2387
- var ast = {
2388
- absolutePath: "lib/permit2/src/Permit2.sol",
2389
- id: 25082,
2390
- exportedSymbols: {
2391
- AllowanceTransfer: [
2392
- 24974
2393
- ],
2394
- Permit2: [
2395
- 25081
2396
- ],
2397
- SignatureTransfer: [
2398
- 25528
2399
- ]
2400
- },
2401
- nodeType: "SourceUnit",
2402
- src: "32:204:16",
2403
- nodes: [
2404
- {
2405
- id: 25072,
2406
- nodeType: "PragmaDirective",
2407
- src: "32:23:16",
2408
- nodes: [
2409
- ],
2410
- literals: [
2411
- "solidity",
2412
- "0.8",
2413
- ".17"
2414
- ]
2415
- },
2416
- {
2417
- id: 25074,
2418
- nodeType: "ImportDirective",
2419
- src: "57:58:16",
2420
- nodes: [
2421
- ],
2422
- absolutePath: "lib/permit2/src/SignatureTransfer.sol",
2423
- file: "./SignatureTransfer.sol",
2424
- nameLocation: "-1:-1:-1",
2425
- scope: 25082,
2426
- sourceUnit: 25529,
2427
- symbolAliases: [
2428
- {
2429
- foreign: {
2430
- id: 25073,
2431
- name: "SignatureTransfer",
2432
- nodeType: "Identifier",
2433
- overloadedDeclarations: [
2434
- ],
2435
- referencedDeclaration: 25528,
2436
- src: "65:17:16",
2437
- typeDescriptions: {
2438
- }
2439
- },
2440
- nameLocation: "-1:-1:-1"
2441
- }
2442
- ],
2443
- unitAlias: ""
2444
- },
2445
- {
2446
- id: 25076,
2447
- nodeType: "ImportDirective",
2448
- src: "116:58:16",
2449
- nodes: [
2450
- ],
2451
- absolutePath: "lib/permit2/src/AllowanceTransfer.sol",
2452
- file: "./AllowanceTransfer.sol",
2453
- nameLocation: "-1:-1:-1",
2454
- scope: 25082,
2455
- sourceUnit: 24975,
2456
- symbolAliases: [
2457
- {
2458
- foreign: {
2459
- id: 25075,
2460
- name: "AllowanceTransfer",
2461
- nodeType: "Identifier",
2462
- overloadedDeclarations: [
2463
- ],
2464
- referencedDeclaration: 24974,
2465
- src: "124:17:16",
2466
- typeDescriptions: {
2467
- }
2468
- },
2469
- nameLocation: "-1:-1:-1"
2470
- }
2471
- ],
2472
- unitAlias: ""
2473
- },
2474
- {
2475
- id: 25081,
2476
- nodeType: "ContractDefinition",
2477
- src: "176:59:16",
2478
- nodes: [
2479
- ],
2480
- abstract: false,
2481
- baseContracts: [
2482
- {
2483
- baseName: {
2484
- id: 25077,
2485
- name: "SignatureTransfer",
2486
- nameLocations: [
2487
- "196:17:16"
2488
- ],
2489
- nodeType: "IdentifierPath",
2490
- referencedDeclaration: 25528,
2491
- src: "196:17:16"
2492
- },
2493
- id: 25078,
2494
- nodeType: "InheritanceSpecifier",
2495
- src: "196:17:16"
2496
- },
2497
- {
2498
- baseName: {
2499
- id: 25079,
2500
- name: "AllowanceTransfer",
2501
- nameLocations: [
2502
- "215:17:16"
2503
- ],
2504
- nodeType: "IdentifierPath",
2505
- referencedDeclaration: 24974,
2506
- src: "215:17:16"
2507
- },
2508
- id: 25080,
2509
- nodeType: "InheritanceSpecifier",
2510
- src: "215:17:16"
2511
- }
2512
- ],
2513
- canonicalName: "Permit2",
2514
- contractDependencies: [
2515
- ],
2516
- contractKind: "contract",
2517
- fullyImplemented: true,
2518
- linearizedBaseContracts: [
2519
- 25081,
2520
- 24974,
2521
- 25528,
2522
- 25070,
2523
- 25698,
2524
- 25846
2525
- ],
2526
- name: "Permit2",
2527
- nameLocation: "185:7:16",
2528
- scope: 25082,
2529
- usedErrors: [
2530
- 25088,
2531
- 25091,
2532
- 25536,
2533
- 25541,
2534
- 25543,
2535
- 25719,
2536
- 25721,
2537
- 25723,
2538
- 26368,
2539
- 26370,
2540
- 26372,
2541
- 26374
2542
- ]
2543
- }
2544
- ],
2545
- license: "MIT"
2546
- };
2547
- var id = 16;
2548
- var PERMIT2_COMPILE = {
2549
- abi: abi,
2550
- bytecode: bytecode,
2551
- deployedBytecode: deployedBytecode,
2552
- methodIdentifiers: methodIdentifiers,
2553
- rawMetadata: rawMetadata,
2554
- metadata: metadata,
2555
- ast: ast,
2556
- id: id
126
+ var UNIVERSAL_ROUTER_ADDRESS = function UNIVERSAL_ROUTER_ADDRESS(chainId) {
127
+ switch (chainId) {
128
+ case 1:
129
+ return '0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B';
130
+ case 5:
131
+ return '0x4648a43B2C14Da09FdF82B161150d3F634f40491';
132
+ case 137:
133
+ return '0x4C60051384bd2d3C01bfc845Cf5F4b44bcbE9de5';
134
+ case 10:
135
+ return '0xb555edF5dcF85f42cEeF1f3630a52A108E55A654';
136
+ case 42161:
137
+ return '0x4C60051384bd2d3C01bfc845Cf5F4b44bcbE9de5';
138
+ case 42220:
139
+ return '0xC73d61d192FB994157168Fb56730FdEc64C9Cb8F';
140
+ default:
141
+ throw new Error("Universal Router not deployed on chain " + chainId);
142
+ }
2557
143
  };
144
+ var PERMIT2_ADDRESS = '0x000000000022D473030F116dDEE9F6B43aC78BA3';
145
+ var CONTRACT_BALANCE = /*#__PURE__*/BigNumber.from(2).pow(255);
146
+ var ETH_ADDRESS = '0x0000000000000000000000000000000000000000';
147
+ var MSG_SENDER = '0x0000000000000000000000000000000000000001';
148
+ var ADDRESS_THIS = '0x0000000000000000000000000000000000000002';
149
+
150
+ var REFUND_ETH_PRICE_IMPACT_THRESHOLD = /*#__PURE__*/new Percent( /*#__PURE__*/JSBI.BigInt(50), /*#__PURE__*/JSBI.BigInt(100));
151
+ // Wrapper for uniswap router-sdk trade entity to encode swaps for Universal Router
152
+ // also translates trade objects from previous (v2, v3) SDKs
153
+ var UniswapTrade = /*#__PURE__*/function () {
154
+ function UniswapTrade(trade, options) {
155
+ this.trade = trade;
156
+ this.options = options;
157
+ }
158
+ var _proto = UniswapTrade.prototype;
159
+ _proto.encode = function encode(planner, _config) {
160
+ var _this$options$recipie;
161
+ var payerIsUser = true;
162
+ if (this.trade.inputAmount.currency.isNative) {
163
+ // TODO: optimize if only one v2 pool we can directly send this to the pool
164
+ planner.addCommand(CommandType.WRAP_ETH, [ADDRESS_THIS, this.trade.maximumAmountIn(this.options.slippageTolerance).quotient.toString()]);
165
+ // since WETH is now owned by the router, the router pays for inputs
166
+ payerIsUser = false;
167
+ }
168
+ this.options.recipient = (_this$options$recipie = this.options.recipient) != null ? _this$options$recipie : MSG_SENDER;
169
+ // flag for whether we want to perform slippage check on aggregate output of multiple routes
170
+ // 1. when there are >2 exact input trades. this is only a heuristic,
171
+ // as it's still more gas-expensive even in this case, but has benefits
172
+ // in that the reversion probability is lower
173
+ var performAggregatedSlippageCheck = this.trade.tradeType === TradeType.EXACT_INPUT && this.trade.routes.length > 2;
174
+ var outputIsNative = this.trade.outputAmount.currency.isNative;
175
+ var inputIsNative = this.trade.inputAmount.currency.isNative;
176
+ var routerMustCustody = performAggregatedSlippageCheck || outputIsNative;
177
+ for (var _iterator = _createForOfIteratorHelperLoose(this.trade.swaps), _step; !(_step = _iterator()).done;) {
178
+ var swap = _step.value;
179
+ switch (swap.route.protocol) {
180
+ case Protocol.V2:
181
+ addV2Swap(planner, swap, this.trade.tradeType, this.options, payerIsUser, routerMustCustody);
182
+ break;
183
+ case Protocol.V3:
184
+ addV3Swap(planner, swap, this.trade.tradeType, this.options, payerIsUser, routerMustCustody);
185
+ break;
186
+ case Protocol.MIXED:
187
+ addMixedSwap(planner, swap, this.trade.tradeType, this.options, payerIsUser, routerMustCustody);
188
+ break;
189
+ default:
190
+ throw new Error('UNSUPPORTED_TRADE_PROTOCOL');
191
+ }
192
+ }
193
+ if (routerMustCustody) {
194
+ if (outputIsNative) {
195
+ planner.addCommand(CommandType.UNWRAP_WETH, [this.options.recipient, this.trade.minimumAmountOut(this.options.slippageTolerance).quotient.toString()]);
196
+ } else {
197
+ planner.addCommand(CommandType.SWEEP, [this.trade.outputAmount.currency.wrapped.address, this.options.recipient, this.trade.minimumAmountOut(this.options.slippageTolerance).quotient.toString()]);
198
+ }
199
+ }
200
+ if (inputIsNative && (this.trade.tradeType === TradeType.EXACT_OUTPUT || riskOfPartialFill(this.trade))) {
201
+ // for exactOutput swaps that take native currency as input
202
+ // we need to send back the change to the user
203
+ planner.addCommand(CommandType.UNWRAP_WETH, [this.options.recipient, 0]);
204
+ }
205
+ };
206
+ return UniswapTrade;
207
+ }();
208
+ // encode a uniswap v2 swap
209
+ function addV2Swap(planner, _ref, tradeType, options, payerIsUser, routerMustCustody) {
210
+ var route = _ref.route,
211
+ inputAmount = _ref.inputAmount,
212
+ outputAmount = _ref.outputAmount;
213
+ var trade = new Trade(route, tradeType == TradeType.EXACT_INPUT ? inputAmount : outputAmount, tradeType);
214
+ if (tradeType == TradeType.EXACT_INPUT) {
215
+ planner.addCommand(CommandType.V2_SWAP_EXACT_IN, [
216
+ // if native, we have to unwrap so keep in the router for now
217
+ routerMustCustody ? ADDRESS_THIS : options.recipient, trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), route.path.map(function (pool) {
218
+ return pool.address;
219
+ }), payerIsUser]);
220
+ } else if (tradeType == TradeType.EXACT_OUTPUT) {
221
+ planner.addCommand(CommandType.V2_SWAP_EXACT_OUT, [routerMustCustody ? ADDRESS_THIS : options.recipient, trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), route.path.map(function (pool) {
222
+ return pool.address;
223
+ }), payerIsUser]);
224
+ }
225
+ }
226
+ // encode a uniswap v3 swap
227
+ function addV3Swap(planner, _ref2, tradeType, options, payerIsUser, routerMustCustody) {
228
+ var route = _ref2.route,
229
+ inputAmount = _ref2.inputAmount,
230
+ outputAmount = _ref2.outputAmount;
231
+ var trade = Trade$1.createUncheckedTrade({
232
+ route: route,
233
+ inputAmount: inputAmount,
234
+ outputAmount: outputAmount,
235
+ tradeType: tradeType
236
+ });
237
+ var path = encodeRouteToPath(route, trade.tradeType === TradeType.EXACT_OUTPUT);
238
+ if (tradeType == TradeType.EXACT_INPUT) {
239
+ planner.addCommand(CommandType.V3_SWAP_EXACT_IN, [routerMustCustody ? ADDRESS_THIS : options.recipient, trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), path, payerIsUser]);
240
+ } else if (tradeType == TradeType.EXACT_OUTPUT) {
241
+ planner.addCommand(CommandType.V3_SWAP_EXACT_OUT, [routerMustCustody ? ADDRESS_THIS : options.recipient, trade.minimumAmountOut(options.slippageTolerance).quotient.toString(), trade.maximumAmountIn(options.slippageTolerance).quotient.toString(), path, payerIsUser]);
242
+ }
243
+ }
244
+ // encode a mixed route swap, i.e. including both v2 and v3 pools
245
+ function addMixedSwap(planner, swap, tradeType, options, payerIsUser, routerMustCustody) {
246
+ var route = swap.route,
247
+ inputAmount = swap.inputAmount,
248
+ outputAmount = swap.outputAmount;
249
+ var tradeRecipient = routerMustCustody ? ADDRESS_THIS : options.recipient;
250
+ // single hop, so it can be reduced to plain v2 or v3 swap logic
251
+ if (route.pools.length === 1) {
252
+ if (route.pools[0] instanceof Pool) {
253
+ return addV3Swap(planner, swap, tradeType, options, payerIsUser, routerMustCustody);
254
+ } else if (route.pools[0] instanceof Pair) {
255
+ return addV2Swap(planner, swap, tradeType, options, payerIsUser, routerMustCustody);
256
+ } else {
257
+ throw new Error('Invalid route type');
258
+ }
259
+ }
260
+ var trade = MixedRouteTrade.createUncheckedTrade({
261
+ route: route,
262
+ inputAmount: inputAmount,
263
+ outputAmount: outputAmount,
264
+ tradeType: tradeType
265
+ });
266
+ var amountIn = trade.maximumAmountIn(options.slippageTolerance, inputAmount).quotient.toString();
267
+ var amountOut = trade.minimumAmountOut(options.slippageTolerance, outputAmount).quotient.toString();
268
+ // logic from
269
+ // https://github.com/Uniswap/router-sdk/blob/d8eed164e6c79519983844ca8b6a3fc24ebcb8f8/src/swapRouter.ts#L276
270
+ var sections = partitionMixedRouteByProtocol(route);
271
+ var isLastSectionInRoute = function isLastSectionInRoute(i) {
272
+ return i === sections.length - 1;
273
+ };
274
+ var outputToken;
275
+ var inputToken = route.input.wrapped;
276
+ for (var i = 0; i < sections.length; i++) {
277
+ var section = sections[i];
278
+ /// Now, we get output of this section
279
+ outputToken = getOutputOfPools(section, inputToken);
280
+ var newRouteOriginal = new MixedRouteSDK([].concat(section), section[0].token0.equals(inputToken) ? section[0].token0 : section[0].token1, outputToken);
281
+ var newRoute = new MixedRoute(newRouteOriginal);
282
+ /// Previous output is now input
283
+ inputToken = outputToken;
284
+ var mixedRouteIsAllV3 = function mixedRouteIsAllV3(route) {
285
+ return route.pools.every(function (pool) {
286
+ return pool instanceof Pool;
287
+ });
288
+ };
289
+ if (mixedRouteIsAllV3(newRoute)) {
290
+ var path = encodeMixedRouteToPath(newRoute);
291
+ planner.addCommand(CommandType.V3_SWAP_EXACT_IN, [
292
+ // if not last section: send tokens directly to the first v2 pair of the next section
293
+ // note: because of the partitioning function we can be sure that the next section is v2
294
+ isLastSectionInRoute(i) ? tradeRecipient : sections[i + 1][0].liquidityToken.address, i == 0 ? amountIn : CONTRACT_BALANCE, !isLastSectionInRoute(i) ? 0 : amountOut, path, payerIsUser && i === 0]);
295
+ } else {
296
+ planner.addCommand(CommandType.V2_SWAP_EXACT_IN, [isLastSectionInRoute(i) ? tradeRecipient : ADDRESS_THIS, i === 0 ? amountIn : CONTRACT_BALANCE, !isLastSectionInRoute(i) ? 0 : amountOut, newRoute.path.map(function (pool) {
297
+ return pool.address;
298
+ }), payerIsUser && i === 0]);
299
+ }
300
+ }
301
+ }
302
+ // if price impact is very high, there's a chance of hitting max/min prices resulting in a partial fill of the swap
303
+ function riskOfPartialFill(trade) {
304
+ return trade.priceImpact.greaterThan(REFUND_ETH_PRICE_IMPACT_THRESHOLD);
305
+ }
2558
306
 
2559
- var PERMIT_SIGNATURE = 'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)';
2560
- var PERMIT2_INTERFACE = /*#__PURE__*/new ethers.utils.Interface(PERMIT2_COMPILE.abi);
2561
307
  function encodePermit(planner, permit) {
2562
- var calldata = PERMIT2_INTERFACE.encodeFunctionData(PERMIT_SIGNATURE, [ethers.constants.AddressZero, permit, permit.signature]);
2563
- planner.addCommand(CommandType.PERMIT, ['0x' + calldata.slice(74)]);
308
+ planner.addCommand(CommandType.PERMIT, [permit, permit.signature]);
2564
309
  }
2565
310
 
2566
311
  var SwapRouter = /*#__PURE__*/function () {
@@ -2569,7 +314,7 @@ var SwapRouter = /*#__PURE__*/function () {
2569
314
  * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given swap.
2570
315
  * @param trades to produce call parameters for
2571
316
  */
2572
- SwapRouter.swapGenieCallParameters = function swapGenieCallParameters(trades, config) {
317
+ SwapRouter.swapNFTCallParameters = function swapNFTCallParameters(trades, config) {
2573
318
  !!!config.sender ? process.env.NODE_ENV !== "production" ? invariant(false, 'SENDER_REQUIRED') : invariant(false) : void 0;
2574
319
  var planner = new RoutePlanner();
2575
320
  var totalPrice = BigNumber.from(0);
@@ -2592,7 +337,7 @@ var SwapRouter = /*#__PURE__*/function () {
2592
337
  SwapRouter.swapERC20CallParameters = function swapERC20CallParameters(trades, options) {
2593
338
  // TODO: use permit if signature included in options
2594
339
  var planner = new RoutePlanner();
2595
- var trade = UniswapTrade.fromAny(trades, options);
340
+ var trade = new UniswapTrade(trades, options);
2596
341
  var inputCurrency = trade.trade.inputAmount.currency;
2597
342
  !!(inputCurrency.isNative && !!options.inputTokenPermit) ? process.env.NODE_ENV !== "production" ? invariant(false, 'NATIVE_INPUT_PERMIT') : invariant(false) : void 0;
2598
343
  if (options.inputTokenPermit && inputCurrency instanceof Token) {
@@ -2628,7 +373,7 @@ var SwapRouter = /*#__PURE__*/function () {
2628
373
  };
2629
374
  return SwapRouter;
2630
375
  }();
2631
- SwapRouter.INTERFACE = /*#__PURE__*/new Interface(abi$8);
376
+ SwapRouter.INTERFACE = /*#__PURE__*/new Interface(abi$7);
2632
377
 
2633
378
  var NFTTrade = function NFTTrade(market, orders) {
2634
379
  !(orders.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'no buy Items') : invariant(false) : void 0;
@@ -2689,7 +434,7 @@ var CryptopunkTrade = /*#__PURE__*/function (_NFTTrade) {
2689
434
  }(NFTTrade);
2690
435
  CryptopunkTrade.CRYPTOPUNK_ADDRESS = '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb';
2691
436
 
2692
- var abi$1 = [
437
+ var abi = [
2693
438
  {
2694
439
  inputs: [
2695
440
  {
@@ -4346,9 +2091,9 @@ var FoundationTrade = /*#__PURE__*/function (_NFTTrade) {
4346
2091
  };
4347
2092
  return FoundationTrade;
4348
2093
  }(NFTTrade);
4349
- FoundationTrade.INTERFACE = /*#__PURE__*/new Interface(abi$1);
2094
+ FoundationTrade.INTERFACE = /*#__PURE__*/new Interface(abi);
4350
2095
 
4351
- var abi$2 = [
2096
+ var abi$1 = [
4352
2097
  {
4353
2098
  inputs: [
4354
2099
  {
@@ -5360,7 +3105,12 @@ var LooksRareTrade = /*#__PURE__*/function (_NFTTrade) {
5360
3105
  for (var _iterator = _createForOfIteratorHelperLoose(this.orders), _step; !(_step = _iterator()).done;) {
5361
3106
  var item = _step.value;
5362
3107
  var calldata = LooksRareTrade.INTERFACE.encodeFunctionData('matchAskWithTakerBidUsingETHAndWETH', [item.takerOrder, item.makerOrder]);
5363
- planner.addCommand(CommandType.LOOKS_RARE_721, [item.makerOrder.price, calldata, item.recipient, item.makerOrder.collection, item.makerOrder.tokenId], config.allowRevert);
3108
+ if (item.tokenType == TokenType.ERC721) {
3109
+ !(item.makerOrder.amount == 1) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ERC721 token amount must be 1') : invariant(false) : void 0;
3110
+ planner.addCommand(CommandType.LOOKS_RARE_721, [item.makerOrder.price, calldata, item.recipient, item.makerOrder.collection, item.makerOrder.tokenId], config.allowRevert);
3111
+ } else if (item.tokenType == TokenType.ERC1155) {
3112
+ planner.addCommand(CommandType.LOOKS_RARE_1155, [item.makerOrder.price, calldata, item.recipient, item.makerOrder.collection, item.makerOrder.tokenId, item.makerOrder.amount], config.allowRevert);
3113
+ }
5364
3114
  }
5365
3115
  };
5366
3116
  _proto.getBuyItems = function getBuyItems() {
@@ -5370,7 +3120,7 @@ var LooksRareTrade = /*#__PURE__*/function (_NFTTrade) {
5370
3120
  buyItems.push({
5371
3121
  tokenAddress: item.makerOrder.collection,
5372
3122
  tokenId: item.makerOrder.tokenId,
5373
- tokenType: TokenType.ERC721
3123
+ tokenType: item.tokenType
5374
3124
  });
5375
3125
  }
5376
3126
  return buyItems;
@@ -5385,9 +3135,9 @@ var LooksRareTrade = /*#__PURE__*/function (_NFTTrade) {
5385
3135
  };
5386
3136
  return LooksRareTrade;
5387
3137
  }(NFTTrade);
5388
- LooksRareTrade.INTERFACE = /*#__PURE__*/new Interface(abi$2);
3138
+ LooksRareTrade.INTERFACE = /*#__PURE__*/new Interface(abi$1);
5389
3139
 
5390
- var abi$3 = [
3140
+ var abi$2 = [
5391
3141
  {
5392
3142
  anonymous: false,
5393
3143
  inputs: [
@@ -5683,9 +3433,9 @@ var NFT20Trade = /*#__PURE__*/function (_NFTTrade) {
5683
3433
  };
5684
3434
  return NFT20Trade;
5685
3435
  }(NFTTrade);
5686
- NFT20Trade.INTERFACE = /*#__PURE__*/new Interface(abi$3);
3436
+ NFT20Trade.INTERFACE = /*#__PURE__*/new Interface(abi$2);
5687
3437
 
5688
- var abi$4 = [
3438
+ var abi$3 = [
5689
3439
  {
5690
3440
  inputs: [
5691
3441
  {
@@ -6453,9 +4203,9 @@ var NFTXTrade = /*#__PURE__*/function (_NFTTrade) {
6453
4203
  };
6454
4204
  return NFTXTrade;
6455
4205
  }(NFTTrade);
6456
- NFTXTrade.INTERFACE = /*#__PURE__*/new Interface(abi$4);
4206
+ NFTXTrade.INTERFACE = /*#__PURE__*/new Interface(abi$3);
6457
4207
 
6458
- var abi$5 = [
4208
+ var abi$4 = [
6459
4209
  {
6460
4210
  inputs: [
6461
4211
  {
@@ -9197,10 +6947,10 @@ var SeaportTrade = /*#__PURE__*/function (_NFTTrade) {
9197
6947
  };
9198
6948
  return SeaportTrade;
9199
6949
  }(NFTTrade);
9200
- SeaportTrade.INTERFACE = /*#__PURE__*/new Interface(abi$5);
6950
+ SeaportTrade.INTERFACE = /*#__PURE__*/new Interface(abi$4);
9201
6951
  SeaportTrade.OPENSEA_CONDUIT_KEY = '0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000';
9202
6952
 
9203
- var abi$6 = [
6953
+ var abi$5 = [
9204
6954
  {
9205
6955
  inputs: [
9206
6956
  {
@@ -10365,9 +8115,9 @@ var SudoswapTrade = /*#__PURE__*/function (_NFTTrade) {
10365
8115
  };
10366
8116
  return SudoswapTrade;
10367
8117
  }(NFTTrade);
10368
- SudoswapTrade.INTERFACE = /*#__PURE__*/new Interface(abi$6);
8118
+ SudoswapTrade.INTERFACE = /*#__PURE__*/new Interface(abi$5);
10369
8119
 
10370
- var abi$7 = [
8120
+ var abi$6 = [
10371
8121
  {
10372
8122
  anonymous: false,
10373
8123
  inputs: [
@@ -11483,7 +9233,11 @@ var X2Y2Trade = /*#__PURE__*/function (_NFTTrade) {
11483
9233
  var item = _step.value;
11484
9234
  var functionSelector = X2Y2Trade.INTERFACE.getSighash(X2Y2Trade.INTERFACE.getFunction('run'));
11485
9235
  var calldata = functionSelector + item.signedInput.slice(2);
11486
- planner.addCommand(CommandType.X2Y2_721, [item.price, calldata, item.recipient, item.tokenAddress, item.tokenId], config.allowRevert);
9236
+ if (item.tokenType == TokenType.ERC721) {
9237
+ planner.addCommand(CommandType.X2Y2_721, [item.price, calldata, item.recipient, item.tokenAddress, item.tokenId], config.allowRevert);
9238
+ } else if (item.tokenType == TokenType.ERC1155) {
9239
+ planner.addCommand(CommandType.X2Y2_1155, [item.price, calldata, item.recipient, item.tokenAddress, item.tokenId, item.tokenAmount], config.allowRevert);
9240
+ }
11487
9241
  }
11488
9242
  };
11489
9243
  _proto.getBuyItems = function getBuyItems() {
@@ -11493,7 +9247,7 @@ var X2Y2Trade = /*#__PURE__*/function (_NFTTrade) {
11493
9247
  buyItems.push({
11494
9248
  tokenAddress: item.tokenAddress,
11495
9249
  tokenId: item.tokenId,
11496
- tokenType: TokenType.ERC721
9250
+ tokenType: item.tokenType
11497
9251
  });
11498
9252
  }
11499
9253
  return buyItems;
@@ -11508,7 +9262,7 @@ var X2Y2Trade = /*#__PURE__*/function (_NFTTrade) {
11508
9262
  };
11509
9263
  return X2Y2Trade;
11510
9264
  }(NFTTrade);
11511
- X2Y2Trade.INTERFACE = /*#__PURE__*/new Interface(abi$7);
9265
+ X2Y2Trade.INTERFACE = /*#__PURE__*/new Interface(abi$6);
11512
9266
 
11513
- export { CryptopunkTrade, FoundationTrade, LooksRareTrade, Market, NFT20Trade, NFTTrade, NFTXTrade, SeaportTrade, SudoswapTrade, SwapRouter, TokenType, UniswapTrade, X2Y2Trade, isRouterTrade };
11514
- //# sourceMappingURL=narwhal-sdk.esm.js.map
9267
+ export { CryptopunkTrade, FoundationTrade, LooksRareTrade, Market, NFT20Trade, NFTTrade, NFTXTrade, PERMIT2_ADDRESS, SeaportTrade, SudoswapTrade, SwapRouter, TokenType, UNIVERSAL_ROUTER_ADDRESS, UniswapTrade, X2Y2Trade };
9268
+ //# sourceMappingURL=universal-router-sdk.esm.js.map