From 28ceac94eee21b2e641ebdef6821f53362f91aba Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Mon, 16 Sep 2024 16:50:45 +0200 Subject: [PATCH] Add named parameter --- .../marketplace/contracts/TransferManager.sol | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/marketplace/contracts/TransferManager.sol b/packages/marketplace/contracts/TransferManager.sol index a28005efdd..ff3cc76ad5 100644 --- a/packages/marketplace/contracts/TransferManager.sol +++ b/packages/marketplace/contracts/TransferManager.sol @@ -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, @@ -315,7 +316,7 @@ abstract contract TransferManager is Initializable, ITransferManager { ); } } - return remainder; + return remainingValue; } function _processERC1155Bundles( @@ -326,7 +327,8 @@ 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; @@ -334,11 +336,11 @@ abstract contract TransferManager is Initializable, ITransferManager { 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, @@ -348,7 +350,7 @@ abstract contract TransferManager is Initializable, ITransferManager { } } } - return remainder; + return remainingValue; } function _processQuadBundles(