Appearance
Solidity API
PropsERC1155BurnToCreate
A contract that implements a "burn to create" mechanism for ERC1155 tokens
Inherits from PropsBaseFacet, ReentrancyGuard, PropsERC1155BurnToCreateInternal, and IPropsERC1155BurnToCreate
init
solidity
function init(uint256 _numBurnTokensRequired, uint256 _burnTokenIndex) externalInitializes the contract with burn-to-create parameters
Can only be called by the diamond owner or factory
Parameters
| Name | Type | Description |
|---|---|---|
| _numBurnTokensRequired | uint256 | The number of tokens required to be burned |
| _burnTokenIndex | uint256 | The index of the token to be burned |
burnToCreate
solidity
function burnToCreate(string _metadata, address[] _additionalSplits) external payableAllows a user to burn tokens and create a new token
Uses nonReentrant modifier to prevent reentrancy attacks
Parameters
| Name | Type | Description |
|---|---|---|
| _metadata | string | The metadata for the new token |
| _additionalSplits | address[] |
relayBurnToCreate
solidity
function relayBurnToCreate(address _to, string _metadata, address[] _additionalSplits) external payableAllows a user to burn tokens and create a new token for another address
Uses nonReentrant modifier to prevent reentrancy attacks
Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | The address to receive the new token |
| _metadata | string | The metadata for the new token |
| _additionalSplits | address[] |