@uniswap/universal-router-sdk 1.4.4 → 1.5.0-beta.1

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.
@@ -15,6 +15,20 @@ var v3Sdk = require('@uniswap/v3-sdk');
15
15
  var routerSdk = require('@uniswap/router-sdk');
16
16
  var sdkCore = require('@uniswap/sdk-core');
17
17
 
18
+ function _extends() {
19
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
20
+ for (var i = 1; i < arguments.length; i++) {
21
+ var source = arguments[i];
22
+ for (var key in source) {
23
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
24
+ target[key] = source[key];
25
+ }
26
+ }
27
+ }
28
+ return target;
29
+ };
30
+ return _extends.apply(this, arguments);
31
+ }
18
32
  function _inheritsLoose(subClass, superClass) {
19
33
  subClass.prototype = Object.create(superClass.prototype);
20
34
  subClass.prototype.constructor = subClass;
@@ -82,36 +96,47 @@ var CommandType;
82
96
  CommandType[CommandType["PAY_PORTION"] = 6] = "PAY_PORTION";
83
97
  CommandType[CommandType["V2_SWAP_EXACT_IN"] = 8] = "V2_SWAP_EXACT_IN";
84
98
  CommandType[CommandType["V2_SWAP_EXACT_OUT"] = 9] = "V2_SWAP_EXACT_OUT";
85
- CommandType[CommandType["PERMIT"] = 10] = "PERMIT";
99
+ CommandType[CommandType["PERMIT2_PERMIT"] = 10] = "PERMIT2_PERMIT";
86
100
  CommandType[CommandType["WRAP_ETH"] = 11] = "WRAP_ETH";
87
101
  CommandType[CommandType["UNWRAP_WETH"] = 12] = "UNWRAP_WETH";
88
102
  CommandType[CommandType["PERMIT2_TRANSFER_FROM_BATCH"] = 13] = "PERMIT2_TRANSFER_FROM_BATCH";
89
- CommandType[CommandType["SEAPORT_V1_4"] = 14] = "SEAPORT_V1_4";
103
+ CommandType[CommandType["BALANCE_CHECK_ERC20"] = 14] = "BALANCE_CHECK_ERC20";
90
104
  // NFT-related command types
91
105
  CommandType[CommandType["SEAPORT"] = 16] = "SEAPORT";
92
- CommandType[CommandType["LOOKS_RARE_721"] = 17] = "LOOKS_RARE_721";
106
+ CommandType[CommandType["LOOKS_RARE_V2"] = 17] = "LOOKS_RARE_V2";
93
107
  CommandType[CommandType["NFTX"] = 18] = "NFTX";
94
108
  CommandType[CommandType["CRYPTOPUNKS"] = 19] = "CRYPTOPUNKS";
95
- CommandType[CommandType["LOOKS_RARE_1155"] = 20] = "LOOKS_RARE_1155";
109
+ // 0x14
96
110
  CommandType[CommandType["OWNER_CHECK_721"] = 21] = "OWNER_CHECK_721";
97
111
  CommandType[CommandType["OWNER_CHECK_1155"] = 22] = "OWNER_CHECK_1155";
112
+ CommandType[CommandType["SWEEP_ERC721"] = 23] = "SWEEP_ERC721";
98
113
  CommandType[CommandType["X2Y2_721"] = 24] = "X2Y2_721";
99
114
  CommandType[CommandType["SUDOSWAP"] = 25] = "SUDOSWAP";
100
115
  CommandType[CommandType["NFT20"] = 26] = "NFT20";
101
116
  CommandType[CommandType["X2Y2_1155"] = 27] = "X2Y2_1155";
102
117
  CommandType[CommandType["FOUNDATION"] = 28] = "FOUNDATION";
118
+ CommandType[CommandType["SWEEP_ERC1155"] = 29] = "SWEEP_ERC1155";
119
+ CommandType[CommandType["ELEMENT_MARKET"] = 30] = "ELEMENT_MARKET";
120
+ CommandType[CommandType["SEAPORT_V1_4"] = 32] = "SEAPORT_V1_4";
121
+ CommandType[CommandType["EXECUTE_SUB_PLAN"] = 33] = "EXECUTE_SUB_PLAN";
122
+ CommandType[CommandType["APPROVE_ERC20"] = 34] = "APPROVE_ERC20";
103
123
  })(CommandType || (CommandType = {}));
104
- var PERMIT_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce) details, address spender, uint256 sigDeadline)';
105
- var PERMIT_BATCH_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce)[] details, address spender, uint256 sigDeadline)';
106
124
  var ALLOW_REVERT_FLAG = 0x80;
