-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86e1efd
commit c0f4d96
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/tokens/ERC1155/utility/minter/ERC1155PermissiveMinter.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |