Skip to content

Commit

Permalink
Verify bundle seller in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-turek committed Oct 4, 2024
1 parent 90ee70f commit 27378d1
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/marketplace/contracts/TransferManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,7 @@ abstract contract TransferManager is Initializable, ITransferManager {

remainder = _processERC721Bundles(paymentSide, nftSide, nftSideRecipient, remainder, feePrimary, bundle);
remainder = _processERC1155Bundles(paymentSide, nftSide, nftSideRecipient, remainder, feePrimary, bundle);
uint256 quadSize = bundle.quads.xs.length;
if (quadSize > 0) {
require(_isTSBSecondaryMarketSeller(nftSide.account), "not TSB secondary market seller");
remainder = _processQuadBundles(paymentSide, nftSideRecipient, remainder, feePrimary, quadSize, bundle);
}
remainder = _processQuadBundles(paymentSide, nftSide, nftSideRecipient, remainder, feePrimary, bundle);
return remainder;
}

Expand Down Expand Up @@ -338,26 +334,28 @@ abstract contract TransferManager is Initializable, ITransferManager {

function _processQuadBundles(
DealSide memory paymentSide,
DealSide memory nftSide,
address nftSideRecipient,
uint256 remainder,
uint256 feePrimary,
uint256 quadSize,
LibAsset.Bundle memory bundle
) internal returns (uint256) {
uint256 quadSize = bundle.quads.xs.length;
for (uint256 i = 0; i < quadSize; ++i) {
uint256 size = bundle.quads.sizes[i];
uint256 x = bundle.quads.xs[i];
uint256 y = bundle.quads.ys[i];

uint256 tokenId = idInPath(0, size, x, y);
remainder = _transferFeesAndRoyaltiesForBundledAsset(
remainder = _processSingleAsset(
paymentSide,
address(landContract),
nftSide,
nftSideRecipient,
remainder,
feePrimary,
address(landContract),
tokenId,
bundle.priceDistribution.quadPrices[i],
feePrimary
bundle.priceDistribution.quadPrices[i]
);
}
return remainder;
Expand Down

1 comment on commit 27378d1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

98.26%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/marketplace/contracts
   Exchange.sol94.67%93.33%94.74%96.15%131, 206, 77
   ExchangeCore.sol97.75%93.75%100%100%200, 82
   OrderValidator.sol98.48%96.15%100%100%37
   RoyaltiesRegistry.sol96.35%88.89%100%98.80%196, 218–219, 265, 66
   TransferManager.sol96.09%87.80%100%99.42%164, 226, 248, 315, 375, 413, 564, 569, 580, 602, 94
   Whitelist.sol76.19%60%85.71%82.76%106, 110–111, 125, 128, 144–145, 56, 68, 68–69, 73, 78
packages/marketplace/contracts/interfaces
   IOrderValidator.sol100%100%100%100%
   IRoyaltiesProvider.sol100%100%100%100%
   ITransferManager.sol100%100%100%100%
   IWhitelist.sol100%100%100%100%
packages/marketplace/contracts/libraries
   LibAsset.sol97.47%92.31%100%100%86, 88
   LibMath.sol100%100%100%100%
   LibOrder.sol100%100%100%100%

Please sign in to comment.