Skip to content

Commit

Permalink
Add 1155 permissive minter
Browse files Browse the repository at this point in the history
  • Loading branch information
ScreamingHawk committed Aug 22, 2024
1 parent 86e1efd commit c0f4d96
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/tokens/ERC1155/utility/minter/ERC1155PermissiveMinter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.19;

import {IERC1155ItemsFunctions} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155Items.sol";

/**
* An ERC-1155 contract that allows permissive minting.
*/
contract ERC1155PermissiveMinter {
/**
* Mint tokens.
* @param items The items contract.
* @param to Address to mint tokens to.
* @param tokenId Token ID to mint.
* @param amount Amount of tokens to mint.
* @param data Data to pass if receiver is contract.
*/
function mint(address items, address to, uint256 tokenId, uint256 amount, bytes memory data) external {
IERC1155ItemsFunctions(items).mint(to, tokenId, amount, data);
}

/**
* Batch mint tokens.
* @param items The items contract.
* @param to Address to mint tokens to.
* @param tokenIds Token IDs to mint.
* @param amounts Amounts of tokens to mint.
* @param data Data to pass if receiver is contract.
*/
function batchMint(
address items,
address to,
uint256[] memory tokenIds,
uint256[] memory amounts,
bytes memory data
) external {
IERC1155ItemsFunctions(items).batchMint(to, tokenIds, amounts, data);
}
}

0 comments on commit c0f4d96

Please sign in to comment.