Skip to content

Solidity API

IPropsERC1155CreatorSplits

Interface for ERC1155 token with creator splits functionality

This interface defines functions and events related to minting and setting creator/referral splits

Mint

solidity
event Mint(address to, uint256[] tokenId, uint256[] quantity, uint256 totalFee, address[] recipients, uint256[] feeAmounts)

Event emitted when tokens are minted with creator splits

Parameters

NameTypeDescription
toaddressThe address receiving the minted tokens
tokenIduint256[]An array of token IDs being minted
quantityuint256[]An array of quantities for each token ID being minted
totalFeeuint256The total fee collected for this mint operation
recipientsaddress[]An array of addresses receiving a portion of the fee
feeAmountsuint256[]An array of fee amounts corresponding to each recipient

CreatorSplitSet

solidity
event CreatorSplitSet(uint256 creatorSplitBips)

Event emitted when the creator split percentage is set or updated

Parameters

NameTypeDescription
creatorSplitBipsuint256The new creator split in basis points (1/100th of a percent)

ReferralSplitSet

solidity
event ReferralSplitSet(uint256 referralSplitBips)

Event emitted when the referral split percentage is set or updated

Parameters

NameTypeDescription
referralSplitBipsuint256The new referral split in basis points (1/100th of a percent)

init

solidity
function init(uint256 creatorSplitBips, uint256 referralSplitBips) external

Initializes the contract with creator and referral split percentages

Parameters

NameTypeDescription
creatorSplitBipsuint256Creator split percentage in basis points (1/100 of a percent)
referralSplitBipsuint256Referral split percentage in basis points

mint

solidity
function mint(address _to, uint256 _tokenId, uint256 _quantity) external payable

Mints a single token type

Parameters

NameTypeDescription
_toaddressAddress to mint the tokens to
_tokenIduint256ID of the token to mint
_quantityuint256Number of tokens to mint

relayMint

solidity
function relayMint(address _to, uint256 _tokenId, uint256 _quantity) external payable

Allows an approved relay to mint a single token type

Parameters

NameTypeDescription
_toaddressAddress to mint the tokens to
_tokenIduint256ID of the token to mint
_quantityuint256Number of tokens to mint

mintBatch

solidity
function mintBatch(address _to, uint256[] _tokenId, uint256[] _quantity) external payable

Mints multiple token types in a single transaction

Parameters

NameTypeDescription
_toaddressAddress to mint the tokens to
_tokenIduint256[]Array of token IDs to mint
_quantityuint256[]Array of quantities for each token ID

relayMintBatch

solidity
function relayMintBatch(address _to, string _tokenIds, string _quantities, uint256 _totalQuantity) external payable

Allows an approved relay to mint multiple token types in a single transaction

Parameters

NameTypeDescription
_toaddressAddress to mint the tokens to
_tokenIdsstringComma-separated string of token IDs to mint
_quantitiesstringComma-separated string of quantities for each token ID
_totalQuantityuint256Total quantity of tokens being minted

calculateMintCost

solidity
function calculateMintCost(uint256[] _tokenId, uint256[] _quantity) external view returns (uint256)

Calculates the total cost to mint multiple token types

Parameters

NameTypeDescription
_tokenIduint256[]Array of token IDs to mint
_quantityuint256[]Array of quantities for each token ID

Return Values

NameTypeDescription
[0]uint256Total cost to mint the specified tokens

setCreatorSplit

solidity
function setCreatorSplit(uint256 creatorSplitBips) external

Sets the creator split percentage

Parameters

NameTypeDescription
creatorSplitBipsuint256New creator split percentage in basis points

setReferralSplit

solidity
function setReferralSplit(uint256 referralSplitBips) external

Sets the referral split percentage

Parameters

NameTypeDescription
referralSplitBipsuint256New referral split percentage in basis points