Appearance
Solidity API
PropsERC1155SignatureToCreateInternal
This contract implements the internal logic for creating ERC1155 tokens using a signature-based approach. It handles token creation, fee calculation, metadata management, and creator splits.
_executeSignatureToCreate
solidity
function _executeSignatureToCreate(address _to, string _metadata, bytes _signature, address[] _additionalSplits) internal returns (uint256 totalFee, address[] recipients, uint256[] feeAmounts)Executes the signature-based token creation process
Parameters
| Name | Type | Description |
|---|---|---|
| _to | address | The address to receive the newly created token |
| _metadata | string | The metadata for the new token |
| _signature | bytes | The signature to validate the creation request |
| _additionalSplits | address[] | Additional addresses to receive a split of the creator fee |
Return Values
| Name | Type | Description |
|---|---|---|
| totalFee | uint256 | The total fee charged for the token creation |
| recipients | address[] | The addresses receiving portions of the fee |
| feeAmounts | uint256[] | The amounts each recipient receives |
_upsertMetadataAndSplit
solidity
function _upsertMetadataAndSplit(uint256 _index, string _metadata, address _to) internalUpserts the metadata and split for a specific token
Parameters
| Name | Type | Description |
|---|---|---|
| _index | uint256 | The index of the token |
| _metadata | string | The metadata for the token |
| _to | address | The address to receive the token |
_currentTokenIndex
solidity
function _currentTokenIndex() internal view returns (uint256)Returns the current token index
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The current token index |
_setApprovedSigner
solidity
function _setApprovedSigner(address _signer, bool _approved) internalSets the approval status of a signer
Parameters
| Name | Type | Description |
|---|---|---|
| _signer | address | The address of the signer |
| _approved | bool | The approval status to set |
_isApprovedSigner
solidity
function _isApprovedSigner(address _signer) internal view returns (bool)Checks if a signer is approved
Parameters
| Name | Type | Description |
|---|---|---|
| _signer | address | The address of the signer |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the signer is approved, false otherwise |
_calculateCost
solidity
function _calculateCost(uint256 _quantity) internal view returns (uint256 totalCost)Calculates the total cost for creating a specific quantity of tokens
Parameters
| Name | Type | Description |
|---|---|---|
| _quantity | uint256 | The number of tokens to create |
Return Values
| Name | Type | Description |
|---|---|---|
| totalCost | uint256 | The total cost for creating the specified quantity of tokens |
_setTokenRoyaltyIfAvailable
solidity
function _setTokenRoyaltyIfAvailable(address diamondAddress, uint256 tokenId, address receiver) internalSets the royalty for a token if the function exists using the _getDefaultRoyaltyBips function
Parameters
| Name | Type | Description |
|---|---|---|
| diamondAddress | address | The address of the diamond |
| tokenId | uint256 | The ID of the token to set the royalty for |
| receiver | address | The address to receive royalties |