From 72d3a2f77420dd0f7ba02d13af5a61bbe7dbefdb Mon Sep 17 00:00:00 2001 From: Max Vasin Limsukhawat Date: Wed, 16 Oct 2024 12:48:26 -0600 Subject: [PATCH] Fix: Update adminBatchMintByIds on Upgradeable contract --- .../soulbounds/ERC1155RoyaltiesSoulboundV2.sol | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/contracts/upgradeables/soulbounds/ERC1155RoyaltiesSoulboundV2.sol b/contracts/upgradeables/soulbounds/ERC1155RoyaltiesSoulboundV2.sol index ccf5a1d..a1e874f 100644 --- a/contracts/upgradeables/soulbounds/ERC1155RoyaltiesSoulboundV2.sol +++ b/contracts/upgradeables/soulbounds/ERC1155RoyaltiesSoulboundV2.sol @@ -384,8 +384,16 @@ contract ERC1155RoyaltiesSoulboundV2 is address to, uint256[] memory tokenIds, uint256[] memory amounts, - bool soulbound + bool[] memory soulbounds ) external onlyRole(MINTER_ROLE) whenNotPaused { + if (tokenIds.length != amounts.length) { + revert("InvalidInput"); + } + + if (tokenIds.length != soulbounds.length) { + revert("InvalidInput"); + } + for (uint256 i = 0; i < tokenIds.length; i++) { uint256 _id = tokenIds[i]; uint256 _amount = amounts[i]; @@ -394,12 +402,12 @@ contract ERC1155RoyaltiesSoulboundV2 is revert("TokenMintPaused"); } - if (soulbound) { + if (soulbounds[i]) { _soulbound(to, _id, _amount); } _mint(to, _id, _amount, ""); - emit MintedId(to, _id, _amount, soulbound); + emit MintedId(to, _id, _amount, soulbounds[i]); } }