Skip to content

Commit b0f62df

Browse files
committed
fix: looksrare & blur adapter recipient
Signed-off-by: GopherJ <[email protected]>
1 parent c1a2738 commit b0f62df

File tree

5 files changed

+16
-19
lines changed

5 files changed

+16
-19
lines changed

contracts/misc/marketplaces/BlurAdapter.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ contract BlurAdapter is IMarketplace {
6767
itemType,
6868
token,
6969
0,
70-
sell.order.price,
71-
sell.order.price,
72-
payable(buy.order.trader)
70+
buy.order.price,
71+
buy.order.price,
72+
payable(sell.order.trader)
7373
);
7474
orderInfo.id = abi.encodePacked(sell.r, sell.s, sell.v);
7575
orderInfo.consideration = consideration;

contracts/misc/marketplaces/LooksRareAdapter.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ contract LooksRareAdapter is IMarketplace {
6969
itemType,
7070
token,
7171
0,
72-
makerAsk.price, // TODO: take minPercentageToAsk into account
73-
makerAsk.price,
74-
payable(takerBid.taker)
72+
takerBid.price, // TODO: take minPercentageToAsk into account
73+
takerBid.price,
74+
payable(makerAsk.signer)
7575
);
7676
orderInfo.id = abi.encodePacked(makerAsk.r, makerAsk.s, makerAsk.v);
7777
orderInfo.consideration = consideration;

test/_pool_marketplace_accept_bid_with_credit.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,8 @@ describe("Leveraged Bid - unit tests", () => {
13151315
creditAmount,
13161316
nftId,
13171317
maker,
1318-
taker
1318+
taker,
1319+
true
13191320
);
13201321
const usdcConfigData = BigNumber.from(
13211322
(await pool.getUserConfiguration(taker.address)).data

test/_pool_marketplace_buy_with_credit.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,8 @@ describe("Leveraged Buy - Positive tests", () => {
15111511
creditAmount,
15121512
nftId,
15131513
maker,
1514-
taker
1514+
taker,
1515+
true
15151516
);
15161517

15171518
const usdcConfigData = BigNumber.from(

test/helpers/marketplace-helper.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export async function executeSeaportBuyWithCredit(
304304
nftId: number,
305305
maker: SignerWithAddress,
306306
taker: SignerWithAddress,
307-
_sellOrderStartAmount = 1
307+
isCollateralSwap = false
308308
) {
309309
// approve
310310
await waitForTx(
@@ -316,13 +316,7 @@ export async function executeSeaportBuyWithCredit(
316316
const seaport = await getSeaport();
317317
const getSellOrder = async (): Promise<AdvancedOrder> => {
318318
const offers = [
319-
getOfferOrConsiderationItem(
320-
2,
321-
tokenToBuy.address,
322-
nftId,
323-
_sellOrderStartAmount,
324-
_sellOrderStartAmount
325-
),
319+
getOfferOrConsiderationItem(2, tokenToBuy.address, nftId, 1, 1),
326320
];
327321

328322
const considerations = [
@@ -332,7 +326,7 @@ export async function executeSeaportBuyWithCredit(
332326
nftId,
333327
startAmount,
334328
endAmount,
335-
maker.address
329+
isCollateralSwap ? pool.address : maker.address
336330
),
337331
];
338332

@@ -382,7 +376,8 @@ export async function executeAcceptBidWithCredit(
382376
payLaterAmount: BigNumberish,
383377
nftId: number,
384378
maker: SignerWithAddress,
385-
taker: SignerWithAddress
379+
taker: SignerWithAddress,
380+
isCollateralSwap = false
386381
) {
387382
const pool = await getPoolProxy();
388383
const seaport = await getSeaport();
@@ -451,7 +446,7 @@ export async function executeAcceptBidWithCredit(
451446
toBN(0),
452447
startAmount,
453448
endAmount,
454-
taker.address
449+
isCollateralSwap ? pool.address : taker.address
455450
),
456451
];
457452

0 commit comments

Comments
 (0)