Rubyscore_Achievement
An ERC1155 token contract for minting and managing achievements with URI support. Rubyscore_Achievement can be minted by users with the MINTER_ROLE after proper authorization.
OPERATOR_ROLE
MINTER_ROLE
NAME
VERSION
BLAST(Optional. Used for Blast network)
name
Get token name.
symbol
Get token symbol.
supportsInterface
See {IRubyscore_Achievement}
uri
See {IRubyscore_Achievement}
getTransferStatus
See {IRubyscore_Achievement}
getPrice
See {IRubyscore_Achievement}
getUserNonce
See {IRubyscore_Achievement}
tokenURI
See {IRubyscore_Achievement}
constructor
Constructor for the Rubyscore_Achievement contract.
Initializes the contract with roles and settings. It sets the base URI for token metadata to the provided baseURI
. It grants the DEFAULT_ADMIN_ROLE, OPERATOR_ROLE, and MINTER_ROLE to the specified addresses. It also initializes the contract with EIP712 support and ERC1155 functionality. And also configures the system for the Blast network.
Parameters
setTokenURI
See {IRubyscore_Achievement}
setBatchTokenURI
See {IRubyscore_Achievement}
setBaseURI
See {IRubyscore_Achievement}
setPrice
See {IRubyscore_Achievement}
safeMin
See {IRubyscore_Achievement}
setTransferUnlock
See {IRubyscore_Achievement}
withdraw
See {IRubyscore_Achievement}
_mint
See {IRubyscore_Achievement}
_mintBatch
Internal function to safely mint multiple NFTs in a batch for a specified recipient.
This function checks if the recipient already owns any of the specified NFTs to prevent duplicates. It is intended for batch minting operations where multiple NFTs can be minted at once.
Parameters
_beforeTokenTransfer
Internal function that is called before the transfer of tokens.
This function enforces transfer restrictions based on the 'transferUnlock' status of individual tokens. If a token has its transfer locked and the 'from' address is not zero (indicating a user-to-contract transfer), it will revert to prevent unauthorized transfers. It then delegates the transfer logic to the parent contracts 'ERC1155' and 'ERC1155Supply'.
Parameters
Last updated