diff --git a/src/seaport.ts b/src/seaport.ts index ba16b1ef..c8682776 100644 --- a/src/seaport.ts +++ b/src/seaport.ts @@ -780,6 +780,7 @@ export class Seaport { * Defaults to the zero address which means the offer goes to the fulfiller * @param input.domain optional domain to be hashed and appended to calldata * @param input.exactApproval optional boolean to indicate whether the approval should be exact or not + * @param input.overrides any overrides the client wants, will ignore value * @returns a use case containing the set of approval actions and fulfillment action */ public async fulfillOrder({ @@ -794,6 +795,7 @@ export class Seaport { recipientAddress = ethers.constants.AddressZero, domain, exactApproval = false, + overrides, }: { order: OrderWithCounter; unitsToFill?: BigNumberish; @@ -806,6 +808,7 @@ export class Seaport { recipientAddress?: string; domain?: string; exactApproval?: boolean; + overrides?: PayableOverrides; }): Promise< OrderUseCase< ExchangeAction< @@ -903,6 +906,7 @@ export class Seaport { signer: fulfiller, tips: tipConsiderationItems, domain, + overrides, }, exactApproval, ); @@ -931,6 +935,7 @@ export class Seaport { fulfillerOperator, recipientAddress, domain, + overrides, }, exactApproval, ); diff --git a/src/utils/fulfill.ts b/src/utils/fulfill.ts index 93fe846c..7a736222 100644 --- a/src/utils/fulfill.ts +++ b/src/utils/fulfill.ts @@ -3,6 +3,7 @@ import { BigNumberish, ContractTransaction, ethers, + PayableOverrides, Signer, } from "ethers"; import type { @@ -191,6 +192,7 @@ export function fulfillBasicOrder( tips = [], conduitKey = NO_CONDUIT, domain, + overrides, }: { order: Order; seaportContract: Seaport; @@ -203,6 +205,7 @@ export function fulfillBasicOrder( tips?: ConsiderationItem[]; conduitKey: string; domain?: string; + overrides?: PayableOverrides; }, exactApproval: boolean, ): OrderUseCase< @@ -281,7 +284,7 @@ export function fulfillBasicOrder( zoneHash: order.parameters.zoneHash, }; - const payableOverrides = { value: totalNativeAmount }; + const payableOverrides = { ...overrides, value: totalNativeAmount }; const approvalActions = getApprovalActions( insufficientApprovals, @@ -328,6 +331,7 @@ export function fulfillStandardOrder( recipientAddress, signer, domain, + overrides, }: { order: Order; unitsToFill?: BigNumberish; @@ -347,6 +351,7 @@ export function fulfillStandardOrder( timeBasedItemParams: TimeBasedItemParams; signer: Signer; domain?: string; + overrides?: PayableOverrides; }, exactApproval: boolean, ): OrderUseCase< @@ -417,7 +422,7 @@ export function fulfillStandardOrder( fulfillerOperator, }); - const payableOverrides = { value: totalNativeAmount }; + const payableOverrides = { ...overrides, value: totalNativeAmount }; const approvalActions = getApprovalActions( insufficientApprovals, diff --git a/test/basic-fulfill.spec.ts b/test/basic-fulfill.spec.ts index 0e80ef77..306d61a4 100644 --- a/test/basic-fulfill.spec.ts +++ b/test/basic-fulfill.spec.ts @@ -28,6 +28,7 @@ describeWithFixture( const nftId = "1"; const erc1155Amount = "3"; const OPENSEA_DOMAIN = "opensea.io"; + const overrideGasLimit = 10_000_000; beforeEach(async () => { fulfillBasicOrderSpy = sinon.spy(fulfill, "fulfillBasicOrder"); @@ -206,6 +207,7 @@ describeWithFixture( order, accountAddress: fulfiller.address, domain: OPENSEA_DOMAIN, + overrides: { gasLimit: overrideGasLimit }, }); const approvalAction = actions[0]; @@ -248,6 +250,7 @@ describeWithFixture( fulfillReceipt: receipt, }); expect(fulfillBasicOrderSpy).calledOnce; + expect(transaction.gasLimit).equal(overrideGasLimit); }); it("ERC721 <=> ERC20 (already validated order)", async () => {