Skip to content

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

NameTypeDescription
_toaddressThe address to receive the newly created token
_metadatastringThe metadata for the new token
_signaturebytesThe signature to validate the creation request
_additionalSplitsaddress[]Additional addresses to receive a split of the creator fee

Return Values

NameTypeDescription
totalFeeuint256The total fee charged for the token creation
recipientsaddress[]The addresses receiving portions of the fee
feeAmountsuint256[]The amounts each recipient receives

_upsertMetadataAndSplit

solidity
function _upsertMetadataAndSplit(uint256 _index, string _metadata, address _to) internal

Upserts the metadata and split for a specific token

Parameters

NameTypeDescription
_indexuint256The index of the token
_metadatastringThe metadata for the token
_toaddressThe address to receive the token

_currentTokenIndex

solidity
function _currentTokenIndex() internal view returns (uint256)

Returns the current token index

Return Values

NameTypeDescription
[0]uint256The current token index

_setApprovedSigner

solidity
function _setApprovedSigner(address _signer, bool _approved) internal

Sets the approval status of a signer

Parameters

NameTypeDescription
_signeraddressThe address of the signer
_approvedboolThe approval status to set

_isApprovedSigner

solidity
function _isApprovedSigner(address _signer) internal view returns (bool)

Checks if a signer is approved

Parameters

NameTypeDescription
_signeraddressThe address of the signer

Return Values

NameTypeDescription
[0]boolTrue 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

NameTypeDescription
_quantityuint256The number of tokens to create

Return Values

NameTypeDescription
totalCostuint256The total cost for creating the specified quantity of tokens

_setTokenRoyaltyIfAvailable

solidity
function _setTokenRoyaltyIfAvailable(address diamondAddress, uint256 tokenId, address receiver) internal

Sets the royalty for a token if the function exists using the _getDefaultRoyaltyBips function

Parameters

NameTypeDescription
diamondAddressaddressThe address of the diamond
tokenIduint256The ID of the token to set the royalty for
receiveraddressThe address to receive royalties