Skip to content

Commit

Permalink
Add named parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-turek committed Sep 16, 2024
1 parent 2cd712d commit 28ceac9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/marketplace/contracts/TransferManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,17 @@ abstract contract TransferManager is Initializable, ITransferManager {
uint256 feePrimary,
uint256 feeSecondary,
LibAsset.Bundle memory bundle
) internal returns (uint256) {
) internal returns (uint256 remainingValue) {
remainingValue = remainder;
for (uint256 i; i < bundle.bundledERC721.length; i++) {
address token = bundle.bundledERC721[i].erc721Address;
uint256 idLength = bundle.bundledERC721[i].ids.length;
for (uint256 j; j < idLength; j++) {
remainder = _processSingleAsset(
remainingValue = _processSingleAsset(
paymentSide,
nftSide,
nftSideRecipient,
remainder,
remainingValue,
feePrimary,
feeSecondary,
token,
Expand All @@ -315,7 +316,7 @@ abstract contract TransferManager is Initializable, ITransferManager {
);
}
}
return remainder;
return remainingValue;
}

function _processERC1155Bundles(
Expand All @@ -326,19 +327,20 @@ abstract contract TransferManager is Initializable, ITransferManager {
uint256 feePrimary,
uint256 feeSecondary,
LibAsset.Bundle memory bundle
) internal returns (uint256) {
) internal returns (uint256 remainingValue) {
remainingValue = remainder;
for (uint256 i; i < bundle.bundledERC1155.length; i++) {
address token = bundle.bundledERC1155[i].erc1155Address;
uint256 idLength = bundle.bundledERC1155[i].ids.length;
require(idLength == bundle.bundledERC1155[i].supplies.length, "ERC1155 array error");

for (uint256 j; j < idLength; j++) {
for (uint256 k = 0; k < nftSide.asset.value; k++) {
remainder = _processSingleAsset(
remainingValue = _processSingleAsset(
paymentSide,
nftSide,
nftSideRecipient,
remainder,
remainingValue,
feePrimary,
feeSecondary,
token,
Expand All @@ -348,7 +350,7 @@ abstract contract TransferManager is Initializable, ITransferManager {
}
}
}
return remainder;
return remainingValue;
}

function _processQuadBundles(
Expand Down

1 comment on commit 28ceac9

@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.23%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/marketplace/contracts
   Exchange.sol94.52%93.33%94.44%96%126, 194, 72
   ExchangeCore.sol98.84%96.67%100%100%85
   OrderValidator.sol98.44%96.15%100%100%36
   RoyaltiesRegistry.sol96.32%88.89%100%98.78%194, 216–217, 263, 65
   TransferManager.sol95.45%85.71%100%99.43%163, 225, 247, 335, 395, 432, 582, 587, 598, 610–611, 622, 93
   Whitelist.sol75.81%60%85.71%82.14%104, 108–109, 122, 125, 141–142, 54, 66, 66–67, 71, 76
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.sol100%100%100%100%
   LibMath.sol100%100%100%100%
   LibOrder.sol100%100%100%100%

Please sign in to comment.