Skip to content

Commit

Permalink
SC-24 ERC1155TL (#48)
Browse files Browse the repository at this point in the history
ERC1155TL revamped and tested
  • Loading branch information
mpeyfuss authored Jan 5, 2024
2 parents 992c0e9 + 2f903db commit 2c620a4
Show file tree
Hide file tree
Showing 4 changed files with 1,433 additions and 1,165 deletions.
10 changes: 5 additions & 5 deletions src/erc-1155/ERC1155TL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ contract ERC1155TL is
onlyRoleOrOwner(ADMIN_ROLE)
{
if (newUris.length == 0) revert EmptyTokenURI();
if (newUris.length != addresses.length && addresses.length != amounts.length) revert ArrayLengthMismatch();
if (newUris.length != addresses.length || addresses.length != amounts.length) revert ArrayLengthMismatch();
for (uint256 i = 0; i < newUris.length; i++) {
_createToken(newUris[i], addresses[i], amounts[i]);
}
Expand All @@ -206,8 +206,8 @@ contract ERC1155TL is
) external onlyRoleOrOwner(ADMIN_ROLE) {
if (newUris.length == 0) revert EmptyTokenURI();
if (
newUris.length != addresses.length && addresses.length != amounts.length
&& amounts.length != royaltyAddresses.length && royaltyAddresses.length != royaltyPercents.length
newUris.length != addresses.length || addresses.length != amounts.length
|| amounts.length != royaltyAddresses.length || royaltyAddresses.length != royaltyPercents.length
) revert ArrayLengthMismatch();
for (uint256 i = 0; i < newUris.length; i++) {
uint256 tokenId = _createToken(newUris[i], addresses[i], amounts[i]);
Expand Down Expand Up @@ -251,12 +251,12 @@ contract ERC1155TL is
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ICreatorBase
function setDefaultRoyalty(address newRecipient, uint256 newPercentage) external onlyOwner {
function setDefaultRoyalty(address newRecipient, uint256 newPercentage) external onlyRoleOrOwner(ADMIN_ROLE) {
_setDefaultRoyaltyInfo(newRecipient, newPercentage);
}

/// @inheritdoc ICreatorBase
function setTokenRoyalty(uint256 tokenId, address newRecipient, uint256 newPercentage) external onlyOwner {
function setTokenRoyalty(uint256 tokenId, address newRecipient, uint256 newPercentage) external onlyRoleOrOwner(ADMIN_ROLE) {
_overrideTokenRoyaltyInfo(tokenId, newRecipient, newPercentage);
}

Expand Down
2 changes: 1 addition & 1 deletion src/erc-1155/IERC1155TL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.22;

/// @title IERC1155TL.sol
/// @notice Interface for ERC1155TL
/// @dev Interface id =
/// @dev Interface id = 0x452d5a4a
/// @author transientlabs.xyz
/// @custom:version 3.0.0
interface IERC1155TL {
Expand Down
Loading

0 comments on commit 2c620a4

Please sign in to comment.