Appearance
Solidity API
PropsERC1155CreatorSplits
This contract implements minting functionality for ERC1155 tokens with creator and referral splits
init
solidity
function init(uint256 creatorSplitBips, uint256 referralSplitBips) externalInitializes the contract with creator and referral split percentages
Parameters
| Name | Type | Description |
|---|---|---|
| creatorSplitBips | uint256 | Creator split percentage in basis points (1/100 of a percent) |
| referralSplitBips | uint256 | Referral split percentage in basis points |
mint
solidity
function mint(address _to, uint256 _tokenId, uint256 _quantity) public payableMints a single token type
Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | Address to mint the tokens to |
| _tokenId | uint256 | ID of the token to mint |
| _quantity | uint256 | Number of tokens to mint |
relayMint
solidity
function relayMint(address _to, uint256 _tokenId, uint256 _quantity) public payableAllows an approved relay to mint a single token type
Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | Address to mint the tokens to |
| _tokenId | uint256 | ID of the token to mint |
| _quantity | uint256 | Number of tokens to mint |
mintBatch
solidity
function mintBatch(address _to, uint256[] _tokenId, uint256[] _quantity) public payableMints multiple token types in a single transaction
Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | Address to mint the tokens to |
| _tokenId | uint256[] | Array of token IDs to mint |
| _quantity | uint256[] | Array of quantities for each token ID |
relayMintBatch
solidity
function relayMintBatch(address _to, string _tokenIds, string _quantities, uint256 _totalQuantity) public payableAllows an approved relay to mint multiple token types in a single transaction
Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | Address to mint the tokens to |
| _tokenIds | string | Comma-separated string of token IDs to mint |
| _quantities | string | Comma-separated string of quantities for each token ID |
| _totalQuantity | uint256 |
calculateMintCost
solidity
function calculateMintCost(uint256[] _tokenId, uint256[] _quantity) public view returns (uint256)Calculates the total cost to mint multiple token types
Parameters
| Name | Type | Description |
|---|---|---|
| _tokenId | uint256[] | Array of token IDs to mint |
| _quantity | uint256[] | Array of quantities for each token ID |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Total cost to mint the specified tokens |
setCreatorSplit
solidity
function setCreatorSplit(uint256 creatorSplitBips) externalSets the creator split percentage
Parameters
| Name | Type | Description |
|---|---|---|
| creatorSplitBips | uint256 | New creator split percentage in basis points |
setReferralSplit
solidity
function setReferralSplit(uint256 referralSplitBips) externalSets the referral split percentage
Parameters
| Name | Type | Description |
|---|---|---|
| referralSplitBips | uint256 | New referral split percentage in basis points |