Appearance
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) externalInitializes the contract with approved signers
Can only be called by the diamond owner or factory
Parameters
| Name | Type | Description |
|---|---|---|
| _approvedSigners | address[] | 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
| Name | Type | Description |
|---|---|---|
| _metadata | string | Metadata for the token |
| _signature | bytes | Signature for token creation |
| _additionalSplits | address[] | Additional addresses for revenue splits |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The 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
| Name | Type | Description |
|---|---|---|
| _to | address | Address to receive the created token |
| _metadata | string | Metadata for the token |
| _signature | bytes | Signature for token creation |
| _additionalSplits | address[] | Additional addresses for revenue splits |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The index of the newly created token |
setApprovedSigners
solidity
function setApprovedSigners(address[] _signers, bool _approved) externalSets the approval status for multiple signers
Can only be called by an address with SIGNATURE_MANAGER_ROLE or the diamond owner
Parameters
| Name | Type | Description |
|---|---|---|
| _signers | address[] | Array of signer addresses |
| _approved | bool | Approval status to set |
isApprovedSigner
solidity
function isApprovedSigner(address _signer) external view returns (bool)Checks if an address is an approved signer
Parameters
| Name | Type | Description |
|---|---|---|
| _signer | address | Address to check |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | Boolean 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
| Name | Type | Description |
|---|---|---|
| _quantity | uint256 | Number of tokens to create |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The total cost for creating the specified quantity of tokens |