Appearance
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 payableAllows a user to pay to create a new token
This function is payable and protected against reentrancy
Parameters
| Name | Type | Description |
|---|---|---|
| _metadata | string | The metadata URI for the new token |
| _additionalSplits | address[] | Additional addresses to receive a split of the payment |
relayPayToCreate
solidity
function relayPayToCreate(address _to, string _metadata, address[] _additionalSplits) external payableAllows a user to pay to create a new token on behalf of another address
This function is payable and protected against reentrancy
Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | The address that will own the new token |
| _metadata | string | The metadata URI for the new token |
| _additionalSplits | address[] | 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
| Name | Type | Description |
|---|---|---|
| _quantity | uint256 | The number of tokens to create |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The total cost in wei |