From ba842e94e2f0b9f3734d7ad53545bc86c103800b Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Thu, 27 Apr 2023 15:34:51 -0700 Subject: [PATCH] Add Seaport v1.5 (#226) * add seaport v1.5 (default init still v1.4) * simpilfy test setup since we dont need a separate seaport v1.5 instance --- package.json | 4 +- src/__tests__/basic-fulfill.spec.ts | 8 +- src/__tests__/cancel.spec.ts | 9 +- src/__tests__/create-bulk-orders.spec.ts | 10 +- src/__tests__/create-order.spec.ts | 11 +- src/__tests__/utils/setup.ts | 24 +- src/abi/Seaport.ts | 2582 ---------------------- src/constants.ts | 8 +- src/contracts/Conduit.sol | 2 +- src/contracts/ConduitController.sol | 2 +- src/contracts/Seaport.sol | 4 - src/contracts/Seaport_v1_5.sol | 4 + src/seaport.ts | 25 +- src/types.ts | 2 +- 14 files changed, 40 insertions(+), 2655 deletions(-) delete mode 100644 src/abi/Seaport.ts delete mode 100644 src/contracts/Seaport.sol create mode 100644 src/contracts/Seaport_v1_5.sol diff --git a/package.json b/package.json index ae97a1a4..43d03c76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@opensea/seaport-js", - "version": "1.1.0", + "version": "1.2.0", "description": "[Seaport](https://github.com/ProjectOpenSea/seaport) is a new marketplace protocol for safely and efficiently buying and selling NFTs. This is a JavaScript library intended to make interfacing with the contract reasonable and easy.", "license": "MIT", "author": "OpenSea Developers", @@ -91,8 +91,8 @@ "prettier": "^2.5.1", "prettier-package-json": "^2.6.3", "prettier-plugin-solidity": "^1.0.0-beta.13", - "seaport": "ProjectOpenSea/seaport#76e508657888e3ec84039e1da269c822826991ef", "seaport_v1_4": "ProjectOpenSea/seaport#1.4", + "seaport_v1_5": "ProjectOpenSea/seaport#1.5", "sinon": "^13.0.1", "sinon-chai": "^3.7.0", "solhint": "^3.3.7", diff --git a/src/__tests__/basic-fulfill.spec.ts b/src/__tests__/basic-fulfill.spec.ts index 62748aae..188768dc 100644 --- a/src/__tests__/basic-fulfill.spec.ts +++ b/src/__tests__/basic-fulfill.spec.ts @@ -130,7 +130,7 @@ describeWithFixture( // Should revert because signature is empty await expect( action.transactionMethods.transact() - ).to.be.revertedWith("InvalidSigner"); + ).to.be.revertedWith("InvalidSignature"); await seaport.validate([order], offerer.address).transact(); @@ -296,7 +296,7 @@ describeWithFixture( await expect( fulfillAction.transactionMethods.transact() - ).to.be.revertedWith("InvalidSigner"); + ).to.be.revertedWith("InvalidSignature"); await seaport.validate([order], offerer.address).transact(); @@ -505,7 +505,7 @@ describeWithFixture( // Should revert because signature is empty await expect( fulfillAction.transactionMethods.transact() - ).to.be.revertedWith("InvalidSigner"); + ).to.be.revertedWith("InvalidSignature"); await seaport.validate([order], offerer.address).transact(); @@ -670,7 +670,7 @@ describeWithFixture( await expect( fulfillAction.transactionMethods.transact() - ).to.be.revertedWith("InvalidSigner"); + ).to.be.revertedWith("InvalidSignature"); await seaport.validate([order], offerer.address).transact(); diff --git a/src/__tests__/cancel.spec.ts b/src/__tests__/cancel.spec.ts index 40090bd3..ce7f9c3f 100644 --- a/src/__tests__/cancel.spec.ts +++ b/src/__tests__/cancel.spec.ts @@ -1,6 +1,5 @@ import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; -import { BigNumber } from "ethers"; import { parseEther } from "ethers/lib/utils"; import { ethers } from "hardhat"; import { ItemType } from "../constants"; @@ -77,9 +76,11 @@ describeWithFixture("As a user I want to cancel an order", (fixture) => { await expect(executeAllFulfillActionsOffChainOrder()).to.be.reverted; await expect(executeAllFulfillActionsOnChainOrder()).to.be.reverted; - expect(await seaport.getCounter(offerer.address)).to.deep.equal( - BigNumber.from(offChainOrder.parameters.counter).add(1) - ); + expect( + (await seaport.getCounter(offerer.address)).gt( + offChainOrder.parameters.counter + ) + ).to.be.true; }); it("validate then cancel single order", async () => { diff --git a/src/__tests__/create-bulk-orders.spec.ts b/src/__tests__/create-bulk-orders.spec.ts index 972e2c1d..2f092112 100644 --- a/src/__tests__/create-bulk-orders.spec.ts +++ b/src/__tests__/create-bulk-orders.spec.ts @@ -13,7 +13,7 @@ describeWithFixture( "As a user I want to create bulk orders with one signature", (fixture) => { it("should create the orders after setting needed approvals", async () => { - const { seaportv12Contract, seaportv12, testErc721 } = fixture; + const { seaportContract, seaport, testErc721 } = fixture; const [offerer, zone, randomSigner] = await ethers.getSigners(); @@ -56,7 +56,7 @@ describeWithFixture( { ...order, offer: [{ ...order.offer[0], identifier: nftId3 }] }, ]; - const { actions } = await seaportv12.createBulkOrders(orders); + const { actions } = await seaport.createBulkOrders(orders); // Expect only one approval action for the collection of tokens nftId1-nftId3 expect(actions.filter((a) => a.type === "approval")).to.have.lengthOf(1); @@ -69,7 +69,7 @@ describeWithFixture( identifierOrCriteria: nftId1, itemType: ItemType.ERC721, transactionMethods: approvalAction.transactionMethods, - operator: seaportv12Contract.address, + operator: seaportContract.address, }); await approvalAction.transactionMethods.transact(); @@ -78,7 +78,7 @@ describeWithFixture( expect( await testErc721.isApprovedForAll( offerer.address, - seaportv12Contract.address + seaportContract.address ) ).to.be.true; @@ -133,7 +133,7 @@ describeWithFixture( signature: order.signature, }); - const isValid = await seaportv12Contract + const isValid = await seaportContract .connect(randomSigner) .callStatic.validate([ { diff --git a/src/__tests__/create-order.spec.ts b/src/__tests__/create-order.spec.ts index 2c8c59d4..5af1ae7c 100644 --- a/src/__tests__/create-order.spec.ts +++ b/src/__tests__/create-order.spec.ts @@ -1,7 +1,6 @@ import { expect } from "chai"; import { parseEther } from "ethers/lib/utils"; import { ethers } from "hardhat"; -import { Seaport } from "../seaport"; import { ItemType, MAX_INT, NO_CONDUIT, OrderType } from "../constants"; import { ApprovalAction, CreateOrderAction } from "../types"; import { generateRandomSalt } from "../utils/order"; @@ -514,15 +513,9 @@ describeWithFixture("As a user I want to create an order", (fixture) => { }); it("skips balance and approval validation if consideration config is set to skip on order creation", async () => { - const { seaportContract, testErc721 } = fixture; + const { seaport, seaportContract, testErc721 } = fixture; - const seaport = new Seaport(ethers.provider, { - balanceAndApprovalChecksOnOrderCreation: false, - overrides: { - contractAddress: seaportContract.address, - }, - seaportVersion: "1.1", - }); + (seaport as any).config.balanceAndApprovalChecksOnOrderCreation = false; const [offerer, zone, randomSigner] = await ethers.getSigners(); const nftId = "1"; diff --git a/src/__tests__/utils/setup.ts b/src/__tests__/utils/setup.ts index 8fea0149..6a1c8e70 100644 --- a/src/__tests__/utils/setup.ts +++ b/src/__tests__/utils/setup.ts @@ -16,9 +16,7 @@ chai.use(sinonChai); type Fixture = { seaportContract: SeaportContract; - seaportv12Contract: SeaportContract; seaport: Seaport; - seaportv12: Seaport; domainRegistry: DomainRegistry; testErc721: TestERC721; testErc20: TestERC20; @@ -34,11 +32,7 @@ export const describeWithFixture = ( beforeEach(async () => { const SeaportFactory = await ethers.getContractFactory( - "seaport/contracts/Seaport.sol:Seaport" - ); - - const Seaportv12Factory = await ethers.getContractFactory( - "seaport_v1_4/contracts/Seaport.sol:Seaport" + "seaport_v1_5/contracts/Seaport.sol:Seaport" ); const ConduitControllerFactory = await ethers.getContractFactory( @@ -51,10 +45,6 @@ export const describeWithFixture = ( conduitController.address )) as SeaportContract; - const seaportv12Contract = (await Seaportv12Factory.deploy( - conduitController.address - )) as SeaportContract; - await seaportContract.deployed(); const DomainRegistryFactory = await ethers.getContractFactory( @@ -68,15 +58,7 @@ export const describeWithFixture = ( contractAddress: seaportContract.address, domainRegistryAddress: domainRegistry.address, }, - seaportVersion: "1.1", - }); - - const seaportv12 = new Seaport(ethers.provider, { - overrides: { - contractAddress: seaportv12Contract.address, - domainRegistryAddress: domainRegistry.address, - }, - seaportVersion: "1.4", + seaportVersion: "1.5", }); const TestERC721 = await ethers.getContractFactory("TestERC721"); @@ -94,9 +76,7 @@ export const describeWithFixture = ( // In order for cb to get the correct fixture values we have // to pass a reference to an object that you we mutate. fixture.seaportContract = seaportContract; - fixture.seaportv12Contract = seaportv12Contract; fixture.seaport = seaport; - fixture.seaportv12 = seaportv12; fixture.domainRegistry = domainRegistry; fixture.testErc721 = testErc721; fixture.testErc1155 = testErc1155; diff --git a/src/abi/Seaport.ts b/src/abi/Seaport.ts deleted file mode 100644 index ae6eb747..00000000 --- a/src/abi/Seaport.ts +++ /dev/null @@ -1,2582 +0,0 @@ -const SeaportABI = [ - { - inputs: [ - { - internalType: "address", - name: "conduitController", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "BadContractSignature", - type: "error", - }, - { - inputs: [], - name: "BadFraction", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "BadReturnValueFromERC20OnTransfer", - type: "error", - }, - { - inputs: [ - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - ], - name: "BadSignatureV", - type: "error", - }, - { - inputs: [], - name: "ConsiderationCriteriaResolverOutOfRange", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "considerationIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "shortfallAmount", - type: "uint256", - }, - ], - name: "ConsiderationNotMet", - type: "error", - }, - { - inputs: [], - name: "CriteriaNotEnabledForItem", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256[]", - name: "identifiers", - type: "uint256[]", - }, - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - name: "ERC1155BatchTransferGenericFailure", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "EtherTransferGenericFailure", - type: "error", - }, - { - inputs: [], - name: "InexactFraction", - type: "error", - }, - { - inputs: [], - name: "InsufficientEtherSupplied", - type: "error", - }, - { - inputs: [], - name: "InvalidBasicOrderParameterEncoding", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "conduit", - type: "address", - }, - ], - name: "InvalidCallToConduit", - type: "error", - }, - { - inputs: [], - name: "InvalidCanceller", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "address", - name: "conduit", - type: "address", - }, - ], - name: "InvalidConduit", - type: "error", - }, - { - inputs: [], - name: "InvalidERC721TransferAmount", - type: "error", - }, - { - inputs: [], - name: "InvalidFulfillmentComponentData", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "InvalidMsgValue", - type: "error", - }, - { - inputs: [], - name: "InvalidProof", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - ], - name: "InvalidRestrictedOrder", - type: "error", - }, - { - inputs: [], - name: "InvalidSignature", - type: "error", - }, - { - inputs: [], - name: "InvalidSigner", - type: "error", - }, - { - inputs: [], - name: "InvalidTime", - type: "error", - }, - { - inputs: [], - name: "MismatchedFulfillmentOfferAndConsiderationComponents", - type: "error", - }, - { - inputs: [ - { - internalType: "enum Side", - name: "side", - type: "uint8", - }, - ], - name: "MissingFulfillmentComponentOnAggregation", - type: "error", - }, - { - inputs: [], - name: "MissingItemAmount", - type: "error", - }, - { - inputs: [], - name: "MissingOriginalConsiderationItems", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "NoContract", - type: "error", - }, - { - inputs: [], - name: "NoReentrantCalls", - type: "error", - }, - { - inputs: [], - name: "NoSpecifiedOrdersAvailable", - type: "error", - }, - { - inputs: [], - name: "OfferAndConsiderationRequiredOnFulfillment", - type: "error", - }, - { - inputs: [], - name: "OfferCriteriaResolverOutOfRange", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - ], - name: "OrderAlreadyFilled", - type: "error", - }, - { - inputs: [], - name: "OrderCriteriaResolverOutOfRange", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - ], - name: "OrderIsCancelled", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - ], - name: "OrderPartiallyFilled", - type: "error", - }, - { - inputs: [], - name: "PartialFillsNotEnabledForOrder", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "TokenTransferGenericFailure", - type: "error", - }, - { - inputs: [], - name: "UnresolvedConsiderationCriteria", - type: "error", - }, - { - inputs: [], - name: "UnresolvedOfferCriteria", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "newCounter", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "offerer", - type: "address", - }, - ], - name: "CounterIncremented", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "offerer", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "zone", - type: "address", - }, - ], - name: "OrderCancelled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "offerer", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "zone", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "recipient", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - indexed: false, - internalType: "struct SpentItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - indexed: false, - internalType: "struct ReceivedItem[]", - name: "consideration", - type: "tuple[]", - }, - ], - name: "OrderFulfilled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - indexed: true, - internalType: "address", - name: "offerer", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "zone", - type: "address", - }, - ], - name: "OrderValidated", - type: "event", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "counter", - type: "uint256", - }, - ], - internalType: "struct OrderComponents[]", - name: "orders", - type: "tuple[]", - }, - ], - name: "cancel", - outputs: [ - { - internalType: "bool", - name: "cancelled", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalConsiderationItems", - type: "uint256", - }, - ], - internalType: "struct OrderParameters", - name: "parameters", - type: "tuple", - }, - { - internalType: "uint120", - name: "numerator", - type: "uint120", - }, - { - internalType: "uint120", - name: "denominator", - type: "uint120", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - { - internalType: "bytes", - name: "extraData", - type: "bytes", - }, - ], - internalType: "struct AdvancedOrder", - name: "advancedOrder", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "enum Side", - name: "side", - type: "uint8", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "criteriaProof", - type: "bytes32[]", - }, - ], - internalType: "struct CriteriaResolver[]", - name: "criteriaResolvers", - type: "tuple[]", - }, - { - internalType: "bytes32", - name: "fulfillerConduitKey", - type: "bytes32", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "fulfillAdvancedOrder", - outputs: [ - { - internalType: "bool", - name: "fulfilled", - type: "bool", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalConsiderationItems", - type: "uint256", - }, - ], - internalType: "struct OrderParameters", - name: "parameters", - type: "tuple", - }, - { - internalType: "uint120", - name: "numerator", - type: "uint120", - }, - { - internalType: "uint120", - name: "denominator", - type: "uint120", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - { - internalType: "bytes", - name: "extraData", - type: "bytes", - }, - ], - internalType: "struct AdvancedOrder[]", - name: "advancedOrders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "enum Side", - name: "side", - type: "uint8", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "criteriaProof", - type: "bytes32[]", - }, - ], - internalType: "struct CriteriaResolver[]", - name: "criteriaResolvers", - type: "tuple[]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[][]", - name: "offerFulfillments", - type: "tuple[][]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[][]", - name: "considerationFulfillments", - type: "tuple[][]", - }, - { - internalType: "bytes32", - name: "fulfillerConduitKey", - type: "bytes32", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "maximumFulfilled", - type: "uint256", - }, - ], - name: "fulfillAvailableAdvancedOrders", - outputs: [ - { - internalType: "bool[]", - name: "availableOrders", - type: "bool[]", - }, - { - components: [ - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ReceivedItem", - name: "item", - type: "tuple", - }, - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - ], - internalType: "struct Execution[]", - name: "executions", - type: "tuple[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalConsiderationItems", - type: "uint256", - }, - ], - internalType: "struct OrderParameters", - name: "parameters", - type: "tuple", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - ], - internalType: "struct Order[]", - name: "orders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[][]", - name: "offerFulfillments", - type: "tuple[][]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[][]", - name: "considerationFulfillments", - type: "tuple[][]", - }, - { - internalType: "bytes32", - name: "fulfillerConduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "maximumFulfilled", - type: "uint256", - }, - ], - name: "fulfillAvailableOrders", - outputs: [ - { - internalType: "bool[]", - name: "availableOrders", - type: "bool[]", - }, - { - components: [ - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ReceivedItem", - name: "item", - type: "tuple", - }, - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - ], - internalType: "struct Execution[]", - name: "executions", - type: "tuple[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "considerationToken", - type: "address", - }, - { - internalType: "uint256", - name: "considerationIdentifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "considerationAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - internalType: "address", - name: "offerToken", - type: "address", - }, - { - internalType: "uint256", - name: "offerIdentifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "offerAmount", - type: "uint256", - }, - { - internalType: "enum BasicOrderType", - name: "basicOrderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "offererConduitKey", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "fulfillerConduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalAdditionalRecipients", - type: "uint256", - }, - { - components: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct AdditionalRecipient[]", - name: "additionalRecipients", - type: "tuple[]", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - ], - internalType: "struct BasicOrderParameters", - name: "parameters", - type: "tuple", - }, - ], - name: "fulfillBasicOrder", - outputs: [ - { - internalType: "bool", - name: "fulfilled", - type: "bool", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalConsiderationItems", - type: "uint256", - }, - ], - internalType: "struct OrderParameters", - name: "parameters", - type: "tuple", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - ], - internalType: "struct Order", - name: "order", - type: "tuple", - }, - { - internalType: "bytes32", - name: "fulfillerConduitKey", - type: "bytes32", - }, - ], - name: "fulfillOrder", - outputs: [ - { - internalType: "bool", - name: "fulfilled", - type: "bool", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - ], - name: "getCounter", - outputs: [ - { - internalType: "uint256", - name: "counter", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "counter", - type: "uint256", - }, - ], - internalType: "struct OrderComponents", - name: "order", - type: "tuple", - }, - ], - name: "getOrderHash", - outputs: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - ], - name: "getOrderStatus", - outputs: [ - { - internalType: "bool", - name: "isValidated", - type: "bool", - }, - { - internalType: "bool", - name: "isCancelled", - type: "bool", - }, - { - internalType: "uint256", - name: "totalFilled", - type: "uint256", - }, - { - internalType: "uint256", - name: "totalSize", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "incrementCounter", - outputs: [ - { - internalType: "uint256", - name: "newCounter", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "information", - outputs: [ - { - internalType: "string", - name: "version", - type: "string", - }, - { - internalType: "bytes32", - name: "domainSeparator", - type: "bytes32", - }, - { - internalType: "address", - name: "conduitController", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalConsiderationItems", - type: "uint256", - }, - ], - internalType: "struct OrderParameters", - name: "parameters", - type: "tuple", - }, - { - internalType: "uint120", - name: "numerator", - type: "uint120", - }, - { - internalType: "uint120", - name: "denominator", - type: "uint120", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - { - internalType: "bytes", - name: "extraData", - type: "bytes", - }, - ], - internalType: "struct AdvancedOrder[]", - name: "advancedOrders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "enum Side", - name: "side", - type: "uint8", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "criteriaProof", - type: "bytes32[]", - }, - ], - internalType: "struct CriteriaResolver[]", - name: "criteriaResolvers", - type: "tuple[]", - }, - { - components: [ - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[]", - name: "offerComponents", - type: "tuple[]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[]", - name: "considerationComponents", - type: "tuple[]", - }, - ], - internalType: "struct Fulfillment[]", - name: "fulfillments", - type: "tuple[]", - }, - ], - name: "matchAdvancedOrders", - outputs: [ - { - components: [ - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ReceivedItem", - name: "item", - type: "tuple", - }, - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - ], - internalType: "struct Execution[]", - name: "executions", - type: "tuple[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalConsiderationItems", - type: "uint256", - }, - ], - internalType: "struct OrderParameters", - name: "parameters", - type: "tuple", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - ], - internalType: "struct Order[]", - name: "orders", - type: "tuple[]", - }, - { - components: [ - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[]", - name: "offerComponents", - type: "tuple[]", - }, - { - components: [ - { - internalType: "uint256", - name: "orderIndex", - type: "uint256", - }, - { - internalType: "uint256", - name: "itemIndex", - type: "uint256", - }, - ], - internalType: "struct FulfillmentComponent[]", - name: "considerationComponents", - type: "tuple[]", - }, - ], - internalType: "struct Fulfillment[]", - name: "fulfillments", - type: "tuple[]", - }, - ], - name: "matchOrders", - outputs: [ - { - components: [ - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifier", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ReceivedItem", - name: "item", - type: "tuple", - }, - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - ], - internalType: "struct Execution[]", - name: "executions", - type: "tuple[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "name", - outputs: [ - { - internalType: "string", - name: "contractName", - type: "string", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "offerer", - type: "address", - }, - { - internalType: "address", - name: "zone", - type: "address", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - ], - internalType: "struct OfferItem[]", - name: "offer", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum ItemType", - name: "itemType", - type: "uint8", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "identifierOrCriteria", - type: "uint256", - }, - { - internalType: "uint256", - name: "startAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "endAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ConsiderationItem[]", - name: "consideration", - type: "tuple[]", - }, - { - internalType: "enum OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "bytes32", - name: "zoneHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "salt", - type: "uint256", - }, - { - internalType: "bytes32", - name: "conduitKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "totalOriginalConsiderationItems", - type: "uint256", - }, - ], - internalType: "struct OrderParameters", - name: "parameters", - type: "tuple", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - ], - internalType: "struct Order[]", - name: "orders", - type: "tuple[]", - }, - ], - name: "validate", - outputs: [ - { - internalType: "bool", - name: "validated", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, -]; - -export { SeaportABI }; diff --git a/src/constants.ts b/src/constants.ts index 08796e81..e7c55660 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,8 +1,8 @@ import { BigNumber } from "ethers"; export const SEAPORT_CONTRACT_NAME = "Seaport"; -export const SEAPORT_CONTRACT_VERSION = "1.1"; export const SEAPORT_CONTRACT_VERSION_V1_4 = "1.4"; +export const SEAPORT_CONTRACT_VERSION_V1_5 = "1.5"; export const OPENSEA_CONDUIT_KEY = "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000"; export const OPENSEA_CONDUIT_ADDRESS = @@ -117,11 +117,11 @@ export const KNOWN_CONDUIT_KEYS_TO_CONDUIT = { [OPENSEA_CONDUIT_KEY]: OPENSEA_CONDUIT_ADDRESS, }; -export const CROSS_CHAIN_SEAPORT_ADDRESS = - "0x00000000006c3852cbef3e08e8df289169ede581"; - export const CROSS_CHAIN_SEAPORT_V1_4_ADDRESS = "0x00000000000001ad428e4906aE43D8F9852d0dD6"; +export const CROSS_CHAIN_SEAPORT_V1_5_ADDRESS = + "0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC"; + export const DOMAIN_REGISTRY_ADDRESS = "0x000000000DaD0DE04D2B2D4a5A74581EBA94124A"; diff --git a/src/contracts/Conduit.sol b/src/contracts/Conduit.sol index 00b2603f..4fef1ea4 100644 --- a/src/contracts/Conduit.sol +++ b/src/contracts/Conduit.sol @@ -1,4 +1,4 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.13; -import "seaport/contracts/conduit/Conduit.sol"; +import "seaport_v1_4/contracts/conduit/Conduit.sol"; diff --git a/src/contracts/ConduitController.sol b/src/contracts/ConduitController.sol index 7537408a..5d9b9280 100644 --- a/src/contracts/ConduitController.sol +++ b/src/contracts/ConduitController.sol @@ -1,4 +1,4 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.13; -import "seaport/contracts/conduit/ConduitController.sol"; +import "seaport_v1_4/contracts/conduit/ConduitController.sol"; diff --git a/src/contracts/Seaport.sol b/src/contracts/Seaport.sol deleted file mode 100644 index 366247dc..00000000 --- a/src/contracts/Seaport.sol +++ /dev/null @@ -1,4 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.13; - -import "seaport/contracts/Seaport.sol"; diff --git a/src/contracts/Seaport_v1_5.sol b/src/contracts/Seaport_v1_5.sol new file mode 100644 index 00000000..c4705f69 --- /dev/null +++ b/src/contracts/Seaport_v1_5.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import "seaport_v1_5/contracts/Seaport.sol"; diff --git a/src/seaport.ts b/src/seaport.ts index 3aa19cef..9e037ba4 100644 --- a/src/seaport.ts +++ b/src/seaport.ts @@ -9,21 +9,20 @@ import { } from "ethers"; import { _TypedDataEncoder } from "ethers/lib/utils"; import { DomainRegistryABI } from "./abi/DomainRegistry"; -import { SeaportABI } from "./abi/Seaport"; import { SeaportABIv14 } from "./abi/Seaport_v1_4"; import { SEAPORT_CONTRACT_NAME, - SEAPORT_CONTRACT_VERSION, SEAPORT_CONTRACT_VERSION_V1_4, + SEAPORT_CONTRACT_VERSION_V1_5, EIP_712_ORDER_TYPE, KNOWN_CONDUIT_KEYS_TO_CONDUIT, MAX_INT, NO_CONDUIT, OPENSEA_CONDUIT_KEY, OrderType, - CROSS_CHAIN_SEAPORT_ADDRESS, DOMAIN_REGISTRY_ADDRESS, CROSS_CHAIN_SEAPORT_V1_4_ADDRESS, + CROSS_CHAIN_SEAPORT_V1_5_ADDRESS, } from "./constants"; import type { SeaportConfig, @@ -131,10 +130,10 @@ export class Seaport { this.contract = new Contract( overrides?.contractAddress ?? - (seaportVersion === "1.4" - ? CROSS_CHAIN_SEAPORT_V1_4_ADDRESS - : CROSS_CHAIN_SEAPORT_ADDRESS), - seaportVersion === "1.4" ? SeaportABIv14 : SeaportABI, + (seaportVersion === "1.5" + ? CROSS_CHAIN_SEAPORT_V1_5_ADDRESS + : CROSS_CHAIN_SEAPORT_V1_4_ADDRESS), + SeaportABIv14, this.multicallProvider ) as SeaportContract; @@ -239,12 +238,6 @@ export class Seaport { accountAddress?: string, exactApproval?: boolean ): Promise> { - if (this.config.seaportVersion === "1.1") { - throw new Error( - "Bulk order signatures are only available on Seaport v1.4" - ); - } - const signer = this._getSigner(accountAddress); const offerer = await signer.getAddress(); const offererCounter = await this.getCounter(offerer); @@ -454,9 +447,9 @@ export class Seaport { return { name: SEAPORT_CONTRACT_NAME, version: - this.config.seaportVersion === "1.4" - ? SEAPORT_CONTRACT_VERSION_V1_4 - : SEAPORT_CONTRACT_VERSION, + this.config.seaportVersion === "1.5" + ? SEAPORT_CONTRACT_VERSION_V1_5 + : SEAPORT_CONTRACT_VERSION_V1_4, chainId, verifyingContract: this.contract.address, }; diff --git a/src/types.ts b/src/types.ts index 595133db..0a956776 100644 --- a/src/types.ts +++ b/src/types.ts @@ -29,7 +29,7 @@ export type SeaportConfig = { conduitKeyToConduit?: Record; // The Seaport version to use - seaportVersion?: "1.1" | "1.4"; + seaportVersion?: "1.4" | "1.5"; overrides?: { contractAddress?: string;