Skip to content

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) external

Initializes the contract with burn-to-create parameters

Can only be called by the diamond owner or factory

Parameters

NameTypeDescription
_numBurnTokensRequireduint256The number of tokens required to be burned
_burnTokenIndexuint256The index of the token to be burned

burnToCreate

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

Allows a user to burn tokens and create a new token

Uses nonReentrant modifier to prevent reentrancy attacks

Parameters

NameTypeDescription
_metadatastringThe metadata for the new token
_additionalSplitsaddress[]

relayBurnToCreate

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

Allows a user to burn tokens and create a new token for another address

Uses nonReentrant modifier to prevent reentrancy attacks

Parameters

NameTypeDescription
_toaddressThe address to receive the new token
_metadatastringThe metadata for the new token
_additionalSplitsaddress[]