107
- var REVERTIBLE_COMMANDS = /*#__PURE__*/new Set([CommandType.SEAPORT, CommandType.SEAPORT_V1_4, CommandType.NFTX, CommandType.LOOKS_RARE_721, CommandType.LOOKS_RARE_1155, CommandType.X2Y2_721, CommandType.X2Y2_1155, CommandType.FOUNDATION, CommandType.SUDOSWAP, CommandType.NFT20, CommandType.CRYPTOPUNKS]);
108
- 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.SEAPORT_V1_4] = ['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);
125
+ var REVERTIBLE_COMMANDS = /*#__PURE__*/new Set([CommandType.SEAPORT, CommandType.SEAPORT_V1_4, CommandType.NFTX, CommandType.LOOKS_RARE_V2, CommandType.X2Y2_721, CommandType.X2Y2_1155, CommandType.FOUNDATION, CommandType.SUDOSWAP, CommandType.NFT20, CommandType.EXECUTE_SUB_PLAN, CommandType.CRYPTOPUNKS, CommandType.ELEMENT_MARKET]);
126
+ var PERMIT_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce) details,address spender,uint256 sigDeadline)';
127
+ var PERMIT_BATCH_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce)[] details,address spender,uint256 sigDeadline)';
128
+ var PERMIT2_TRANSFER_FROM_STRUCT = '(address from,address to,uint160 amount,address token)';
129
+ var PERMIT2_TRANSFER_FROM_BATCH_STRUCT = PERMIT2_TRANSFER_FROM_STRUCT + '[]';
130
+ var ABI_DEFINITION = (_ABI_DEFINITION = {}, _ABI_DEFINITION[CommandType.EXECUTE_SUB_PLAN] = ['bytes', 'bytes[]'], _ABI_DEFINITION[CommandType.PERMIT2_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] = [PERMIT2_TRANSFER_FROM_BATCH_STRUCT], _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.WRAP_ETH] = ['address', 'uint256'], _ABI_DEFINITION[CommandType.UNWRAP_WETH] = ['address', 'uint256'], _ABI_DEFINITION[CommandType.SWEEP] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.SWEEP_ERC721] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.SWEEP_ERC1155] = ['address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.TRANSFER] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.PAY_PORTION] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.BALANCE_CHECK_ERC20] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.OWNER_CHECK_721] = ['address', 'address', 'uint256'], _ABI_DEFINITION[CommandType.OWNER_CHECK_1155] = ['address', 'address', 'uint256', 'uint256'], _ABI_DEFINITION[CommandType.APPROVE_ERC20] = ['address', 'uint256'], _ABI_DEFINITION[CommandType.SEAPORT] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.SEAPORT_V1_4] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.NFTX] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.LOOKS_RARE_V2] = ['uint256', 'bytes'], _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.SUDOSWAP] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.NFT20] = ['uint256', 'bytes'], _ABI_DEFINITION[CommandType.CRYPTOPUNKS] = ['uint256', 'address', 'uint256'], _ABI_DEFINITION[CommandType.ELEMENT_MARKET] = ['uint256', 'bytes'], _ABI_DEFINITION);
109
131
  var RoutePlanner = /*#__PURE__*/function () {
110
132
  function RoutePlanner() {
111
133
  this.commands = '0x';
112
134
  this.inputs = [];
113
135
  }
114
136
  var _proto = RoutePlanner.prototype;
137
+ _proto.addSubPlan = function addSubPlan(subplan) {
138
+ this.addCommand(CommandType.EXECUTE_SUB_PLAN, [subplan.commands, subplan.inputs], true);
139
+ };
115
140
  _proto.addCommand = function addCommand(type, parameters, allowRevert) {
116
141
  if (allowRevert === void 0) {
117
142
  allowRevert = false;
@@ -141,14 +166,12 @@ var UNIVERSAL_ROUTER_ADDRESS = function UNIVERSAL_ROUTER_ADDRESS(chainId) {
141
166
  case 1:
142
167
  // mainnet
143
168
  return '0x4C60051384bd2d3C01bfc845Cf5F4b44bcbE9de5';
144
- // URv1.1
145
169
  case 5:
146
170
  // goerli
147
171
  return '0x4648a43B2C14Da09FdF82B161150d3F634f40491';
148
172
  case 137:
149
173
  // polygon
150
- return '0xe40B4A25328dc87bBE396662BAc0cD1C1bE6E883';
151
- // URv1.1
174
+ return '0x4C60051384bd2d3C01bfc845Cf5F4b44bcbE9de5';
152
175
  case 80001:
153
176
  // polygon mumbai
154
177
  return '0x4648a43B2C14Da09FdF82B161150d3F634f40491';
@@ -213,8 +236,11 @@ var WETH_ADDRESS = function WETH_ADDRESS(chainId) {
213
236
  var PERMIT2_ADDRESS = '0x000000000022D473030F116dDEE9F6B43aC78BA3';
214
237
  var CONTRACT_BALANCE = /*#__PURE__*/ethers.BigNumber.from(2).pow(255);
215
238
  var ETH_ADDRESS = '0x0000000000000000000000000000000000000000';
239
+ var ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
216
240
  var SENDER_AS_RECIPIENT = '0x0000000000000000000000000000000000000001';
217
241
  var ROUTER_AS_RECIPIENT = '0x0000000000000000000000000000000000000002';
242
+ var OPENSEA_CONDUIT_SPENDER_ID = 0;
243
+ var SUDOSWAP_SPENDER_ID = 1;
218
244
 
219
245
  var REFUND_ETH_PRICE_IMPACT_THRESHOLD = /*#__PURE__*/new sdkCore.Percent( /*#__PURE__*/JSBI.BigInt(50), /*#__PURE__*/JSBI.BigInt(100));
220
246
  // Wrapper for uniswap router-sdk trade entity to encode swaps for Universal Router
@@ -376,15 +402,52 @@ function riskOfPartialFill(trade) {
376
402
 
377
403
  var SIGNATURE_LENGTH = 65;
378
404
  var EIP_2098_SIGNATURE_LENGTH = 64;
379
- function encodePermit(planner, permit) {
380
- var signature = permit.signature;
381
- var length = ethers.ethers.utils.arrayify(permit.signature).length;
405
+ function encodePermit(planner, permit2) {
406
+ var signature = permit2.signature;
407
+ var length = ethers.ethers.utils.arrayify(permit2.signature).length;
382
408
  // signature data provided for EIP-1271 may have length different from ECDSA signature
383
409
  if (length === SIGNATURE_LENGTH || length === EIP_2098_SIGNATURE_LENGTH) {
384
410
  // sanitizes signature to cover edge cases of malformed EIP-2098 sigs and v used as recovery id
385
- signature = ethers.ethers.utils.joinSignature(ethers.ethers.utils.splitSignature(permit.signature));
411
+ signature = ethers.ethers.utils.joinSignature(ethers.ethers.utils.splitSignature(permit2.signature));
412
+ }
413
+ planner.addCommand(CommandType.PERMIT2_PERMIT, [permit2, signature]);
414
+ }
415
+ // Handles the encoding of commands needed to gather input tokens for a trade
416
+ // Approval: The router approving another address to take tokens.
417
+ // note: Only seaport and sudoswap support this action. Approvals are left open.
418
+ // Permit: A Permit2 signature-based Permit to allow the router to access a user's tokens
419
+ // Transfer: A Permit2 TransferFrom of tokens from a user to either the router or another address
420
+ function encodeInputTokenOptions(planner, options) {
421
+ // first ensure that all tokens provided for encoding are the same
422
+ if (!!options.approval && !!options.permit2Permit) !(options.approval.token === options.permit2Permit.details.token) ? invariant(false, "inconsistent token") : void 0;
423
+ if (!!options.approval && !!options.permit2TransferFrom) !(options.approval.token === options.permit2TransferFrom.token) ? invariant(false, "inconsistent token") : void 0;
424
+ if (!!options.permit2TransferFrom && !!options.permit2Permit) !(options.permit2TransferFrom.token === options.permit2Permit.details.token) ? invariant(false, "inconsistent token") : void 0;
425
+ // if an options.approval is required, add it
426
+ if (!!options.approval) {
427
+ planner.addCommand(CommandType.APPROVE_ERC20, [options.approval.token, mapApprovalProtocol(options.approval.protocol)]);
428
+ }
429
+ // if this order has a options.permit2Permit, encode it
430
+ if (!!options.permit2Permit) {
431
+ encodePermit(planner, options.permit2Permit);
432
+ }
433
+ if (!!options.permit2TransferFrom) {
434
+ planner.addCommand(CommandType.PERMIT2_TRANSFER_FROM, [options.permit2TransferFrom.token, options.permit2TransferFrom.recipient ? options.permit2TransferFrom.recipient : ROUTER_AS_RECIPIENT, options.permit2TransferFrom.amount]);
435
+ }
436
+ }
437
+ function mapApprovalProtocol(protocolAddress) {
438
+ switch (protocolAddress.toLowerCase()) {
439
+ case '0x00000000006c3852cbef3e08e8df289169ede581':
440
+ // Seaport v1.1
441
+ return OPENSEA_CONDUIT_SPENDER_ID;
442
+ case '0x00000000000001ad428e4906ae43d8f9852d0dd6':
443
+ // Seaport v1.4
444
+ return OPENSEA_CONDUIT_SPENDER_ID;
445
+ case '0x2b2e8cda09bba9660dca5cb6233787738ad68329':
446
+ // Sudoswap
447
+ return SUDOSWAP_SPENDER_ID;
448
+ default:
449
+ throw new Error('unsupported protocol address');
386
450
  }
387
- planner.addCommand(CommandType.PERMIT, [permit, signature]);
388
451
  }
389
452
 
390
453
  var SwapRouter = /*#__PURE__*/function () {
@@ -421,7 +484,7 @@ var SwapRouter = /*#__PURE__*/function () {
421
484
  currentNativeValueInRouter = currentNativeValueInRouter.sub(tradePrice);
422
485
  }
423
486
  /**
424
- * is Uniswap Trade
487
+ * is UniswapTrade
425
488
  */
426
489
  } else if (trade.tradeType == exports.RouterTradeType.UniswapTrade) {
427
490
  var uniswapTrade = trade;
@@ -540,13 +603,14 @@ var NFTTrade = function NFTTrade(market, orders) {
540
603
  };
541
604
  (function (Market) {
542
605
  Market["Foundation"] = "foundation";
543
- Market["LooksRare"] = "looksrare";
606
+ Market["LooksRareV2"] = "looksrareV2";
544
607
  Market["NFT20"] = "nft20";
545
608
  Market["NFTX"] = "nftx";
546
609
  Market["Seaport"] = "seaport";
547
610
  Market["Sudoswap"] = "Sudoswap";
548
611
  Market["Cryptopunks"] = "cryptopunks";
549
612
  Market["X2Y2"] = "x2y2";
613
+ Market["Element"] = "element";
550
614
  })(exports.Market || (exports.Market = {}));
551
615
  (function (TokenType) {
552
616
  TokenType["ERC721"] = "ERC721";
@@ -2254,27 +2318,22 @@ var abi$1 = [
2254
2318
  inputs: [
2255
2319
  {
2256
2320
  internalType: "address",
2257
- name: "_currencyManager",
2258
- type: "address"
2259
- },
2260
- {
2261
- internalType: "address",
2262
- name: "_executionManager",
2321
+ name: "_owner",
2263
2322
  type: "address"
2264
2323
  },
2265
2324
  {
2266
2325
  internalType: "address",
2267
- name: "_royaltyFeeManager",
2326
+ name: "_protocolFeeRecipient",
2268
2327
  type: "address"
2269
2328
  },
2270
2329
  {
2271
2330
  internalType: "address",
2272
- name: "_WETH",
2331
+ name: "_transferManager",
2273
2332
  type: "address"
2274
2333
  },
2275
2334
  {
2276
2335
  internalType: "address",
2277
- name: "_protocolFeeRecipient",
2336
+ name: "_weth",
2278
2337
  type: "address"
2279
2338
  }
2280
2339
  ],
@@ -2282,162 +2341,297 @@ var abi$1 = [
2282
2341
  type: "constructor"
2283
2342
  },
2284
2343
  {
2285
- anonymous: false,
2344
+ inputs: [
2345
+ ],
2346
+ name: "CallerInvalid",
2347
+ type: "error"
2348
+ },
2349
+ {
2350
+ inputs: [
2351
+ ],
2352
+ name: "ChainIdInvalid",
2353
+ type: "error"
2354
+ },
2355
+ {
2356
+ inputs: [
2357
+ ],
2358
+ name: "CreatorFeeBpTooHigh",
2359
+ type: "error"
2360
+ },
2361
+ {
2362
+ inputs: [
2363
+ ],
2364
+ name: "CurrencyInvalid",
2365
+ type: "error"
2366
+ },
2367
+ {
2368
+ inputs: [
2369
+ ],
2370
+ name: "ERC20TransferFromFail",
2371
+ type: "error"
2372
+ },
2373
+ {
2374
+ inputs: [
2375
+ ],
2376
+ name: "LengthsInvalid",
2377
+ type: "error"
2378
+ },
2379
+ {
2380
+ inputs: [
2381
+ ],
2382
+ name: "MerkleProofInvalid",
2383
+ type: "error"
2384
+ },
2385
+ {
2286
2386
  inputs: [
2287
2387
  {
2288
- indexed: true,
2289
- internalType: "address",
2290
- name: "user",
2291
- type: "address"
2292
- },
2293
- {
2294
- indexed: false,
2295
2388
  internalType: "uint256",
2296
- name: "newMinNonce",
2389
+ name: "length",
2297
2390
  type: "uint256"
2298
2391
  }
2299
2392
  ],
2300
- name: "CancelAllOrders",
2301
- type: "event"
2393
+ name: "MerkleProofTooLarge",
2394
+ type: "error"
2302
2395
  },
2303
2396
  {
2304
- anonymous: false,
2305
2397
  inputs: [
2306
- {
2307
- indexed: true,
2308
- internalType: "address",
2309
- name: "user",
2310
- type: "address"
2311
- },
2312
- {
2313
- indexed: false,
2314
- internalType: "uint256[]",
2315
- name: "orderNonces",
2316
- type: "uint256[]"
2317
- }
2318
2398
  ],
2319
- name: "CancelMultipleOrders",
2320
- type: "event"
2399
+ name: "NewGasLimitETHTransferTooLow",
2400
+ type: "error"
2321
2401
  },
2322
2402
  {
2323
- anonymous: false,
2324
2403
  inputs: [
2325
- {
2326
- indexed: true,
2327
- internalType: "address",
2328
- name: "currencyManager",
2329
- type: "address"
2330
- }
2331
2404
  ],
2332
- name: "NewCurrencyManager",
2333
- type: "event"
2405
+ name: "NewProtocolFeeRecipientCannotBeNullAddress",
2406
+ type: "error"
2334
2407
  },
2335
2408
  {
2336
- anonymous: false,
2337
2409
  inputs: [
2338
- {
2339
- indexed: true,
2340
- internalType: "address",
2341
- name: "executionManager",
2342
- type: "address"
2343
- }
2344
2410
  ],
2345
- name: "NewExecutionManager",
2346
- type: "event"
2411
+ name: "NoOngoingTransferInProgress",
2412
+ type: "error"
2413
+ },
2414
+ {
2415
+ inputs: [
2416
+ ],
2417
+ name: "NoSelectorForStrategy",
2418
+ type: "error"
2419
+ },
2420
+ {
2421
+ inputs: [
2422
+ ],
2423
+ name: "NoncesInvalid",
2424
+ type: "error"
2425
+ },
2426
+ {
2427
+ inputs: [
2428
+ ],
2429
+ name: "NotAContract",
2430
+ type: "error"
2431
+ },
2432
+ {
2433
+ inputs: [
2434
+ ],
2435
+ name: "NotAffiliateController",
2436
+ type: "error"
2437
+ },
2438
+ {
2439
+ inputs: [
2440
+ ],
2441
+ name: "NotOwner",
2442
+ type: "error"
2443
+ },
2444
+ {
2445
+ inputs: [
2446
+ ],
2447
+ name: "NotV2Strategy",
2448
+ type: "error"
2449
+ },
2450
+ {
2451
+ inputs: [
2452
+ ],
2453
+ name: "NullSignerAddress",
2454
+ type: "error"
2455
+ },
2456
+ {
2457
+ inputs: [
2458
+ ],
2459
+ name: "OutsideOfTimeRange",
2460
+ type: "error"
2461
+ },
2462
+ {
2463
+ inputs: [
2464
+ ],
2465
+ name: "PercentageTooHigh",
2466
+ type: "error"
2467
+ },
2468
+ {
2469
+ inputs: [
2470
+ ],
2471
+ name: "QuoteTypeInvalid",
2472
+ type: "error"
2473
+ },
2474
+ {
2475
+ inputs: [
2476
+ ],
2477
+ name: "ReentrancyFail",
2478
+ type: "error"
2479
+ },
2480
+ {
2481
+ inputs: [
2482
+ ],
2483
+ name: "RenouncementNotInProgress",
2484
+ type: "error"
2485
+ },
2486
+ {
2487
+ inputs: [
2488
+ ],
2489
+ name: "SameDomainSeparator",
2490
+ type: "error"
2491
+ },
2492
+ {
2493
+ inputs: [
2494
+ ],
2495
+ name: "SignatureEOAInvalid",
2496
+ type: "error"
2497
+ },
2498
+ {
2499
+ inputs: [
2500
+ ],
2501
+ name: "SignatureERC1271Invalid",
2502
+ type: "error"
2347
2503
  },
2348
2504
  {
2349
- anonymous: false,
2350
2505
  inputs: [
2351
2506
  {
2352
- indexed: true,
2353
- internalType: "address",
2354
- name: "protocolFeeRecipient",
2355
- type: "address"
2507
+ internalType: "uint256",
2508
+ name: "length",
2509
+ type: "uint256"
2356
2510
  }
2357
2511
  ],
2358
- name: "NewProtocolFeeRecipient",
2359
- type: "event"
2512
+ name: "SignatureLengthInvalid",
2513
+ type: "error"
2514
+ },
2515
+ {
2516
+ inputs: [
2517
+ ],
2518
+ name: "SignatureParameterSInvalid",
2519
+ type: "error"
2360
2520
  },
2361
2521
  {
2362
- anonymous: false,
2363
2522
  inputs: [
2364
2523
  {
2365
- indexed: true,
2366
- internalType: "address",
2367
- name: "royaltyFeeManager",
2368
- type: "address"
2524
+ internalType: "uint8",
2525
+ name: "v",
2526
+ type: "uint8"
2369
2527
  }
2370
2528
  ],
2371
- name: "NewRoyaltyFeeManager",
2372
- type: "event"
2529
+ name: "SignatureParameterVInvalid",
2530
+ type: "error"
2531
+ },
2532
+ {
2533
+ inputs: [
2534
+ ],
2535
+ name: "StrategyHasNoSelector",
2536
+ type: "error"
2373
2537
  },
2374
2538
  {
2375
- anonymous: false,
2376
2539
  inputs: [
2377
2540
  {
2378
- indexed: true,
2379
- internalType: "address",
2380
- name: "transferSelectorNFT",
2381
- type: "address"
2541
+ internalType: "uint256",
2542
+ name: "strategyId",
2543
+ type: "uint256"
2382
2544
  }
2383
2545
  ],
2384
- name: "NewTransferSelectorNFT",
2385
- type: "event"
2546
+ name: "StrategyNotAvailable",
2547
+ type: "error"
2548
+ },
2549
+ {
2550
+ inputs: [
2551
+ ],
2552
+ name: "StrategyNotUsed",
2553
+ type: "error"
2554
+ },
2555
+ {
2556
+ inputs: [
2557
+ ],
2558
+ name: "StrategyProtocolFeeTooHigh",
2559
+ type: "error"
2560
+ },
2561
+ {
2562
+ inputs: [
2563
+ ],
2564
+ name: "TransferAlreadyInProgress",
2565
+ type: "error"
2566
+ },
2567
+ {
2568
+ inputs: [
2569
+ ],
2570
+ name: "TransferNotInProgress",
2571
+ type: "error"
2572
+ },
2573
+ {
2574
+ inputs: [
2575
+ ],
2576
+ name: "WrongPotentialOwner",
2577
+ type: "error"
2386
2578
  },
2387
2579
  {
2388
2580
  anonymous: false,
2389
2581
  inputs: [
2390
2582
  {
2391
- indexed: true,
2583
+ indexed: false,
2392
2584
  internalType: "address",
2393
- name: "previousOwner",
2585
+ name: "affiliate",
2394
2586
  type: "address"
2395
2587
  },
2396
2588
  {
2397
- indexed: true,
2589
+ indexed: false,
2398
2590
  internalType: "address",
2399
- name: "newOwner",
2591
+ name: "currency",
2400
2592
  type: "address"
2593
+ },
2594
+ {
2595
+ indexed: false,
2596
+ internalType: "uint256",
2597
+ name: "affiliateFee",
2598
+ type: "uint256"
2401
2599
  }
2402
2600
  ],
2403
- name: "OwnershipTransferred",
2601
+ name: "AffiliatePayment",
2602
+ type: "event"
2603
+ },
2604
+ {
2605
+ anonymous: false,
2606
+ inputs: [
2607
+ ],
2608
+ name: "CancelOwnershipTransfer",
2404
2609
  type: "event"
2405
2610
  },
2406
2611
  {
2407
2612
  anonymous: false,
2408
2613
  inputs: [
2409
2614
  {
2410
- indexed: true,
2411
- internalType: "address",
2412
- name: "collection",
2413
- type: "address"
2414
- },
2415
- {
2416
- indexed: true,
2417
- internalType: "uint256",
2418
- name: "tokenId",
2419
- type: "uint256"
2420
- },
2421
- {
2422
- indexed: true,
2423
- internalType: "address",
2424
- name: "royaltyRecipient",
2425
- type: "address"
2426
- },
2427
- {
2428
- indexed: false,
2615
+ indexed: false,
2429
2616
  internalType: "address",
2430
2617
  name: "currency",
2431
2618
  type: "address"
2432
2619
  },
2433
2620
  {
2434
2621
  indexed: false,
2435
- internalType: "uint256",
2436
- name: "amount",
2437
- type: "uint256"
2622
+ internalType: "bool",
2623
+ name: "isAllowed",
2624
+ type: "bool"
2438
2625
  }
2439
2626
  ],
2440
- name: "RoyaltyPayment",
2627
+ name: "CurrencyStatusUpdated",
2628
+ type: "event"
2629
+ },
2630
+ {
2631
+ anonymous: false,
2632
+ inputs: [
2633
+ ],
2634
+ name: "InitiateOwnershipRenouncement",
2441
2635
  type: "event"
2442
2636
  },
2443
2637
  {
@@ -2445,66 +2639,31 @@ var abi$1 = [
2445
2639
  inputs: [
2446
2640
  {
2447
2641
  indexed: false,
2448
- internalType: "bytes32",
2449
- name: "orderHash",
2450
- type: "bytes32"
2451
- },
2452
- {
2453
- indexed: false,
2454
- internalType: "uint256",
2455
- name: "orderNonce",
2456
- type: "uint256"
2457
- },
2458
- {
2459
- indexed: true,
2460
- internalType: "address",
2461
- name: "taker",
2462
- type: "address"
2463
- },
2464
- {
2465
- indexed: true,
2466
- internalType: "address",
2467
- name: "maker",
2468
- type: "address"
2469
- },
2470
- {
2471
- indexed: true,
2472
2642
  internalType: "address",
2473
- name: "strategy",
2643
+ name: "previousOwner",
2474
2644
  type: "address"
2475
2645
  },
2476
2646
  {
2477
2647
  indexed: false,
2478
2648
  internalType: "address",
2479
- name: "currency",
2649
+ name: "potentialOwner",
2480
2650
  type: "address"
2481
- },
2651
+ }
2652
+ ],
2653
+ name: "InitiateOwnershipTransfer",
2654
+ type: "event"
2655
+ },
2656
+ {
2657
+ anonymous: false,
2658
+ inputs: [
2482
2659
  {
2483
2660
  indexed: false,
2484
2661
  internalType: "address",
2485
- name: "collection",
2662
+ name: "affiliateController",
2486
2663
  type: "address"
2487
- },
2488
- {
2489
- indexed: false,
2490
- internalType: "uint256",
2491
- name: "tokenId",
2492
- type: "uint256"
2493
- },
2494
- {
2495
- indexed: false,
2496
- internalType: "uint256",
2497
- name: "amount",
2498
- type: "uint256"
2499
- },
2500
- {
2501
- indexed: false,
2502
- internalType: "uint256",
2503
- name: "price",
2504
- type: "uint256"
2505
2664
  }
2506
2665
  ],
2507
- name: "TakerAsk",
2666
+ name: "NewAffiliateController",
2508
2667
  type: "event"
2509
2668
  },
2510
2669
  {
@@ -2512,250 +2671,819 @@ var abi$1 = [
2512
2671
  inputs: [
2513
2672
  {
2514
2673
  indexed: false,
2515
- internalType: "bytes32",
2516
- name: "orderHash",
2517
- type: "bytes32"
2518
- },
2674
+ internalType: "bool",
2675
+ name: "isActive",
2676
+ type: "bool"
2677
+ }
2678
+ ],
2679
+ name: "NewAffiliateProgramStatus",
2680
+ type: "event"
2681
+ },
2682
+ {
2683
+ anonymous: false,
2684
+ inputs: [
2519
2685
  {
2520
2686
  indexed: false,
2521
- internalType: "uint256",
2522
- name: "orderNonce",
2523
- type: "uint256"
2524
- },
2525
- {
2526
- indexed: true,
2527
- internalType: "address",
2528
- name: "taker",
2529
- type: "address"
2530
- },
2531
- {
2532
- indexed: true,
2533
2687
  internalType: "address",
2534
- name: "maker",
2535
- type: "address"
2536
- },
2537
- {
2538
- indexed: true,
2539
- internalType: "address",
2540
- name: "strategy",
2688
+ name: "affiliate",
2541
2689
  type: "address"
2542
2690
  },
2543
2691
  {
2544
2692
  indexed: false,
2545
- internalType: "address",
2546
- name: "currency",
2547
- type: "address"
2548
- },
2693
+ internalType: "uint256",
2694
+ name: "rate",
2695
+ type: "uint256"
2696
+ }
2697
+ ],
2698
+ name: "NewAffiliateRate",
2699
+ type: "event"
2700
+ },
2701
+ {
2702
+ anonymous: false,
2703
+ inputs: [
2549
2704
  {
2550
2705
  indexed: false,
2551
2706
  internalType: "address",
2552
- name: "collection",
2707
+ name: "user",
2553
2708
  type: "address"
2554
2709
  },
2555
2710
  {
2556
2711
  indexed: false,
2557
2712
  internalType: "uint256",
2558
- name: "tokenId",
2559
- type: "uint256"
2560
- },
2561
- {
2562
- indexed: false,
2563
- internalType: "uint256",
2564
- name: "amount",
2713
+ name: "bidNonce",
2565
2714
  type: "uint256"
2566
2715
  },
2567
2716
  {
2568
2717
  indexed: false,
2569
2718
  internalType: "uint256",
2570
- name: "price",
2719
+ name: "askNonce",
2571
2720
  type: "uint256"
2572
2721
  }
2573
2722
  ],
2574
- name: "TakerBid",
2723
+ name: "NewBidAskNonces",
2575
2724
  type: "event"
2576
2725
  },
2577
2726
  {
2727
+ anonymous: false,
2578
2728
  inputs: [
2579
- ],
2580
- name: "DOMAIN_SEPARATOR",
2581
- outputs: [
2582
2729
  {
2583
- internalType: "bytes32",
2584
- name: "",
2585
- type: "bytes32"
2730
+ indexed: false,
2731
+ internalType: "address",
2732
+ name: "creatorFeeManager",
2733
+ type: "address"
2586
2734
  }
2587
2735
  ],
2588
- stateMutability: "view",
2589
- type: "function"
2736
+ name: "NewCreatorFeeManager",
2737
+ type: "event"
2590
2738
  },
2591
2739
  {
2740
+ anonymous: false,
2592
2741
  inputs: [
2593
2742
  ],
2594
- name: "WETH",
2595
- outputs: [
2743
+ name: "NewDomainSeparator",
2744
+ type: "event"
2745
+ },
2746
+ {
2747
+ anonymous: false,
2748
+ inputs: [
2596
2749
  {
2597
- internalType: "address",
2598
- name: "",
2599
- type: "address"
2750
+ indexed: false,
2751
+ internalType: "uint256",
2752
+ name: "gasLimitETHTransfer",
2753
+ type: "uint256"
2600
2754
  }
2601
2755
  ],
2602
- stateMutability: "view",
2603
- type: "function"
2756
+ name: "NewGasLimitETHTransfer",
2757
+ type: "event"
2604
2758
  },
2605
2759
  {
2760
+ anonymous: false,
2606
2761
  inputs: [
2607
2762
  {
2763
+ indexed: false,
2608
2764
  internalType: "uint256",
2609
- name: "minNonce",
2765
+ name: "maxCreatorFeeBp",
2610
2766
  type: "uint256"
2611
2767
  }
2612
2768
  ],
2613
- name: "cancelAllOrdersForSender",
2614
- outputs: [
2615
- ],
2616
- stateMutability: "nonpayable",
2617
- type: "function"
2769
+ name: "NewMaxCreatorFeeBp",
2770
+ type: "event"
2618
2771
  },
2619
2772
  {
2773
+ anonymous: false,
2620
2774
  inputs: [
2621
2775
  {
2622
- internalType: "uint256[]",
2623
- name: "orderNonces",
2624
- type: "uint256[]"
2776
+ indexed: false,
2777
+ internalType: "address",
2778
+ name: "newOwner",
2779
+ type: "address"
2625
2780
  }
2626
2781
  ],
2627
- name: "cancelMultipleMakerOrders",
2628
- outputs: [
2629
- ],
2630
- stateMutability: "nonpayable",
2631
- type: "function"
2782
+ name: "NewOwner",
2783
+ type: "event"
2632
2784
  },
2633
2785
  {
2786
+ anonymous: false,
2634
2787
  inputs: [
2635
- ],
2636
- name: "currencyManager",
2637
- outputs: [
2638
2788
  {
2639
- internalType: "contract ICurrencyManager",
2640
- name: "",
2789
+ indexed: false,
2790
+ internalType: "address",
2791
+ name: "protocolFeeRecipient",
2641
2792
  type: "address"
2642
2793
  }
2643
2794
  ],
2644
- stateMutability: "view",
2645
- type: "function"
2795
+ name: "NewProtocolFeeRecipient",
2796
+ type: "event"
2646
2797
  },
2647
2798
  {
2799
+ anonymous: false,
2648
2800
  inputs: [
2649
- ],
2650
- name: "executionManager",
2651
- outputs: [
2652
2801
  {
2653
- internalType: "contract IExecutionManager",
2654
- name: "",
2802
+ indexed: false,
2803
+ internalType: "uint256",
2804
+ name: "strategyId",
2805
+ type: "uint256"
2806
+ },
2807
+ {
2808
+ indexed: false,
2809
+ internalType: "uint16",
2810
+ name: "standardProtocolFeeBp",
2811
+ type: "uint16"
2812
+ },
2813
+ {
2814
+ indexed: false,
2815
+ internalType: "uint16",
2816
+ name: "minTotalFeeBp",
2817
+ type: "uint16"
2818
+ },
2819
+ {
2820
+ indexed: false,
2821
+ internalType: "uint16",
2822
+ name: "maxProtocolFeeBp",
2823
+ type: "uint16"
2824
+ },
2825
+ {
2826
+ indexed: false,
2827
+ internalType: "bytes4",
2828
+ name: "selector",
2829
+ type: "bytes4"
2830
+ },
2831
+ {
2832
+ indexed: false,
2833
+ internalType: "bool",
2834
+ name: "isMakerBid",
2835
+ type: "bool"
2836
+ },
2837
+ {
2838
+ indexed: false,
2839
+ internalType: "address",
2840
+ name: "implementation",
2655
2841
  type: "address"
2656
2842
  }
2657
2843
  ],
2658
- stateMutability: "view",
2659
- type: "function"
2844
+ name: "NewStrategy",
2845
+ type: "event"
2660
2846
  },
2661
2847
  {
2848
+ anonymous: false,
2662
2849
  inputs: [
2663
2850
  {
2851
+ indexed: false,
2664
2852
  internalType: "address",
2665
2853
  name: "user",
2666
2854
  type: "address"
2667
2855
  },
2668
2856
  {
2669
- internalType: "uint256",
2670
- name: "orderNonce",
2671
- type: "uint256"
2857
+ indexed: false,
2858
+ internalType: "uint256[]",
2859
+ name: "orderNonces",
2860
+ type: "uint256[]"
2672
2861
  }
2673
2862
  ],
2674
- name: "isUserOrderNonceExecutedOrCancelled",
2675
- outputs: [
2863
+ name: "OrderNoncesCancelled",
2864
+ type: "event"
2865
+ },
2866
+ {
2867
+ anonymous: false,
2868
+ inputs: [
2869
+ {
2870
+ indexed: false,
2871
+ internalType: "uint256",
2872
+ name: "strategyId",
2873
+ type: "uint256"
2874
+ },
2676
2875
  {
2876
+ indexed: false,
2677
2877
  internalType: "bool",
2678
- name: "",
2878
+ name: "isActive",
2679
2879
  type: "bool"
2880
+ },
2881
+ {
2882
+ indexed: false,
2883
+ internalType: "uint16",
2884
+ name: "standardProtocolFeeBp",
2885
+ type: "uint16"
2886
+ },
2887
+ {
2888
+ indexed: false,
2889
+ internalType: "uint16",
2890
+ name: "minTotalFeeBp",
2891
+ type: "uint16"
2680
2892
  }
2681
2893
  ],
2682
- stateMutability: "view",
2683
- type: "function"
2894
+ name: "StrategyUpdated",
2895
+ type: "event"
2896
+ },
2897
+ {
2898
+ anonymous: false,
2899
+ inputs: [
2900
+ {
2901
+ indexed: false,
2902
+ internalType: "address",
2903
+ name: "user",
2904
+ type: "address"
2905
+ },
2906
+ {
2907
+ indexed: false,
2908
+ internalType: "uint256[]",
2909
+ name: "subsetNonces",
2910
+ type: "uint256[]"
2911
+ }
2912
+ ],
2913
+ name: "SubsetNoncesCancelled",
2914
+ type: "event"
2915
+ },
2916
+ {
2917
+ anonymous: false,
2918
+ inputs: [
2919
+ {
2920
+ components: [
2921
+ {
2922
+ internalType: "bytes32",
2923
+ name: "orderHash",
2924
+ type: "bytes32"
2925
+ },
2926
+ {
2927
+ internalType: "uint256",
2928
+ name: "orderNonce",
2929
+ type: "uint256"
2930
+ },
2931
+ {
2932
+ internalType: "bool",
2933
+ name: "isNonceInvalidated",
2934
+ type: "bool"
2935
+ }
2936
+ ],
2937
+ indexed: false,
2938
+ internalType: "struct ILooksRareProtocol.NonceInvalidationParameters",
2939
+ name: "nonceInvalidationParameters",
2940
+ type: "tuple"
2941
+ },
2942
+ {
2943
+ indexed: false,
2944
+ internalType: "address",
2945
+ name: "askUser",
2946
+ type: "address"
2947
+ },
2948
+ {
2949
+ indexed: false,
2950
+ internalType: "address",
2951
+ name: "bidUser",
2952
+ type: "address"
2953
+ },
2954
+ {
2955
+ indexed: false,
2956
+ internalType: "uint256",
2957
+ name: "strategyId",
2958
+ type: "uint256"
2959
+ },
2960
+ {
2961
+ indexed: false,
2962
+ internalType: "address",
2963
+ name: "currency",
2964
+ type: "address"
2965
+ },
2966
+ {
2967
+ indexed: false,
2968
+ internalType: "address",
2969
+ name: "collection",
2970
+ type: "address"
2971
+ },
2972
+ {
2973
+ indexed: false,
2974
+ internalType: "uint256[]",
2975
+ name: "itemIds",
2976
+ type: "uint256[]"
2977
+ },
2978
+ {
2979
+ indexed: false,
2980
+ internalType: "uint256[]",
2981
+ name: "amounts",
2982
+ type: "uint256[]"
2983
+ },
2984
+ {
2985
+ indexed: false,
2986
+ internalType: "address[2]",
2987
+ name: "feeRecipients",
2988
+ type: "address[2]"
2989
+ },
2990
+ {
2991
+ indexed: false,
2992
+ internalType: "uint256[3]",
2993
+ name: "feeAmounts",
2994
+ type: "uint256[3]"
2995
+ }
2996
+ ],
2997
+ name: "TakerAsk",
2998
+ type: "event"
2999
+ },
3000
+ {
3001
+ anonymous: false,
3002
+ inputs: [
3003
+ {
3004
+ components: [
3005
+ {
3006
+ internalType: "bytes32",
3007
+ name: "orderHash",
3008
+ type: "bytes32"
3009
+ },
3010
+ {
3011
+ internalType: "uint256",
3012
+ name: "orderNonce",
3013
+ type: "uint256"
3014
+ },
3015
+ {
3016
+ internalType: "bool",
3017
+ name: "isNonceInvalidated",
3018
+ type: "bool"
3019
+ }
3020
+ ],
3021
+ indexed: false,
3022
+ internalType: "struct ILooksRareProtocol.NonceInvalidationParameters",
3023
+ name: "nonceInvalidationParameters",
3024
+ type: "tuple"
3025
+ },
3026
+ {
3027
+ indexed: false,
3028
+ internalType: "address",
3029
+ name: "bidUser",
3030
+ type: "address"
3031
+ },
3032
+ {
3033
+ indexed: false,
3034
+ internalType: "address",
3035
+ name: "bidRecipient",
3036
+ type: "address"
3037
+ },
3038
+ {
3039
+ indexed: false,
3040
+ internalType: "uint256",
3041
+ name: "strategyId",
3042
+ type: "uint256"
3043
+ },
3044
+ {
3045
+ indexed: false,
3046
+ internalType: "address",
3047
+ name: "currency",
3048
+ type: "address"
3049
+ },
3050
+ {
3051
+ indexed: false,
3052
+ internalType: "address",
3053
+ name: "collection",
3054
+ type: "address"
3055
+ },
3056
+ {
3057
+ indexed: false,
3058
+ internalType: "uint256[]",
3059
+ name: "itemIds",
3060
+ type: "uint256[]"
3061
+ },
3062
+ {
3063
+ indexed: false,
3064
+ internalType: "uint256[]",
3065
+ name: "amounts",
3066
+ type: "uint256[]"
3067
+ },
3068
+ {
3069
+ indexed: false,
3070
+ internalType: "address[2]",
3071
+ name: "feeRecipients",
3072
+ type: "address[2]"
3073
+ },
3074
+ {
3075
+ indexed: false,
3076
+ internalType: "uint256[3]",
3077
+ name: "feeAmounts",
3078
+ type: "uint256[3]"
3079
+ }
3080
+ ],
3081
+ name: "TakerBid",
3082
+ type: "event"
3083
+ },
3084
+ {
3085
+ inputs: [
3086
+ ],
3087
+ name: "MAGIC_VALUE_ORDER_NONCE_EXECUTED",
3088
+ outputs: [
3089
+ {
3090
+ internalType: "bytes32",
3091
+ name: "",
3092
+ type: "bytes32"
3093
+ }
3094
+ ],
3095
+ stateMutability: "view",
3096
+ type: "function"
3097
+ },
3098
+ {
3099
+ inputs: [
3100
+ ],
3101
+ name: "WETH",
3102
+ outputs: [
3103
+ {
3104
+ internalType: "address",
3105
+ name: "",
3106
+ type: "address"
3107
+ }
3108
+ ],
3109
+ stateMutability: "view",
3110
+ type: "function"
3111
+ },
3112
+ {
3113
+ inputs: [
3114
+ {
3115
+ internalType: "uint16",
3116
+ name: "standardProtocolFeeBp",
3117
+ type: "uint16"
3118
+ },
3119
+ {
3120
+ internalType: "uint16",
3121
+ name: "minTotalFeeBp",
3122
+ type: "uint16"
3123
+ },
3124
+ {
3125
+ internalType: "uint16",
3126
+ name: "maxProtocolFeeBp",
3127
+ type: "uint16"
3128
+ },
3129
+ {
3130
+ internalType: "bytes4",
3131
+ name: "selector",
3132
+ type: "bytes4"
3133
+ },
3134
+ {
3135
+ internalType: "bool",
3136
+ name: "isMakerBid",
3137
+ type: "bool"
3138
+ },
3139
+ {
3140
+ internalType: "address",
3141
+ name: "implementation",
3142
+ type: "address"
3143
+ }
3144
+ ],
3145
+ name: "addStrategy",
3146
+ outputs: [
3147
+ ],
3148
+ stateMutability: "nonpayable",
3149
+ type: "function"
3150
+ },
3151
+ {
3152
+ inputs: [
3153
+ ],
3154
+ name: "affiliateController",
3155
+ outputs: [
3156
+ {
3157
+ internalType: "address",
3158
+ name: "",
3159
+ type: "address"
3160
+ }
3161
+ ],
3162
+ stateMutability: "view",
3163
+ type: "function"
3164
+ },
3165
+ {
3166
+ inputs: [
3167
+ {
3168
+ internalType: "address",
3169
+ name: "",
3170
+ type: "address"
3171
+ }
3172
+ ],
3173
+ name: "affiliateRates",
3174
+ outputs: [
3175
+ {
3176
+ internalType: "uint256",
3177
+ name: "",
3178
+ type: "uint256"
3179
+ }
3180
+ ],
3181
+ stateMutability: "view",
3182
+ type: "function"
3183
+ },
3184
+ {
3185
+ inputs: [
3186
+ {
3187
+ internalType: "uint256[]",
3188
+ name: "orderNonces",
3189
+ type: "uint256[]"
3190
+ }
3191
+ ],
3192
+ name: "cancelOrderNonces",
3193
+ outputs: [
3194
+ ],
3195
+ stateMutability: "nonpayable",
3196
+ type: "function"
3197
+ },
3198
+ {
3199
+ inputs: [
3200
+ ],
3201
+ name: "cancelOwnershipTransfer",
3202
+ outputs: [
3203
+ ],
3204
+ stateMutability: "nonpayable",
3205
+ type: "function"
3206
+ },
3207
+ {
3208
+ inputs: [
3209
+ {
3210
+ internalType: "uint256[]",
3211
+ name: "subsetNonces",
3212
+ type: "uint256[]"
3213
+ }
3214
+ ],
3215
+ name: "cancelSubsetNonces",
3216
+ outputs: [
3217
+ ],
3218
+ stateMutability: "nonpayable",
3219
+ type: "function"
3220
+ },
3221
+ {
3222
+ inputs: [
3223
+ ],
3224
+ name: "chainId",
3225
+ outputs: [
3226
+ {
3227
+ internalType: "uint256",
3228
+ name: "",
3229
+ type: "uint256"
3230
+ }
3231
+ ],
3232
+ stateMutability: "view",
3233
+ type: "function"
3234
+ },
3235
+ {
3236
+ inputs: [
3237
+ ],
3238
+ name: "confirmOwnershipRenouncement",
3239
+ outputs: [
3240
+ ],
3241
+ stateMutability: "nonpayable",
3242
+ type: "function"
3243
+ },
3244
+ {
3245
+ inputs: [
3246
+ ],
3247
+ name: "confirmOwnershipTransfer",
3248
+ outputs: [
3249
+ ],
3250
+ stateMutability: "nonpayable",
3251
+ type: "function"
3252
+ },
3253
+ {
3254
+ inputs: [
3255
+ ],
3256
+ name: "creatorFeeManager",
3257
+ outputs: [
3258
+ {
3259
+ internalType: "contract ICreatorFeeManager",
3260
+ name: "",
3261
+ type: "address"
3262
+ }
3263
+ ],
3264
+ stateMutability: "view",
3265
+ type: "function"
3266
+ },
3267
+ {
3268
+ inputs: [
3269
+ ],
3270
+ name: "domainSeparator",
3271
+ outputs: [
3272
+ {
3273
+ internalType: "bytes32",
3274
+ name: "",
3275
+ type: "bytes32"
3276
+ }
3277
+ ],
3278
+ stateMutability: "view",
3279
+ type: "function"
2684
3280
  },
2685
3281
  {
2686
3282
  inputs: [
2687
3283
  {
2688
3284
  components: [
2689
3285
  {
2690
- internalType: "bool",
2691
- name: "isOrderAsk",
2692
- type: "bool"
3286
+ internalType: "address",
3287
+ name: "recipient",
3288
+ type: "address"
3289
+ },
3290
+ {
3291
+ internalType: "bytes",
3292
+ name: "additionalParameters",
3293
+ type: "bytes"
3294
+ }
3295
+ ],
3296
+ internalType: "struct OrderStructs.Taker[]",
3297
+ name: "takerBids",
3298
+ type: "tuple[]"
3299
+ },
3300
+ {
3301
+ components: [
3302
+ {
3303
+ internalType: "enum QuoteType",
3304
+ name: "quoteType",
3305
+ type: "uint8"
3306
+ },
3307
+ {
3308
+ internalType: "uint256",
3309
+ name: "globalNonce",
3310
+ type: "uint256"
3311
+ },
3312
+ {
3313
+ internalType: "uint256",
3314
+ name: "subsetNonce",
3315
+ type: "uint256"
3316
+ },
3317
+ {
3318
+ internalType: "uint256",
3319
+ name: "orderNonce",
3320
+ type: "uint256"
3321
+ },
3322
+ {
3323
+ internalType: "uint256",
3324
+ name: "strategyId",
3325
+ type: "uint256"
3326
+ },
3327
+ {
3328
+ internalType: "enum CollectionType",
3329
+ name: "collectionType",
3330
+ type: "uint8"
3331
+ },
3332
+ {
3333
+ internalType: "address",
3334
+ name: "collection",
3335
+ type: "address"
3336
+ },
3337
+ {
3338
+ internalType: "address",
3339
+ name: "currency",
3340
+ type: "address"
2693
3341
  },
2694
3342
  {
2695
3343
  internalType: "address",
2696
- name: "taker",
3344
+ name: "signer",
2697
3345
  type: "address"
2698
3346
  },
2699
3347
  {
2700
3348
  internalType: "uint256",
2701
- name: "price",
3349
+ name: "startTime",
2702
3350
  type: "uint256"
2703
3351
  },
2704
3352
  {
2705
3353
  internalType: "uint256",
2706
- name: "tokenId",
3354
+ name: "endTime",
2707
3355
  type: "uint256"
2708
3356
  },
2709
3357
  {
2710
3358
  internalType: "uint256",
2711
- name: "minPercentageToAsk",
3359
+ name: "price",
2712
3360
  type: "uint256"
2713
3361
  },
3362
+ {
3363
+ internalType: "uint256[]",
3364
+ name: "itemIds",
3365
+ type: "uint256[]"
3366
+ },
3367
+ {
3368
+ internalType: "uint256[]",
3369
+ name: "amounts",
3370
+ type: "uint256[]"
3371
+ },
2714
3372
  {
2715
3373
  internalType: "bytes",
2716
- name: "params",
3374
+ name: "additionalParameters",
2717
3375
  type: "bytes"
2718
3376
  }
2719
3377
  ],
2720
- internalType: "struct OrderTypes.TakerOrder",
2721
- name: "takerBid",
2722
- type: "tuple"
3378
+ internalType: "struct OrderStructs.Maker[]",
3379
+ name: "makerAsks",
3380
+ type: "tuple[]"
3381
+ },
3382
+ {
3383
+ internalType: "bytes[]",
3384
+ name: "makerSignatures",
3385
+ type: "bytes[]"
2723
3386
  },
2724
3387
  {
2725
3388
  components: [
2726
3389
  {
2727
- internalType: "bool",
2728
- name: "isOrderAsk",
2729
- type: "bool"
3390
+ internalType: "bytes32",
3391
+ name: "root",
3392
+ type: "bytes32"
2730
3393
  },
3394
+ {
3395
+ components: [
3396
+ {
3397
+ internalType: "bytes32",
3398
+ name: "value",
3399
+ type: "bytes32"
3400
+ },
3401
+ {
3402
+ internalType: "enum OrderStructs.MerkleTreeNodePosition",
3403
+ name: "position",
3404
+ type: "uint8"
3405
+ }
3406
+ ],
3407
+ internalType: "struct OrderStructs.MerkleTreeNode[]",
3408
+ name: "proof",
3409
+ type: "tuple[]"
3410
+ }
3411
+ ],
3412
+ internalType: "struct OrderStructs.MerkleTree[]",
3413
+ name: "merkleTrees",
3414
+ type: "tuple[]"
3415
+ },
3416
+ {
3417
+ internalType: "address",
3418
+ name: "affiliate",
3419
+ type: "address"
3420
+ },
3421
+ {
3422
+ internalType: "bool",
3423
+ name: "isAtomic",
3424
+ type: "bool"
3425
+ }
3426
+ ],
3427
+ name: "executeMultipleTakerBids",
3428
+ outputs: [
3429
+ ],
3430
+ stateMutability: "payable",
3431
+ type: "function"
3432
+ },
3433
+ {
3434
+ inputs: [
3435
+ {
3436
+ components: [
2731
3437
  {
2732
3438
  internalType: "address",
2733
- name: "signer",
3439
+ name: "recipient",
2734
3440
  type: "address"
2735
3441
  },
2736
3442
  {
2737
- internalType: "address",
2738
- name: "collection",
2739
- type: "address"
3443
+ internalType: "bytes",
3444
+ name: "additionalParameters",
3445
+ type: "bytes"
3446
+ }
3447
+ ],
3448
+ internalType: "struct OrderStructs.Taker",
3449
+ name: "takerAsk",
3450
+ type: "tuple"
3451
+ },
3452
+ {
3453
+ components: [
3454
+ {
3455
+ internalType: "enum QuoteType",
3456
+ name: "quoteType",
3457
+ type: "uint8"
2740
3458
  },
2741
3459
  {
2742
3460
  internalType: "uint256",
2743
- name: "price",
3461
+ name: "globalNonce",
2744
3462
  type: "uint256"
2745
3463
  },
2746
3464
  {
2747
3465
  internalType: "uint256",
2748
- name: "tokenId",
3466
+ name: "subsetNonce",
2749
3467
  type: "uint256"
2750
3468
  },
2751
3469
  {
2752
3470
  internalType: "uint256",
2753
- name: "amount",
3471
+ name: "orderNonce",
3472
+ type: "uint256"
3473
+ },
3474
+ {
3475
+ internalType: "uint256",
3476
+ name: "strategyId",
2754
3477
  type: "uint256"
2755
3478
  },
3479
+ {
3480
+ internalType: "enum CollectionType",
3481
+ name: "collectionType",
3482
+ type: "uint8"
3483
+ },
2756
3484
  {
2757
3485
  internalType: "address",
2758
- name: "strategy",
3486
+ name: "collection",
2759
3487
  type: "address"
2760
3488
  },
2761
3489
  {
@@ -2764,9 +3492,9 @@ var abi$1 = [
2764
3492
  type: "address"
2765
3493
  },
2766
3494
  {
2767
- internalType: "uint256",
2768
- name: "nonce",
2769
- type: "uint256"
3495
+ internalType: "address",
3496
+ name: "signer",
3497
+ type: "address"
2770
3498
  },
2771
3499
  {
2772
3500
  internalType: "uint256",
@@ -2780,36 +3508,70 @@ var abi$1 = [
2780
3508
  },
2781
3509
  {
2782
3510
  internalType: "uint256",
2783
- name: "minPercentageToAsk",
3511
+ name: "price",
2784
3512
  type: "uint256"
2785
3513
  },
2786
3514
  {
2787
- internalType: "bytes",
2788
- name: "params",
2789
- type: "bytes"
3515
+ internalType: "uint256[]",
3516
+ name: "itemIds",
3517
+ type: "uint256[]"
2790
3518
  },
2791
3519
  {
2792
- internalType: "uint8",
2793
- name: "v",
2794
- type: "uint8"
3520
+ internalType: "uint256[]",
3521
+ name: "amounts",
3522
+ type: "uint256[]"
2795
3523
  },
3524
+ {
3525
+ internalType: "bytes",
3526
+ name: "additionalParameters",
3527
+ type: "bytes"
3528
+ }
3529
+ ],
3530
+ internalType: "struct OrderStructs.Maker",
3531
+ name: "makerBid",
3532
+ type: "tuple"
3533
+ },
3534
+ {
3535
+ internalType: "bytes",
3536
+ name: "makerSignature",
3537
+ type: "bytes"
3538
+ },
3539
+ {
3540
+ components: [
2796
3541
  {
2797
3542
  internalType: "bytes32",
2798
- name: "r",
3543
+ name: "root",
2799
3544
  type: "bytes32"
2800
3545
  },
2801
3546
  {
2802
- internalType: "bytes32",
2803
- name: "s",
2804
- type: "bytes32"
3547
+ components: [
3548
+ {
3549
+ internalType: "bytes32",
3550
+ name: "value",
3551
+ type: "bytes32"
3552
+ },
3553
+ {
3554
+ internalType: "enum OrderStructs.MerkleTreeNodePosition",
3555
+ name: "position",
3556
+ type: "uint8"
3557
+ }
3558
+ ],
3559
+ internalType: "struct OrderStructs.MerkleTreeNode[]",
3560
+ name: "proof",
3561
+ type: "tuple[]"
2805
3562
  }
2806
3563
  ],
2807
- internalType: "struct OrderTypes.MakerOrder",
2808
- name: "makerAsk",
3564
+ internalType: "struct OrderStructs.MerkleTree",
3565
+ name: "merkleTree",
2809
3566
  type: "tuple"
3567
+ },
3568
+ {
3569
+ internalType: "address",
3570
+ name: "affiliate",
3571
+ type: "address"
2810
3572
  }
2811
3573
  ],
2812
- name: "matchAskWithTakerBid",
3574
+ name: "executeTakerAsk",
2813
3575
  outputs: [
2814
3576
  ],
2815
3577
  stateMutability: "nonpayable",
@@ -2819,76 +3581,56 @@ var abi$1 = [
2819
3581
  inputs: [
2820
3582
  {
2821
3583
  components: [
2822
- {
2823
- internalType: "bool",
2824
- name: "isOrderAsk",
2825
- type: "bool"
2826
- },
2827
3584
  {
2828
3585
  internalType: "address",
2829
- name: "taker",
3586
+ name: "recipient",
2830
3587
  type: "address"
2831
3588
  },
2832
- {
2833
- internalType: "uint256",
2834
- name: "price",
2835
- type: "uint256"
2836
- },
2837
- {
2838
- internalType: "uint256",
2839
- name: "tokenId",
2840
- type: "uint256"
2841
- },
2842
- {
2843
- internalType: "uint256",
2844
- name: "minPercentageToAsk",
2845
- type: "uint256"
2846
- },
2847
3589
  {
2848
3590
  internalType: "bytes",
2849
- name: "params",
3591
+ name: "additionalParameters",
2850
3592
  type: "bytes"
2851
3593
  }
2852
3594
  ],
2853
- internalType: "struct OrderTypes.TakerOrder",
3595
+ internalType: "struct OrderStructs.Taker",
2854
3596
  name: "takerBid",
2855
3597
  type: "tuple"
2856
3598
  },
2857
3599
  {
2858
3600
  components: [
2859
3601
  {
2860
- internalType: "bool",
2861
- name: "isOrderAsk",
2862
- type: "bool"
2863
- },
2864
- {
2865
- internalType: "address",
2866
- name: "signer",
2867
- type: "address"
3602
+ internalType: "enum QuoteType",
3603
+ name: "quoteType",
3604
+ type: "uint8"
2868
3605
  },
2869
3606
  {
2870
- internalType: "address",
2871
- name: "collection",
2872
- type: "address"
3607
+ internalType: "uint256",
3608
+ name: "globalNonce",
3609
+ type: "uint256"
2873
3610
  },
2874
3611
  {
2875
3612
  internalType: "uint256",
2876
- name: "price",
3613
+ name: "subsetNonce",
2877
3614
  type: "uint256"
2878
3615
  },
2879
3616
  {
2880
3617
  internalType: "uint256",
2881
- name: "tokenId",
3618
+ name: "orderNonce",
2882
3619
  type: "uint256"
2883
3620
  },
2884
3621
  {
2885
3622
  internalType: "uint256",
2886
- name: "amount",
3623
+ name: "strategyId",
2887
3624
  type: "uint256"
2888
3625
  },
3626
+ {
3627
+ internalType: "enum CollectionType",
3628
+ name: "collectionType",
3629
+ type: "uint8"
3630
+ },
2889
3631
  {
2890
3632
  internalType: "address",
2891
- name: "strategy",
3633
+ name: "collection",
2892
3634
  type: "address"
2893
3635
  },
2894
3636
  {
@@ -2897,9 +3639,9 @@ var abi$1 = [
2897
3639
  type: "address"
2898
3640
  },
2899
3641
  {
2900
- internalType: "uint256",
2901
- name: "nonce",
2902
- type: "uint256"
3642
+ internalType: "address",
3643
+ name: "signer",
3644
+ type: "address"
2903
3645
  },
2904
3646
  {
2905
3647
  internalType: "uint256",
@@ -2913,115 +3655,298 @@ var abi$1 = [
2913
3655
  },
2914
3656
  {
2915
3657
  internalType: "uint256",
2916
- name: "minPercentageToAsk",
3658
+ name: "price",
2917
3659
  type: "uint256"
2918
3660
  },
2919
3661
  {
2920
- internalType: "bytes",
2921
- name: "params",
2922
- type: "bytes"
3662
+ internalType: "uint256[]",
3663
+ name: "itemIds",
3664
+ type: "uint256[]"
2923
3665
  },
2924
3666
  {
2925
- internalType: "uint8",
2926
- name: "v",
2927
- type: "uint8"
3667
+ internalType: "uint256[]",
3668
+ name: "amounts",
3669
+ type: "uint256[]"
2928
3670
  },
3671
+ {
3672
+ internalType: "bytes",
3673
+ name: "additionalParameters",
3674
+ type: "bytes"
3675
+ }
3676
+ ],
3677
+ internalType: "struct OrderStructs.Maker",
3678
+ name: "makerAsk",
3679
+ type: "tuple"
3680
+ },
3681
+ {
3682
+ internalType: "bytes",
3683
+ name: "makerSignature",
3684
+ type: "bytes"
3685
+ },
3686
+ {
3687
+ components: [
2929
3688
  {
2930
3689
  internalType: "bytes32",
2931
- name: "r",
3690
+ name: "root",
2932
3691
  type: "bytes32"
2933
3692
  },
2934
3693
  {
2935
- internalType: "bytes32",
2936
- name: "s",
2937
- type: "bytes32"
3694
+ components: [
3695
+ {
3696
+ internalType: "bytes32",
3697
+ name: "value",
3698
+ type: "bytes32"
3699
+ },
3700
+ {
3701
+ internalType: "enum OrderStructs.MerkleTreeNodePosition",
3702
+ name: "position",
3703
+ type: "uint8"
3704
+ }
3705
+ ],
3706
+ internalType: "struct OrderStructs.MerkleTreeNode[]",
3707
+ name: "proof",
3708
+ type: "tuple[]"
2938
3709
  }
2939
3710
  ],
2940
- internalType: "struct OrderTypes.MakerOrder",
2941
- name: "makerAsk",
3711
+ internalType: "struct OrderStructs.MerkleTree",
3712
+ name: "merkleTree",
2942
3713
  type: "tuple"
3714
+ },
3715
+ {
3716
+ internalType: "address",
3717
+ name: "affiliate",
3718
+ type: "address"
2943
3719
  }
2944
3720
  ],
2945
- name: "matchAskWithTakerBidUsingETHAndWETH",
3721
+ name: "executeTakerBid",
2946
3722
  outputs: [
2947
3723
  ],
2948
3724
  stateMutability: "payable",
2949
3725
  type: "function"
2950
3726
  },
3727
+ {
3728
+ inputs: [
3729
+ {
3730
+ internalType: "bytes32",
3731
+ name: "root",
3732
+ type: "bytes32"
3733
+ },
3734
+ {
3735
+ internalType: "uint256",
3736
+ name: "proofLength",
3737
+ type: "uint256"
3738
+ }
3739
+ ],
3740
+ name: "hashBatchOrder",
3741
+ outputs: [
3742
+ {
3743
+ internalType: "bytes32",
3744
+ name: "batchOrderHash",
3745
+ type: "bytes32"
3746
+ }
3747
+ ],
3748
+ stateMutability: "pure",
3749
+ type: "function"
3750
+ },
3751
+ {
3752
+ inputs: [
3753
+ {
3754
+ internalType: "bool",
3755
+ name: "bid",
3756
+ type: "bool"
3757
+ },
3758
+ {
3759
+ internalType: "bool",
3760
+ name: "ask",
3761
+ type: "bool"
3762
+ }
3763
+ ],
3764
+ name: "incrementBidAskNonces",
3765
+ outputs: [
3766
+ ],
3767
+ stateMutability: "nonpayable",
3768
+ type: "function"
3769
+ },
3770
+ {
3771
+ inputs: [
3772
+ ],
3773
+ name: "initiateOwnershipRenouncement",
3774
+ outputs: [
3775
+ ],
3776
+ stateMutability: "nonpayable",
3777
+ type: "function"
3778
+ },
3779
+ {
3780
+ inputs: [
3781
+ {
3782
+ internalType: "address",
3783
+ name: "newPotentialOwner",
3784
+ type: "address"
3785
+ }
3786
+ ],
3787
+ name: "initiateOwnershipTransfer",
3788
+ outputs: [
3789
+ ],
3790
+ stateMutability: "nonpayable",
3791
+ type: "function"
3792
+ },
3793
+ {
3794
+ inputs: [
3795
+ ],
3796
+ name: "isAffiliateProgramActive",
3797
+ outputs: [
3798
+ {
3799
+ internalType: "bool",
3800
+ name: "",
3801
+ type: "bool"
3802
+ }
3803
+ ],
3804
+ stateMutability: "view",
3805
+ type: "function"
3806
+ },
3807
+ {
3808
+ inputs: [
3809
+ {
3810
+ internalType: "address",
3811
+ name: "",
3812
+ type: "address"
3813
+ }
3814
+ ],
3815
+ name: "isCurrencyAllowed",
3816
+ outputs: [
3817
+ {
3818
+ internalType: "bool",
3819
+ name: "",
3820
+ type: "bool"
3821
+ }
3822
+ ],
3823
+ stateMutability: "view",
3824
+ type: "function"
3825
+ },
3826
+ {
3827
+ inputs: [
3828
+ ],
3829
+ name: "maxCreatorFeeBp",
3830
+ outputs: [
3831
+ {
3832
+ internalType: "uint16",
3833
+ name: "",
3834
+ type: "uint16"
3835
+ }
3836
+ ],
3837
+ stateMutability: "view",
3838
+ type: "function"
3839
+ },
3840
+ {
3841
+ inputs: [
3842
+ ],
3843
+ name: "owner",
3844
+ outputs: [
3845
+ {
3846
+ internalType: "address",
3847
+ name: "",
3848
+ type: "address"
3849
+ }
3850
+ ],
3851
+ stateMutability: "view",
3852
+ type: "function"
3853
+ },
3854
+ {
3855
+ inputs: [
3856
+ ],
3857
+ name: "ownershipStatus",
3858
+ outputs: [
3859
+ {
3860
+ internalType: "enum IOwnableTwoSteps.Status",
3861
+ name: "",
3862
+ type: "uint8"
3863
+ }
3864
+ ],
3865
+ stateMutability: "view",
3866
+ type: "function"
3867
+ },
3868
+ {
3869
+ inputs: [
3870
+ ],
3871
+ name: "potentialOwner",
3872
+ outputs: [
3873
+ {
3874
+ internalType: "address",
3875
+ name: "",
3876
+ type: "address"
3877
+ }
3878
+ ],
3879
+ stateMutability: "view",
3880
+ type: "function"
3881
+ },
3882
+ {
3883
+ inputs: [
3884
+ ],
3885
+ name: "protocolFeeRecipient",
3886
+ outputs: [
3887
+ {
3888
+ internalType: "address",
3889
+ name: "",
3890
+ type: "address"
3891
+ }
3892
+ ],
3893
+ stateMutability: "view",
3894
+ type: "function"
3895
+ },
2951
3896
  {
2952
3897
  inputs: [
2953
3898
  {
2954
3899
  components: [
2955
- {
2956
- internalType: "bool",
2957
- name: "isOrderAsk",
2958
- type: "bool"
2959
- },
2960
3900
  {
2961
3901
  internalType: "address",
2962
- name: "taker",
3902
+ name: "recipient",
2963
3903
  type: "address"
2964
3904
  },
2965
- {
2966
- internalType: "uint256",
2967
- name: "price",
2968
- type: "uint256"
2969
- },
2970
- {
2971
- internalType: "uint256",
2972
- name: "tokenId",
2973
- type: "uint256"
2974
- },
2975
- {
2976
- internalType: "uint256",
2977
- name: "minPercentageToAsk",
2978
- type: "uint256"
2979
- },
2980
3905
  {
2981
3906
  internalType: "bytes",
2982
- name: "params",
3907
+ name: "additionalParameters",
2983
3908
  type: "bytes"
2984
3909
  }
2985
3910
  ],
2986
- internalType: "struct OrderTypes.TakerOrder",
2987
- name: "takerAsk",
3911
+ internalType: "struct OrderStructs.Taker",
3912
+ name: "takerBid",
2988
3913
  type: "tuple"
2989
3914
  },
2990
3915
  {
2991
3916
  components: [
2992
3917
  {
2993
- internalType: "bool",
2994
- name: "isOrderAsk",
2995
- type: "bool"
2996
- },
2997
- {
2998
- internalType: "address",
2999
- name: "signer",
3000
- type: "address"
3918
+ internalType: "enum QuoteType",
3919
+ name: "quoteType",
3920
+ type: "uint8"
3001
3921
  },
3002
3922
  {
3003
- internalType: "address",
3004
- name: "collection",
3005
- type: "address"
3923
+ internalType: "uint256",
3924
+ name: "globalNonce",
3925
+ type: "uint256"
3006
3926
  },
3007
3927
  {
3008
3928
  internalType: "uint256",
3009
- name: "price",
3929
+ name: "subsetNonce",
3010
3930
  type: "uint256"
3011
3931
  },
3012
3932
  {
3013
3933
  internalType: "uint256",
3014
- name: "tokenId",
3934
+ name: "orderNonce",
3015
3935
  type: "uint256"
3016
3936
  },
3017
3937
  {
3018
3938
  internalType: "uint256",
3019
- name: "amount",
3939
+ name: "strategyId",
3020
3940
  type: "uint256"
3021
3941
  },
3942
+ {
3943
+ internalType: "enum CollectionType",
3944
+ name: "collectionType",
3945
+ type: "uint8"
3946
+ },
3022
3947
  {
3023
3948
  internalType: "address",
3024
- name: "strategy",
3949
+ name: "collection",
3025
3950
  type: "address"
3026
3951
  },
3027
3952
  {
@@ -3030,9 +3955,9 @@ var abi$1 = [
3030
3955
  type: "address"
3031
3956
  },
3032
3957
  {
3033
- internalType: "uint256",
3034
- name: "nonce",
3035
- type: "uint256"
3958
+ internalType: "address",
3959
+ name: "signer",
3960
+ type: "address"
3036
3961
  },
3037
3962
  {
3038
3963
  internalType: "uint256",
@@ -3046,49 +3971,94 @@ var abi$1 = [
3046
3971
  },
3047
3972
  {
3048
3973
  internalType: "uint256",
3049
- name: "minPercentageToAsk",
3974
+ name: "price",
3050
3975
  type: "uint256"
3051
3976
  },
3052
3977
  {
3053
- internalType: "bytes",
3054
- name: "params",
3055
- type: "bytes"
3056
- },
3057
- {
3058
- internalType: "uint8",
3059
- name: "v",
3060
- type: "uint8"
3978
+ internalType: "uint256[]",
3979
+ name: "itemIds",
3980
+ type: "uint256[]"
3061
3981
  },
3062
3982
  {
3063
- internalType: "bytes32",
3064
- name: "r",
3065
- type: "bytes32"
3983
+ internalType: "uint256[]",
3984
+ name: "amounts",
3985
+ type: "uint256[]"
3066
3986
  },
3067
3987
  {
3068
- internalType: "bytes32",
3069
- name: "s",
3070
- type: "bytes32"
3988
+ internalType: "bytes",
3989
+ name: "additionalParameters",
3990
+ type: "bytes"
3071
3991
  }
3072
3992
  ],
3073
- internalType: "struct OrderTypes.MakerOrder",
3074
- name: "makerBid",
3993
+ internalType: "struct OrderStructs.Maker",
3994
+ name: "makerAsk",
3075
3995
  type: "tuple"
3996
+ },
3997
+ {
3998
+ internalType: "address",
3999
+ name: "sender",
4000
+ type: "address"
4001
+ },
4002
+ {
4003
+ internalType: "bytes32",
4004
+ name: "orderHash",
4005
+ type: "bytes32"
3076
4006
  }
3077
4007
  ],
3078
- name: "matchBidWithTakerAsk",
4008
+ name: "restrictedExecuteTakerBid",
3079
4009
  outputs: [
4010
+ {
4011
+ internalType: "uint256",
4012
+ name: "protocolFeeAmount",
4013
+ type: "uint256"
4014
+ }
3080
4015
  ],
3081
4016
  stateMutability: "nonpayable",
3082
4017
  type: "function"
3083
4018
  },
3084
4019
  {
3085
4020
  inputs: [
4021
+ {
4022
+ internalType: "uint256",
4023
+ name: "",
4024
+ type: "uint256"
4025
+ }
3086
4026
  ],
3087
- name: "owner",
4027
+ name: "strategyInfo",
3088
4028
  outputs: [
4029
+ {
4030
+ internalType: "bool",
4031
+ name: "isActive",
4032
+ type: "bool"
4033
+ },
4034
+ {
4035
+ internalType: "uint16",
4036
+ name: "standardProtocolFeeBp",
4037
+ type: "uint16"
4038
+ },
4039
+ {
4040
+ internalType: "uint16",
4041
+ name: "minTotalFeeBp",
4042
+ type: "uint16"
4043
+ },
4044
+ {
4045
+ internalType: "uint16",
4046
+ name: "maxProtocolFeeBp",
4047
+ type: "uint16"
4048
+ },
4049
+ {
4050
+ internalType: "bytes4",
4051
+ name: "selector",
4052
+ type: "bytes4"
4053
+ },
4054
+ {
4055
+ internalType: "bool",
4056
+ name: "isMakerBid",
4057
+ type: "bool"
4058
+ },
3089
4059
  {
3090
4060
  internalType: "address",
3091
- name: "",
4061
+ name: "implementation",
3092
4062
  type: "address"
3093
4063
  }
3094
4064
  ],
@@ -3098,10 +4068,10 @@ var abi$1 = [
3098
4068
  {
3099
4069
  inputs: [
3100
4070
  ],
3101
- name: "protocolFeeRecipient",
4071
+ name: "transferManager",
3102
4072
  outputs: [
3103
4073
  {
3104
- internalType: "address",
4074
+ internalType: "contract TransferManager",
3105
4075
  name: "",
3106
4076
  type: "address"
3107
4077
  }
@@ -3111,8 +4081,13 @@ var abi$1 = [
3111
4081
  },
3112
4082
  {
3113
4083
  inputs: [
4084
+ {
4085
+ internalType: "address",
4086
+ name: "newAffiliateController",
4087
+ type: "address"
4088
+ }
3114
4089
  ],
3115
- name: "renounceOwnership",
4090
+ name: "updateAffiliateController",
3116
4091
  outputs: [
3117
4092
  ],
3118
4093
  stateMutability: "nonpayable",
@@ -3120,27 +4095,46 @@ var abi$1 = [
3120
4095
  },
3121
4096
  {
3122
4097
  inputs: [
4098
+ {
4099
+ internalType: "bool",
4100
+ name: "isActive",
4101
+ type: "bool"
4102
+ }
3123
4103
  ],
3124
- name: "royaltyFeeManager",
4104
+ name: "updateAffiliateProgramStatus",
3125
4105
  outputs: [
4106
+ ],
4107
+ stateMutability: "nonpayable",
4108
+ type: "function"
4109
+ },
4110
+ {
4111
+ inputs: [
3126
4112
  {
3127
- internalType: "contract IRoyaltyFeeManager",
3128
- name: "",
4113
+ internalType: "address",
4114
+ name: "affiliate",
3129
4115
  type: "address"
4116
+ },
4117
+ {
4118
+ internalType: "uint256",
4119
+ name: "bp",
4120
+ type: "uint256"
3130
4121
  }
3131
4122
  ],
3132
- stateMutability: "view",
4123
+ name: "updateAffiliateRate",
4124
+ outputs: [
4125
+ ],
4126
+ stateMutability: "nonpayable",
3133
4127
  type: "function"
3134
4128
  },
3135
4129
  {
3136
4130
  inputs: [
3137
4131
  {
3138
4132
  internalType: "address",
3139
- name: "newOwner",
4133
+ name: "newCreatorFeeManager",
3140
4134
  type: "address"
3141
4135
  }
3142
4136
  ],
3143
- name: "transferOwnership",
4137
+ name: "updateCreatorFeeManager",
3144
4138
  outputs: [
3145
4139
  ],
3146
4140
  stateMutability: "nonpayable",
@@ -3148,27 +4142,41 @@ var abi$1 = [
3148
4142
  },
3149
4143
  {
3150
4144
  inputs: [
3151
- ],
3152
- name: "transferSelectorNFT",
3153
- outputs: [
3154
4145
  {
3155
- internalType: "contract ITransferSelectorNFT",
3156
- name: "",
4146
+ internalType: "address",
4147
+ name: "currency",
3157
4148
  type: "address"
4149
+ },
4150
+ {
4151
+ internalType: "bool",
4152
+ name: "isAllowed",
4153
+ type: "bool"
3158
4154
  }
3159
4155
  ],
3160
- stateMutability: "view",
4156
+ name: "updateCurrencyStatus",
4157
+ outputs: [
4158
+ ],
4159
+ stateMutability: "nonpayable",
4160
+ type: "function"
4161
+ },
4162
+ {
4163
+ inputs: [
4164
+ ],
4165
+ name: "updateDomainSeparator",
4166
+ outputs: [
4167
+ ],
4168
+ stateMutability: "nonpayable",
3161
4169
  type: "function"
3162
4170
  },
3163
4171
  {
3164
4172
  inputs: [
3165
4173
  {
3166
- internalType: "address",
3167
- name: "_currencyManager",
3168
- type: "address"
4174
+ internalType: "uint256",
4175
+ name: "newGasLimitETHTransfer",
4176
+ type: "uint256"
3169
4177
  }
3170
4178
  ],
3171
- name: "updateCurrencyManager",
4179
+ name: "updateETHGasLimitForTransfer",
3172
4180
  outputs: [
3173
4181
  ],
3174
4182
  stateMutability: "nonpayable",
@@ -3177,12 +4185,12 @@ var abi$1 = [
3177
4185
  {
3178
4186
  inputs: [
3179
4187
  {
3180
- internalType: "address",
3181
- name: "_executionManager",
3182
- type: "address"
4188
+ internalType: "uint16",
4189
+ name: "newMaxCreatorFeeBp",
4190
+ type: "uint16"
3183
4191
  }
3184
4192
  ],
3185
- name: "updateExecutionManager",
4193
+ name: "updateMaxCreatorFeeBp",
3186
4194
  outputs: [
3187
4195
  ],
3188
4196
  stateMutability: "nonpayable",
@@ -3192,7 +4200,7 @@ var abi$1 = [
3192
4200
  inputs: [
3193
4201
  {
3194
4202
  internalType: "address",
3195
- name: "_protocolFeeRecipient",
4203
+ name: "newProtocolFeeRecipient",
3196
4204
  type: "address"
3197
4205
  }
3198
4206
  ],
@@ -3205,12 +4213,27 @@ var abi$1 = [
3205
4213
  {
3206
4214
  inputs: [
3207
4215
  {
3208
- internalType: "address",
3209
- name: "_royaltyFeeManager",
3210
- type: "address"
4216
+ internalType: "uint256",
4217
+ name: "strategyId",
4218
+ type: "uint256"
4219
+ },
4220
+ {
4221
+ internalType: "bool",
4222
+ name: "isActive",
4223
+ type: "bool"
4224
+ },
4225
+ {
4226
+ internalType: "uint16",
4227
+ name: "newStandardProtocolFee",
4228
+ type: "uint16"
4229
+ },
4230
+ {
4231
+ internalType: "uint16",
4232
+ name: "newMinTotalFee",
4233
+ type: "uint16"
3211
4234
  }
3212
4235
  ],
3213
- name: "updateRoyaltyFeeManager",
4236
+ name: "updateStrategy",
3214
4237
  outputs: [
3215
4238
  ],
3216
4239
  stateMutability: "nonpayable",
@@ -3220,14 +4243,24 @@ var abi$1 = [
3220
4243
  inputs: [
3221
4244
  {
3222
4245
  internalType: "address",
3223
- name: "_transferSelectorNFT",
4246
+ name: "",
3224
4247
  type: "address"
3225
4248
  }
3226
4249
  ],
3227
- name: "updateTransferSelectorNFT",
4250
+ name: "userBidAskNonces",
3228
4251
  outputs: [
4252
+ {
4253
+ internalType: "uint256",
4254
+ name: "bidNonce",
4255
+ type: "uint256"
4256
+ },
4257
+ {
4258
+ internalType: "uint256",
4259
+ name: "askNonce",
4260
+ type: "uint256"
4261
+ }
3229
4262
  ],
3230
- stateMutability: "nonpayable",
4263
+ stateMutability: "view",
3231
4264
  type: "function"
3232
4265
  },
3233
4266
  {
@@ -3236,62 +4269,118 @@ var abi$1 = [
3236
4269
  internalType: "address",
3237
4270
  name: "",
3238
4271
  type: "address"
4272
+ },
4273
+ {
4274
+ internalType: "uint256",
4275
+ name: "",
4276
+ type: "uint256"
3239
4277
  }
3240
4278
  ],
3241
- name: "userMinOrderNonce",
4279
+ name: "userOrderNonce",
3242
4280
  outputs: [
4281
+ {
4282
+ internalType: "bytes32",
4283
+ name: "",
4284
+ type: "bytes32"
4285
+ }
4286
+ ],
4287
+ stateMutability: "view",
4288
+ type: "function"
4289
+ },
4290
+ {
4291
+ inputs: [
4292
+ {
4293
+ internalType: "address",
4294
+ name: "",
4295
+ type: "address"
4296
+ },
3243
4297
  {
3244
4298
  internalType: "uint256",
3245
4299
  name: "",
3246
4300
  type: "uint256"
3247
4301
  }
3248
4302
  ],
4303
+ name: "userSubsetNonce",
4304
+ outputs: [
4305
+ {
4306
+ internalType: "bool",
4307
+ name: "",
4308
+ type: "bool"
4309
+ }
4310
+ ],
3249
4311
  stateMutability: "view",
3250
4312
  type: "function"
3251
4313
  }
3252
4314
  ];
3253
4315
 
3254
- var LooksRareTrade = /*#__PURE__*/function (_NFTTrade) {
3255
- _inheritsLoose(LooksRareTrade, _NFTTrade);
3256
- function LooksRareTrade(orders) {
3257
- return _NFTTrade.call(this, exports.Market.LooksRare, orders) || this;
4316
+ var LooksRareV2Trade = /*#__PURE__*/function (_NFTTrade) {
4317
+ _inheritsLoose(LooksRareV2Trade, _NFTTrade);
4318
+ function LooksRareV2Trade(orders) {
4319
+ return _NFTTrade.call(this, exports.Market.LooksRareV2, orders) || this;
3258
4320
  }
3259
- var _proto = LooksRareTrade.prototype;
4321
+ var _proto = LooksRareV2Trade.prototype;
3260
4322
  _proto.encode = function encode(planner, config) {
3261
4323
  for (var _iterator = _createForOfIteratorHelperLoose(this.orders), _step; !(_step = _iterator()).done;) {
3262
4324
  var item = _step.value;
3263
- var calldata = LooksRareTrade.INTERFACE.encodeFunctionData('matchAskWithTakerBidUsingETHAndWETH', [item.takerOrder, item.makerOrder]);
3264
- if (item.tokenType == exports.TokenType.ERC721) {
3265
- !(item.makerOrder.amount == 1) ? invariant(false, 'ERC721 token amount must be 1') : void 0;
3266
- planner.addCommand(CommandType.LOOKS_RARE_721, [item.makerOrder.price, calldata, item.recipient, item.makerOrder.collection, item.makerOrder.tokenId], config.allowRevert);
3267
- } else if (item.tokenType == exports.TokenType.ERC1155) {
3268
- planner.addCommand(CommandType.LOOKS_RARE_1155, [item.makerOrder.price, calldata, item.recipient, item.makerOrder.collection, item.makerOrder.tokenId, item.makerOrder.amount], config.allowRevert);
3269
- }
4325
+ var _this$refactorAPIData = this.refactorAPIData(item),
4326
+ takerBid = _this$refactorAPIData.takerBid,
4327
+ makerOrder = _this$refactorAPIData.makerOrder,
4328
+ makerSignature = _this$refactorAPIData.makerSignature,
4329
+ value = _this$refactorAPIData.value,
4330
+ merkleTree = _this$refactorAPIData.merkleTree;
4331
+ var calldata = LooksRareV2Trade.INTERFACE.encodeFunctionData('executeTakerBid', [takerBid, makerOrder, makerSignature, merkleTree, ZERO_ADDRESS]);
4332
+ planner.addCommand(CommandType.LOOKS_RARE_V2, [value, calldata], config.allowRevert);
3270
4333
  }
3271
4334
  };
3272
4335
  _proto.getBuyItems = function getBuyItems() {
3273
4336
  var buyItems = [];
3274
4337
  for (var _iterator2 = _createForOfIteratorHelperLoose(this.orders), _step2; !(_step2 = _iterator2()).done;) {
3275
4338
  var item = _step2.value;
3276
- buyItems.push({
3277
- tokenAddress: item.makerOrder.collection,
3278
- tokenId: item.makerOrder.tokenId,
3279
- tokenType: item.tokenType
3280
- });
4339
+ var tokenAddress = item.apiOrder.collection;
4340
+ var tokenType = item.apiOrder.collectionType == LooksRareV2Trade.ERC721_ORDER ? exports.TokenType.ERC721 : exports.TokenType.ERC1155;
4341
+ for (var _iterator3 = _createForOfIteratorHelperLoose(item.apiOrder.itemIds), _step3; !(_step3 = _iterator3()).done;) {
4342
+ var tokenId = _step3.value;
4343
+ buyItems.push({
4344
+ tokenAddress: tokenAddress,
4345
+ tokenId: tokenId,
4346
+ tokenType: tokenType
4347
+ });
4348
+ }
3281
4349
  }
3282
4350
  return buyItems;
3283
4351
  };
3284
4352
  _proto.getTotalPrice = function getTotalPrice() {
3285
4353
  var total = ethers.BigNumber.from(0);
3286
- for (var _iterator3 = _createForOfIteratorHelperLoose(this.orders), _step3; !(_step3 = _iterator3()).done;) {
3287
- var item = _step3.value;
3288
- total = total.add(item.makerOrder.price);
4354
+ for (var _iterator4 = _createForOfIteratorHelperLoose(this.orders), _step4; !(_step4 = _iterator4()).done;) {
4355
+ var item = _step4.value;
4356
+ total = total.add(item.apiOrder.price);
3289
4357
  }
3290
4358
  return total;
3291
4359
  };
3292
- return LooksRareTrade;
4360
+ _proto.refactorAPIData = function refactorAPIData(data) {
4361
+ var makerOrder = _extends({}, data.apiOrder);
4362
+ var makerSignature = data.apiOrder.signature;
4363
+ var takerBid = {
4364
+ recipient: data.taker,
4365
+ additionalParameters: '0x'
4366
+ };
4367
+ var value = ethers.BigNumber.from(data.apiOrder.price);
4368
+ var merkleTree = {
4369
+ root: data.apiOrder.merkleRoot,
4370
+ proof: data.apiOrder.merkleProof
4371
+ };
4372
+ return {
4373
+ takerBid: takerBid,
4374
+ makerOrder: makerOrder,
4375
+ makerSignature: makerSignature,
4376
+ value: value,
4377
+ merkleTree: merkleTree
4378
+ };
4379
+ };
4380
+ return LooksRareV2Trade;
3293
4381
  }(NFTTrade);
3294
- LooksRareTrade.INTERFACE = /*#__PURE__*/new abi$7.Interface(abi$1);
4382
+ LooksRareV2Trade.INTERFACE = /*#__PURE__*/new abi$7.Interface(abi$1);
4383
+ LooksRareV2Trade.ERC721_ORDER = 0;
3295
4384
 
3296
4385
  var abi$2 = [
3297
4386
  {
@@ -3601,8 +4690,18 @@ var abi$3 = [
3601
4690
  },
3602
4691
  {
3603
4692
  internalType: "address",
3604
- name: "_sushiRouter",
4693
+ name: "_WETH",
4694
+ type: "address"
4695
+ },
4696
+ {
4697
+ internalType: "address payable",
4698
+ name: "_swapTarget",
3605
4699
  type: "address"
4700
+ },
4701
+ {
4702
+ internalType: "uint256",
4703
+ name: "_dustThreshold",
4704
+ type: "uint256"
3606
4705
  }
3607
4706
  ],
3608
4707
  stateMutability: "nonpayable",
@@ -3633,38 +4732,19 @@ var abi$3 = [
3633
4732
  name: "Buy",
3634
4733
  type: "event"
3635
4734
  },
3636
- {
3637
- anonymous: false,
3638
- inputs: [
3639
- {
3640
- indexed: true,
3641
- internalType: "address",
3642
- name: "previousOwner",
3643
- type: "address"
3644
- },
3645
- {
3646
- indexed: true,
3647
- internalType: "address",
3648
- name: "newOwner",
3649
- type: "address"
3650
- }
3651
- ],
3652
- name: "OwnershipTransferred",
3653
- type: "event"
3654
- },
3655
4735
  {
3656
4736
  anonymous: false,
3657
4737
  inputs: [
3658
4738
  {
3659
4739
  indexed: false,
3660
4740
  internalType: "uint256",
3661
- name: "count",
4741
+ name: "ethAmount",
3662
4742
  type: "uint256"
3663
4743
  },
3664
4744
  {
3665
4745
  indexed: false,
3666
4746
  internalType: "uint256",
3667
- name: "ethReceived",
4747
+ name: "vTokenAmount",
3668
4748
  type: "uint256"
3669
4749
  },
3670
4750
  {
@@ -3674,119 +4754,90 @@ var abi$3 = [
3674
4754
  type: "address"
3675
4755
  }
3676
4756
  ],
3677
- name: "Sell",
4757
+ name: "DustReturned",
3678
4758
  type: "event"
3679
4759
  },
3680
4760
  {
3681
4761
  anonymous: false,
3682
4762
  inputs: [
3683
4763
  {
3684
- indexed: false,
3685
- internalType: "uint256",
3686
- name: "count",
3687
- type: "uint256"
3688
- },
3689
- {
3690
- indexed: false,
3691
- internalType: "uint256",
3692
- name: "ethSpent",
3693
- type: "uint256"
4764
+ indexed: true,
4765
+ internalType: "address",
4766
+ name: "previousOwner",
4767
+ type: "address"
3694
4768
  },
3695
4769
  {
3696
- indexed: false,
4770
+ indexed: true,
3697
4771
  internalType: "address",
3698
- name: "to",
4772
+ name: "newOwner",
3699
4773
  type: "address"
3700
4774
  }
3701
4775
  ],
3702
- name: "Swap",
4776
+ name: "OwnershipTransferred",
3703
4777
  type: "event"
3704
4778
  },
3705
4779
  {
3706
- inputs: [
3707
- ],
3708
- name: "WETH",
3709
- outputs: [
3710
- {
3711
- internalType: "contract IWETH",
3712
- name: "",
3713
- type: "address"
3714
- }
3715
- ],
3716
- stateMutability: "view",
3717
- type: "function"
3718
- },
3719
- {
4780
+ anonymous: false,
3720
4781
  inputs: [
3721
4782
  {
4783
+ indexed: false,
3722
4784
  internalType: "uint256",
3723
- name: "vaultId",
4785
+ name: "count",
3724
4786
  type: "uint256"
3725
4787
  },
3726
4788
  {
4789
+ indexed: false,
3727
4790
  internalType: "uint256",
3728
- name: "amount",
4791
+ name: "ethReceived",
3729
4792
  type: "uint256"
3730
4793
  },
3731
4794
  {
3732
- internalType: "uint256[]",
3733
- name: "specificIds",
3734
- type: "uint256[]"
3735
- },
3736
- {
3737
- internalType: "address[]",
3738
- name: "path",
3739
- type: "address[]"
3740
- },
3741
- {
4795
+ indexed: false,
3742
4796
  internalType: "address",
3743
4797
  name: "to",
3744
4798
  type: "address"
3745
4799
  }
3746
4800
  ],
3747
- name: "buyAndRedeem",
3748
- outputs: [
3749
- ],
3750
- stateMutability: "payable",
3751
- type: "function"
4801
+ name: "Sell",
4802
+ type: "event"
3752
4803
  },
3753
4804
  {
4805
+ anonymous: false,
3754
4806
  inputs: [
3755
4807
  {
4808
+ indexed: false,
3756
4809
  internalType: "uint256",
3757
- name: "vaultId",
3758
- type: "uint256"
3759
- },
3760
- {
3761
- internalType: "uint256",
3762
- name: "amount",
4810
+ name: "count",
3763
4811
  type: "uint256"
3764
4812
  },
3765
4813
  {
3766
- internalType: "uint256[]",
3767
- name: "specificIds",
3768
- type: "uint256[]"
3769
- },
3770
- {
4814
+ indexed: false,
3771
4815
  internalType: "uint256",
3772
- name: "maxWethIn",
4816
+ name: "ethSpent",
3773
4817
  type: "uint256"
3774
4818
  },
3775
4819
  {
3776
- internalType: "address[]",
3777
- name: "path",
3778
- type: "address[]"
3779
- },
3780
- {
4820
+ indexed: false,
3781
4821
  internalType: "address",
3782
4822
  name: "to",
3783
4823
  type: "address"
3784
4824
  }
3785
4825
  ],
3786
- name: "buyAndRedeemWETH",
4826
+ name: "Swap",
4827
+ type: "event"
4828
+ },
4829
+ {
4830
+ inputs: [
4831
+ ],
4832
+ name: "WETH",
3787
4833
  outputs: [
4834
+ {
4835
+ internalType: "contract IWETH",
4836
+ name: "",
4837
+ type: "address"
4838
+ }
3788
4839
  ],
3789
- stateMutability: "nonpayable",
4840
+ stateMutability: "view",
3790
4841
  type: "function"
3791
4842
  },
3792
4843
  {
@@ -3797,14 +4848,9 @@ var abi$3 = [
3797
4848
  type: "uint256"
3798
4849
  },
3799
4850
  {
3800
- internalType: "uint256[]",
3801
- name: "idsIn",
3802
- type: "uint256[]"
3803
- },
3804
- {
3805
- internalType: "uint256[]",
3806
- name: "amounts",
3807
- type: "uint256[]"
4851
+ internalType: "uint256",
4852
+ name: "amount",
4853
+ type: "uint256"
3808
4854
  },
3809
4855
  {
3810
4856
  internalType: "uint256[]",
@@ -3812,17 +4858,17 @@ var abi$3 = [
3812
4858
  type: "uint256[]"
3813
4859
  },
3814
4860
  {
3815
- internalType: "address[]",
3816
- name: "path",
3817
- type: "address[]"
4861
+ internalType: "bytes",
4862
+ name: "swapCallData",
4863
+ type: "bytes"
3818
4864
  },
3819
4865
  {
3820
- internalType: "address",
4866
+ internalType: "address payable",
3821
4867
  name: "to",
3822
4868
  type: "address"
3823
4869
  }
3824
4870
  ],
3825
- name: "buyAndSwap1155",
4871
+ name: "buyAndRedeem",
3826
4872
  outputs: [
3827
4873
  ],
3828
4874
  stateMutability: "payable",
@@ -3851,22 +4897,17 @@ var abi$3 = [
3851
4897
  type: "uint256[]"
3852
4898
  },
3853
4899
  {
3854
- internalType: "uint256",
3855
- name: "maxWethIn",
3856
- type: "uint256"
3857
- },
3858
- {
3859
- internalType: "address[]",
3860
- name: "path",
3861
- type: "address[]"
4900
+ internalType: "bytes",
4901
+ name: "swapCallData",
4902
+ type: "bytes"
3862
4903
  },
3863
4904
  {
3864
- internalType: "address",
4905
+ internalType: "address payable",
3865
4906
  name: "to",
3866
4907
  type: "address"
3867
4908
  }
3868
4909
  ],
3869
- name: "buyAndSwap1155WETH",
4910
+ name: "buyAndSwap1155",
3870
4911
  outputs: [
3871
4912
  ],
3872
4913
  stateMutability: "payable",
@@ -3890,12 +4931,12 @@ var abi$3 = [
3890
4931
  type: "uint256[]"
3891
4932
  },
3892
4933
  {
3893
- internalType: "address[]",
3894
- name: "path",
3895
- type: "address[]"
4934
+ internalType: "bytes",
4935
+ name: "swapCallData",
4936
+ type: "bytes"
3896
4937
  },
3897
4938
  {
3898
- internalType: "address",
4939
+ internalType: "address payable",
3899
4940
  name: "to",
3900
4941
  type: "address"
3901
4942
  }
@@ -3908,50 +4949,25 @@ var abi$3 = [
3908
4949
  },
3909
4950
  {
3910
4951
  inputs: [
4952
+ ],
4953
+ name: "dustThreshold",
4954
+ outputs: [
3911
4955
  {
3912
4956
  internalType: "uint256",
3913
- name: "vaultId",
3914
- type: "uint256"
3915
- },
3916
- {
3917
- internalType: "uint256[]",
3918
- name: "idsIn",
3919
- type: "uint256[]"
3920
- },
3921
- {
3922
- internalType: "uint256[]",
3923
- name: "specificIds",
3924
- type: "uint256[]"
3925
- },
3926
- {
3927
- internalType: "uint256",
3928
- name: "maxWethIn",
4957
+ name: "",
3929
4958
  type: "uint256"
3930
- },
3931
- {
3932
- internalType: "address[]",
3933
- name: "path",
3934
- type: "address[]"
3935
- },
3936
- {
3937
- internalType: "address",
3938
- name: "to",
3939
- type: "address"
3940
4959
  }
3941
4960
  ],
3942
- name: "buyAndSwap721WETH",
3943
- outputs: [
3944
- ],
3945
- stateMutability: "nonpayable",
4961
+ stateMutability: "view",
3946
4962
  type: "function"
3947
4963
  },
3948
4964
  {
3949
4965
  inputs: [
3950
4966
  ],
3951
- name: "lpStaking",
4967
+ name: "feeDistributor",
3952
4968
  outputs: [
3953
4969
  {
3954
- internalType: "contract INFTXLPStaking",
4970
+ internalType: "address",
3955
4971
  name: "",
3956
4972
  type: "address"
3957
4973
  }
@@ -3977,17 +4993,12 @@ var abi$3 = [
3977
4993
  type: "uint256[]"
3978
4994
  },
3979
4995
  {
3980
- internalType: "uint256",
3981
- name: "minWethOut",
3982
- type: "uint256"
3983
- },
3984
- {
3985
- internalType: "address[]",
3986
- name: "path",
3987
- type: "address[]"
4996
+ internalType: "bytes",
4997
+ name: "swapCallData",
4998
+ type: "bytes"
3988
4999
  },
3989
5000
  {
3990
- internalType: "address",
5001
+ internalType: "address payable",
3991
5002
  name: "to",
3992
5003
  type: "address"
3993
5004
  }
@@ -4011,27 +5022,17 @@ var abi$3 = [
4011
5022
  type: "uint256[]"
4012
5023
  },
4013
5024
  {
4014
- internalType: "uint256[]",
4015
- name: "amounts",
4016
- type: "uint256[]"
4017
- },
4018
- {
4019
- internalType: "uint256",
4020
- name: "minWethOut",
4021
- type: "uint256"
4022
- },
4023
- {
4024
- internalType: "address[]",
4025
- name: "path",
4026
- type: "address[]"
5025
+ internalType: "bytes",
5026
+ name: "swapCallData",
5027
+ type: "bytes"
4027
5028
  },
4028
5029
  {
4029
- internalType: "address",
5030
+ internalType: "address payable",
4030
5031
  name: "to",
4031
5032
  type: "address"
4032
5033
  }
4033
5034
  ],
4034
- name: "mintAndSell1155WETH",
5035
+ name: "mintAndSell721",
4035
5036
  outputs: [
4036
5037
  ],
4037
5038
  stateMutability: "nonpayable",
@@ -4039,79 +5040,30 @@ var abi$3 = [
4039
5040
  },
4040
5041
  {
4041
5042
  inputs: [
5043
+ ],
5044
+ name: "nftxFactory",
5045
+ outputs: [
4042
5046
  {
4043
- internalType: "uint256",
4044
- name: "vaultId",
4045
- type: "uint256"
4046
- },
4047
- {
4048
- internalType: "uint256[]",
4049
- name: "ids",
4050
- type: "uint256[]"
4051
- },
4052
- {
4053
- internalType: "uint256",
4054
- name: "minEthOut",
4055
- type: "uint256"
4056
- },
4057
- {
4058
- internalType: "address[]",
4059
- name: "path",
4060
- type: "address[]"
4061
- },
4062
- {
4063
- internalType: "address",
4064
- name: "to",
5047
+ internalType: "contract INFTXVaultFactory",
5048
+ name: "",
4065
5049
  type: "address"
4066
5050
  }
4067
5051
  ],
4068
- name: "mintAndSell721",
4069
- outputs: [
4070
- ],
4071
- stateMutability: "nonpayable",
5052
+ stateMutability: "view",
4072
5053
  type: "function"
4073
5054
  },
4074
5055
  {
4075
5056
  inputs: [
4076
5057
  {
4077
5058
  internalType: "uint256",
4078
- name: "vaultId",
4079
- type: "uint256"
4080
- },
4081
- {
4082
- internalType: "uint256[]",
4083
- name: "ids",
4084
- type: "uint256[]"
4085
- },
4086
- {
4087
- internalType: "uint256",
4088
- name: "minWethOut",
5059
+ name: "",
4089
5060
  type: "uint256"
4090
- },
4091
- {
4092
- internalType: "address[]",
4093
- name: "path",
4094
- type: "address[]"
4095
- },
4096
- {
4097
- internalType: "address",
4098
- name: "to",
4099
- type: "address"
4100
5061
  }
4101
5062
  ],
4102
- name: "mintAndSell721WETH",
4103
- outputs: [
4104
- ],
4105
- stateMutability: "nonpayable",
4106
- type: "function"
4107
- },
4108
- {
4109
- inputs: [
4110
- ],
4111
- name: "nftxFactory",
5063
+ name: "nftxVaultAddresses",
4112
5064
  outputs: [
4113
5065
  {
4114
- internalType: "contract INFTXVaultFactory",
5066
+ internalType: "address",
4115
5067
  name: "",
4116
5068
  type: "address"
4117
5069
  }
@@ -4245,6 +5197,34 @@ var abi$3 = [
4245
5197
  stateMutability: "view",
4246
5198
  type: "function"
4247
5199
  },
5200
+ {
5201
+ inputs: [
5202
+ {
5203
+ internalType: "bool",
5204
+ name: "_paused",
5205
+ type: "bool"
5206
+ }
5207
+ ],
5208
+ name: "pause",
5209
+ outputs: [
5210
+ ],
5211
+ stateMutability: "nonpayable",
5212
+ type: "function"
5213
+ },
5214
+ {
5215
+ inputs: [
5216
+ ],
5217
+ name: "paused",
5218
+ outputs: [
5219
+ {
5220
+ internalType: "bool",
5221
+ name: "",
5222
+ type: "bool"
5223
+ }
5224
+ ],
5225
+ stateMutability: "view",
5226
+ type: "function"
5227
+ },
4248
5228
  {
4249
5229
  inputs: [
4250
5230
  ],
@@ -4271,31 +5251,31 @@ var abi$3 = [
4271
5251
  {
4272
5252
  inputs: [
4273
5253
  {
4274
- internalType: "bytes4",
4275
- name: "interfaceId",
4276
- type: "bytes4"
5254
+ internalType: "uint256",
5255
+ name: "_dustThreshold",
5256
+ type: "uint256"
4277
5257
  }
4278
5258
  ],
4279
- name: "supportsInterface",
5259
+ name: "setDustThreshold",
4280
5260
  outputs: [
4281
- {
4282
- internalType: "bool",
4283
- name: "",
4284
- type: "bool"
4285
- }
4286
5261
  ],
4287
- stateMutability: "view",
5262
+ stateMutability: "nonpayable",
4288
5263
  type: "function"
4289
5264
  },
4290
5265
  {
4291
5266
  inputs: [
5267
+ {
5268
+ internalType: "bytes4",
5269
+ name: "interfaceId",
5270
+ type: "bytes4"
5271
+ }
4292
5272
  ],
4293
- name: "sushiRouter",
5273
+ name: "supportsInterface",
4294
5274
  outputs: [
4295
5275
  {
4296
- internalType: "contract IUniswapV2Router01",
5276
+ internalType: "bool",
4297
5277
  name: "",
4298
- type: "address"
5278
+ type: "bool"
4299
5279
  }
4300
5280
  ],
4301
5281
  stateMutability: "view",
@@ -4330,7 +5310,7 @@ var NFTXTrade = /*#__PURE__*/function (_NFTTrade) {
4330
5310
  _proto.encode = function encode(planner, config) {
4331
5311
  for (var _iterator = _createForOfIteratorHelperLoose(this.orders), _step; !(_step = _iterator()).done;) {
4332
5312
  var order = _step.value;
4333
- var calldata = NFTXTrade.INTERFACE.encodeFunctionData('buyAndRedeem', [order.vaultId, order.tokenIds.length, order.tokenIds, [sdkCore.Ether.onChain(1).wrapped.address, order.vaultAddress], order.recipient]);
5313
+ var calldata = NFTXTrade.INTERFACE.encodeFunctionData('buyAndRedeem', [order.vaultId, order.tokenIds.length, order.tokenIds, order.swapCalldata, order.recipient]);
4334
5314
  planner.addCommand(CommandType.NFTX, [order.value, calldata], config.allowRevert);
4335
5315
  }
4336
5316
  };
@@ -6988,10 +7968,6 @@ var abi$4 = [
6988
7968
  }
6989
7969
  ];
6990
7970
 
6991
- (function (SeaportVersion) {
6992
- SeaportVersion[SeaportVersion["V1_1"] = 0] = "V1_1";
6993
- SeaportVersion[SeaportVersion["V1_4"] = 1] = "V1_4";
6994
- })(exports.SeaportVersion || (exports.SeaportVersion = {}));
6995
7971
  var SeaportTrade = /*#__PURE__*/function (_NFTTrade) {
6996
7972
  _inheritsLoose(SeaportTrade, _NFTTrade);
6997
7973
  function SeaportTrade(orders) {
@@ -7021,17 +7997,33 @@ var SeaportTrade = /*#__PURE__*/function (_NFTTrade) {
7021
7997
  } else {
7022
7998
  calldata = SeaportTrade.INTERFACE.encodeFunctionData('fulfillAvailableAdvancedOrders', [advancedOrders, [], orderFulfillments, considerationFulFillments, SeaportTrade.OPENSEA_CONDUIT_KEY, order.recipient, 100]);
7023
7999
  }
7024
- planner.addCommand(this.commandMap(order.version), [this.getTotalOrderPrice(order).toString(), calldata], config.allowRevert);
8000
+ if (!!order.inputTokenProcessing) {
8001
+ for (var _iterator3 = _createForOfIteratorHelperLoose(order.inputTokenProcessing), _step3; !(_step3 = _iterator3()).done;) {
8002
+ var inputToken = _step3.value;
8003
+ encodeInputTokenOptions(planner, {
8004
+ approval: inputToken.protocolApproval ? {
8005
+ token: inputToken.token,
8006
+ protocol: order.protocolAddress
8007
+ } : undefined,
8008
+ permit2Permit: inputToken.permit2Permit,
8009
+ permit2TransferFrom: inputToken.permit2TransferFrom ? {
8010
+ token: inputToken.token,
8011
+ amount: this.getTotalOrderPrice(order, inputToken.token).toString()
8012
+ } : undefined
8013
+ });
8014
+ }
8015
+ }
8016
+ planner.addCommand(this.commandMap(order.protocolAddress), [this.getTotalOrderPrice(order, ETH_ADDRESS).toString(), calldata], config.allowRevert);
7025
8017
  }
7026
8018
  };
7027
8019
  _proto.getBuyItems = function getBuyItems() {
7028
8020
  var buyItems = [];
7029
- for (var _iterator3 = _createForOfIteratorHelperLoose(this.orders), _step3; !(_step3 = _iterator3()).done;) {
7030
- var order = _step3.value;
7031
- for (var _iterator4 = _createForOfIteratorHelperLoose(order.items), _step4; !(_step4 = _iterator4()).done;) {
7032
- var item = _step4.value;
7033
- for (var _iterator5 = _createForOfIteratorHelperLoose(item.parameters.offer), _step5; !(_step5 = _iterator5()).done;) {
7034
- var offer = _step5.value;
8021
+ for (var _iterator4 = _createForOfIteratorHelperLoose(this.orders), _step4; !(_step4 = _iterator4()).done;) {
8022
+ var order = _step4.value;
8023
+ for (var _iterator5 = _createForOfIteratorHelperLoose(order.items), _step5; !(_step5 = _iterator5()).done;) {
8024
+ var item = _step5.value;
8025
+ for (var _iterator6 = _createForOfIteratorHelperLoose(item.parameters.offer), _step6; !(_step6 = _iterator6()).done;) {
8026
+ var offer = _step6.value;
7035
8027
  buyItems.push({
7036
8028
  tokenAddress: offer.token,
7037
8029
  tokenId: offer.identifierOrCriteria,
@@ -7042,31 +8034,41 @@ var SeaportTrade = /*#__PURE__*/function (_NFTTrade) {
7042
8034
  }
7043
8035
  return buyItems;
7044
8036
  };
7045
- _proto.getTotalOrderPrice = function getTotalOrderPrice(order) {
8037
+ _proto.getTotalOrderPrice = function getTotalOrderPrice(order, token) {
8038
+ if (token === void 0) {
8039
+ token = ETH_ADDRESS;
8040
+ }
7046
8041
  var totalOrderPrice = ethers.BigNumber.from(0);
7047
- for (var _iterator6 = _createForOfIteratorHelperLoose(order.items), _step6; !(_step6 = _iterator6()).done;) {
7048
- var item = _step6.value;
7049
- totalOrderPrice = totalOrderPrice.add(this.calculateValue(item.parameters.consideration));
8042
+ for (var _iterator7 = _createForOfIteratorHelperLoose(order.items), _step7; !(_step7 = _iterator7()).done;) {
8043
+ var item = _step7.value;
8044
+ totalOrderPrice = totalOrderPrice.add(this.calculateValue(item.parameters.consideration, token));
7050
8045
  }
7051
8046
  return totalOrderPrice;
7052
8047
  };
7053
- _proto.getTotalPrice = function getTotalPrice() {
8048
+ _proto.getTotalPrice = function getTotalPrice(token) {
8049
+ if (token === void 0) {
8050
+ token = ETH_ADDRESS;
8051
+ }
7054
8052
  var totalPrice = ethers.BigNumber.from(0);
7055
- for (var _iterator7 = _createForOfIteratorHelperLoose(this.orders), _step7; !(_step7 = _iterator7()).done;) {
7056
- var order = _step7.value;
7057
- for (var _iterator8 = _createForOfIteratorHelperLoose(order.items), _step8; !(_step8 = _iterator8()).done;) {
7058
- var item = _step8.value;
7059
- totalPrice = totalPrice.add(this.calculateValue(item.parameters.consideration));
8053
+ for (var _iterator8 = _createForOfIteratorHelperLoose(this.orders), _step8; !(_step8 = _iterator8()).done;) {
8054
+ var order = _step8.value;
8055
+ for (var _iterator9 = _createForOfIteratorHelperLoose(order.items), _step9; !(_step9 = _iterator9()).done;) {
8056
+ var item = _step9.value;
8057
+ totalPrice = totalPrice.add(this.calculateValue(item.parameters.consideration, token));
7060
8058
  }
7061
8059
  }
7062
8060
  return totalPrice;
7063
8061
  };
7064
- _proto.commandMap = function commandMap(version) {
7065
- switch (version) {
7066
- case exports.SeaportVersion.V1_1:
8062
+ _proto.commandMap = function commandMap(protocolAddress) {
8063
+ switch (protocolAddress.toLowerCase()) {
8064
+ case '0x00000000006c3852cbef3e08e8df289169ede581':
8065
+ // Seaport v1.1
7067
8066
  return CommandType.SEAPORT;
7068
- case exports.SeaportVersion.V1_4:
8067
+ case '0x00000000000001ad428e4906ae43d8f9852d0dd6':
8068
+ // Seaport v1.4
7069
8069
  return CommandType.SEAPORT_V1_4;
8070
+ default:
8071
+ throw new Error('unsupported Seaport address');
7070
8072
  }
7071
8073
  };
7072
8074
  _proto.getConsiderationFulfillments = function getConsiderationFulfillments(protocolDatas) {
@@ -7110,15 +8112,13 @@ var SeaportTrade = /*#__PURE__*/function (_NFTTrade) {
7110
8112
  signature: data.signature,
7111
8113
  extraData: '0x00'
7112
8114
  };
7113
- var value = this.calculateValue(data.parameters.consideration);
7114
8115
  return {
7115
- advancedOrder: advancedOrder,
7116
- value: value
8116
+ advancedOrder: advancedOrder
7117
8117
  };
7118
8118
  };
7119
- _proto.calculateValue = function calculateValue(considerations) {
8119
+ _proto.calculateValue = function calculateValue(considerations, token) {
7120
8120
  return considerations.reduce(function (amt, consideration) {
7121
- return amt.add(consideration.startAmount);
8121
+ return consideration.token == token ? amt.add(consideration.startAmount) : amt;
7122
8122
  }, ethers.BigNumber.from(0));
7123
8123
  };
7124
8124
  return SeaportTrade;
@@ -9444,7 +10444,6 @@ var UnwrapWETH = /*#__PURE__*/function () {
9444
10444
  function UnwrapWETH(amount, chainId, permit2) {
9445
10445
  this.tradeType = exports.RouterTradeType.UnwrapWETH;
9446
10446
  this.wethAddress = WETH_ADDRESS(chainId);
9447
- this.routerAddress = UNIVERSAL_ROUTER_ADDRESS(chainId);
9448
10447
  this.amount = amount;
9449
10448
  if (!!permit2) {
9450
10449
  !(permit2.details.token === this.wethAddress) ? invariant(false, "must be permitting WETH address: " + this.wethAddress) : void 0;
@@ -9454,8 +10453,13 @@ var UnwrapWETH = /*#__PURE__*/function () {
9454
10453
  }
9455
10454
  var _proto = UnwrapWETH.prototype;
9456
10455
  _proto.encode = function encode(planner, _) {
9457
- if (!!this.permit2Data) encodePermit(planner, this.permit2Data);
9458
- planner.addCommand(CommandType.PERMIT2_TRANSFER_FROM, [this.wethAddress, this.routerAddress, this.amount]);
10456
+ encodeInputTokenOptions(planner, {
10457
+ permit2Permit: this.permit2Data,
10458
+ permit2TransferFrom: {
10459
+ token: this.wethAddress,
10460
+ amount: this.amount.toString()
10461
+ }
10462
+ });
9459
10463
  planner.addCommand(CommandType.UNWRAP_WETH, [ROUTER_AS_RECIPIENT, this.amount]);
9460
10464
  };
9461
10465
  return UnwrapWETH;
@@ -9463,7 +10467,7 @@ var UnwrapWETH = /*#__PURE__*/function () {
9463
10467
 
9464
10468
  exports.CryptopunkTrade = CryptopunkTrade;
9465
10469
  exports.FoundationTrade = FoundationTrade;
9466
- exports.LooksRareTrade = LooksRareTrade;
10470
+ exports.LooksRareV2Trade = LooksRareV2Trade;
9467
10471
  exports.NFT20Trade = NFT20Trade;
9468
10472
  exports.NFTTrade = NFTTrade;
9469
10473
  exports.NFTXTrade = NFTXTrade;