Skip to content

Solidity API

PropsERC1155PayToCreateInternal

Internal contract for ERC1155 token with burn-to-create functionality

Inherits from multiple contracts to combine various functionalities

_executePayToCreate

solidity
function _executePayToCreate(address _to, string _metadata, address[] _additionalSplits) internal returns (uint256 totalFee, address[] recipients, uint256[] feeAmounts)

Executes the pay-to-create process

Creates a new token for a fee, and mints it to the recipient

Parameters

NameTypeDescription
_toaddressAddress to receive the newly created token
_metadatastringMetadata for the new token
_additionalSplitsaddress[]

_currentTokenIndex

solidity
function _currentTokenIndex() internal view returns (uint256)

Gets the current token index

Return Values

NameTypeDescription
[0]uint256The current token index

_calculateCost

solidity
function _calculateCost(uint256 _quantity) internal view returns (uint256 totalCost)

Calculates the total cost for creating a specific quantity of tokens

Parameters

NameTypeDescription
_quantityuint256The number of tokens to create

Return Values

NameTypeDescription
totalCostuint256The total cost for creating the specified quantity of tokens

_setTokenRoyaltyIfAvailable

solidity
function _setTokenRoyaltyIfAvailable(uint256 tokenId, address receiver) internal

Sets the royalty for a token if the function exists using the _getDefaultRoyaltyBips function

Parameters

NameTypeDescription
tokenIduint256The ID of the token to set the royalty for
receiveraddressThe address to receive royalties