GEM NFT

This documentation provides an overview of the key functions within the GEM NFT contract which is designed for managing the GEM NFTs on the Polygon blockchain. It incorporates various features such as the creation of the GEM categories, the transfer/burning of an NFT, the retrieval of token URIs and balances etc.

Constructor

  • Initializes the contract with by setting the name and symbol of GEM NFTs as well as the staking contract address and a burning period. The deployer is set as the initial admin.

Setter Functions

setGemCategory

  • Purpose: Create an NFT category

  • Access: Only callable by an admin.

  • Parameters:

    • _id: The id of the GEM NFT category

    • _price: The standard price someone will pay to but an NFT from that category

    • _supply: The total number of NFTs for that category.

    • _fee: An additional fee paid in POL to buy an NFT from the specific category.

mintGEMNFTAUTH

  • Purpose: Mints a new NFT.

  • Access: Only callable by the GEM Minting contract.

  • Parameters:

    • _id: The id of the GEM NFT category

    • _receiver: The address that will receive the NFT

withdraw

  • Purpose: Withdraw POL funds sent to the smart contract.

  • Access: Only callable by the owner.

  • Parameters:

    • _to: Receiving Address

withdrawERC20

  • Purpose: Withdraw any ERC20 tokens sent to the smart contract

  • Access: Only callable by the owner.

  • Parameters:

    • _contractAddress: ERC20 token address

    • _to: Receiving Address

flipContractState

  • Purpose: Pause contract if active, make active if paused.

  • Access: Only callable by the owner.

flipBurnState

  • Purpose: Pause burn if active, make active if paused.

  • Access: Only callable by the owner.

setStakingAddress

  • Purpose: Sets the Staking contract address

  • Access: Only callable by the owner.

  • Parameters:

    • _staking: The Staking address

setMintingAddress

  • Purpose: Sets the Minting contract address

  • Access: Only callable by the owner.

  • Parameters:

    • _minting: The Minting address

burn

  • Purpose: Burns an NFT.

  • Access: Only callable by the NFT owner.

  • Parameters:

    • _tokenId: The token if of the NFT that will be burnt.

updateBurnFee

  • Purpose: Update the burning fee.

  • Access: Only callable by an admin.

  • Parameters:

    • _fee: The fee in wei that someone must pay to burn an NFT.

updateBurnPeriod

  • Purpose: Update the burning period.

  • Access: Only callable by an admin.

  • Parameters:

    • _burnPeriod: The period that needs to pass after the minting date to burn an NFT.

Getter Functions

tokenURI

  • Purpose: Retrieve the URI for a specific token.

  • Parameters:

    • _tokenId: The id of the token.

  • Returns: A URI that points to NFT metadata.

retrieveCategoryData

  • Purpose: Retrieve the data of a specific category.

  • Parameters:

    • _id: The id of the GEM NFT category

  • Returns: The price, the circulating supply, the max supply, the fee and the category status.

retrieveBurnStatus

  • Purpose: Retrieve if an NFT is eligible to be burnt.

  • Parameters:

    • _tokenId: The id of an NFT

  • Returns: True if the burning period has passed, otherwise, false.

Last updated