Skip to content

Solidity API

PropsERC1155PayToCreate

This contract implements a pay-to-create mechanism for ERC1155 tokens

Inherits from PropsBaseFacet, ReentrancyGuard, PropsERC1155PayToCreateInternal, and IPropsERC1155PayToCreate

payToCreate

solidity
function payToCreate(string _metadata, address[] _additionalSplits) external payable

Allows a user to pay to create a new token

This function is payable and protected against reentrancy

Parameters

NameTypeDescription
_metadatastringThe metadata URI for the new token
_additionalSplitsaddress[]Additional addresses to receive a split of the payment

relayPayToCreate

solidity
function relayPayToCreate(address _to, string _metadata, address[] _additionalSplits) external payable

Allows a user to pay to create a new token on behalf of another address

This function is payable and protected against reentrancy

Parameters

NameTypeDescription
_toaddressThe address that will own the new token
_metadatastringThe metadata URI for the new token
_additionalSplitsaddress[]Additional addresses to receive a split of the payment

calculatePayToCreateCost

solidity
function calculatePayToCreateCost(uint256 _quantity) public view returns (uint256)

Calculates the cost to create a specified quantity of tokens

This function is view and can be called without a transaction

Parameters

NameTypeDescription
_quantityuint256The number of tokens to create

Return Values

NameTypeDescription
[0]uint256The total cost in wei