Skip to content

Commit

Permalink
Merge pull request #161 from G7DAO/feat/update-admin-batch
Browse files Browse the repository at this point in the history
Fix: Update adminBatchMintByIds on Upgradeable contract
  • Loading branch information
vasinl124 authored Oct 16, 2024
2 parents 0cf32d6 + 72d3a2f commit d6711da
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions contracts/upgradeables/soulbounds/ERC1155RoyaltiesSoulboundV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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]);
}
}

Expand Down

0 comments on commit d6711da

Please sign in to comment.