Dagora PowerNFT Wizard
PowerNFT
PowerNFT is ERC721A contract that is ownable and has royalties.
This contract is used as a template for creating new NFT contracts.
baseURI
The base URI for all tokens.
baseExtension
The file extension of the metadata can be set to nothing.
default value is json
royaltyRecipient
The address that will receive the royalties.
isPaused
Boolean to determine if the contract is isPaused.
default value is true, contract is isPaused on deployment.
mintPrice
The cost to mint a token.
maxSupply
The maximum number of tokens that can be minted.
bulkBuyLimit
The maximum number of tokens that can be minted in a single transaction.
Minted
BaseURIChanged
BaseExtensionChanged
MintCostChanged
BulkBuyLimitChanged
PausedToggled
RoyaltysChanged
constructor
The constructor for the PowerNFT contract.
Parameters
Name | Type | Description |
---|---|---|
_name | string | The name of the NFT. |
_symbol | string | The symbol of the NFT. |
__baseURI | string | The base URI for the NFT. |
_bulkBuyLimit | uint16 | The maximum number of tokens that can be minted in a single transaction. |
_royaltyBps | uint96 | The royalty percentage, is denominated by 10000. |
_mintPrice | uint256 | The cost to mint a token. |
_maxTotalSupply | uint256 | The maximum number of tokens that can be minted. |
_royaltyRecipient | address | The address that will receive the royalties. |
_newOwner | address | The address that will be the owner of the contract. |
isNotPaused
Modifer to check if the contract is isPaused.
mintNFT
Function to Mint nfts.
The amount of tokens to mint must be less than or equal to the bulk buy limit, and contract must not be isPaused.
Parameters
Name | Type | Description |
---|---|---|
to | address | |
amount | uint256 | The number of tokens to mint. |
reserveTokens
Function to reserve nfts.
only the owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The number of tokens to mint. |
tokenURI
returns the Uri for a token.
The token must exist.
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | The id of the token. |
setBaseURI
OnlyOwner function to set the baseURI.
only the owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
__baseURI | string | The base URI for the NFT. |
setBaseExtension
OnlyOwner function to set the baseExstension.
only the owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
_baseExtension | string | The file extension of the metadata can be set to nothing. |
setMintPrice
OnlyOwner function to set the mint cost of a nft.
only the owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
_mintPrice | uint256 | The cost to mint a token. |
setBulkBuyLimit
OnlyOwner function to set the bulk buy limit.
only the owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
_bulkBuyLimit | uint16 | The maximum number of tokens that can be minted in a single transaction. |
togglePaused
OnlyOwner function to toggle the isPaused state of the contract.
only the owner can call this function.
setRoyalties
OnlyOwner function to set the royalties.
only the owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
_royaltyRecipient | address | The address that will receive the royalties. |
_royaltyBps | uint96 | The royalty percentage, is denominated by 10000. |
supportsInterface
withdrawETH
OnlyOwner function to withdraw ETH.
only the owner can call this function. the owner can withdraw the ETH from the contract.
withdrawERC20
OnlyOwner function to withdraw ERC20 tokens.
only the owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
_tokenAddr | address | The address of the ERC20 token. |
_beforeTokenTransfers
internal override function that is called before any token transfer.
this function will revert if the contract is paused, pausing transfers of tokens.
Parameters
Name | Type | Description |
---|---|---|
from | address | The address of the sender. |
to | address | The address of the receiver. |
tokenId | uint256 | The token ID. |
quantity | uint256 | The quantity of tokens to transfer. |
typeOf
function that returns the dagora contract type
Return Values
Name | Type | Description |
---|---|---|
[0] | string | the dagora contract type |
version
function that returns the dagora contract version
Return Values
Name | Type | Description |
---|---|---|
[0] | string | the dagora contract version |
_startTokenId
internal function that handles that starting tokenId of the collection
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | the starting tokenId of the collection eg 1 |
Last updated