Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 1155 permissive minter #16

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
Loading