Skip to content

Solidity API

PropsERC1155SignatureToCreate

This contract implements signature-based token creation for ERC1155 tokens

Inherits from PropsBaseFacet, ReentrancyGuard, and PropsERC1155SignatureToCreateInternal

init

solidity
function init(address[] _approvedSigners) external

Initializes the contract with approved signers

Can only be called by the diamond owner or factory

Parameters

NameTypeDescription
_approvedSignersaddress[]Array of addresses to be set as approved signers

signatureToCreate

solidity
function signatureToCreate(string _metadata, bytes _signature, address[] _additionalSplits) external payable returns (uint256)

Creates a token using a signature

Non-reentrant function that creates a token for the message sender

Parameters

NameTypeDescription
_metadatastringMetadata for the token
_signaturebytesSignature for token creation
_additionalSplitsaddress[]Additional addresses for revenue splits

Return Values

NameTypeDescription
[0]uint256The index of the newly created token

relaySignatureToCreate

solidity
function relaySignatureToCreate(address _to, string _metadata, bytes _signature, address[] _additionalSplits) external payable returns (uint256)

Relays a signature-based token creation to another address

Non-reentrant function that creates a token for the specified address

Parameters

NameTypeDescription
_toaddressAddress to receive the created token
_metadatastringMetadata for the token
_signaturebytesSignature for token creation
_additionalSplitsaddress[]Additional addresses for revenue splits

Return Values

NameTypeDescription
[0]uint256The index of the newly created token

setApprovedSigners

solidity
function setApprovedSigners(address[] _signers, bool _approved) external

Sets the approval status for multiple signers

Can only be called by an address with SIGNATURE_MANAGER_ROLE or the diamond owner

Parameters

NameTypeDescription
_signersaddress[]Array of signer addresses
_approvedboolApproval status to set

isApprovedSigner

solidity
function isApprovedSigner(address _signer) external view returns (bool)

Checks if an address is an approved signer

Parameters

NameTypeDescription
_signeraddressAddress to check

Return Values

NameTypeDescription
[0]boolBoolean indicating whether the address is an approved signer

calculateSignatureToCreateCost

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

Calculates the cost of creating a specified quantity of tokens

This function is public and view, allowing external calls without state changes

Parameters

NameTypeDescription
_quantityuint256Number of tokens to create

Return Values

NameTypeDescription
[0]uint256The total cost for creating the specified quantity of tokens