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