Dagora NFT-A-Plus Wizard
NFTAPlus
isPaused
bool isPaused
Boolean to determine if the contract is isPaused.
default value is true, contract is isPaused on deployment.
isPresale
bool isPresale
Boolean to determine if the contract is in the presale period.
default value is true.
baseURI
string baseURI
The base URI for all tokens.
baseExtension
string baseExtension
The file extension of the metadata can be set to nothing.
default value is json
merkleRoot
bytes32 merkleRoot
The merkle root for the allowList, this is used to verify the allowList.
bulkBuyLimit
uint16 bulkBuyLimit
The maximum number of tokens that can be minted in a single transaction.
maxAllowListAmount
uint16 maxAllowListAmount
The maximum number of tokens that can be minted in a single transaction for a whitelist address.
this is used during the whitelist period.
mintPrice
uint256 mintPrice
The cost to mint a token.
presaleMintPrice
uint256 presaleMintPrice
The cost to mint a token during the presale period.
maxSupply
uint256 maxSupply
The maximum number of tokens that can be minted.
Minted
event Minted(address to, uint256 tokenId)
PresaleMinted
event PresaleMinted(address to, uint256 tokenId)
BaseURIChanged
event BaseURIChanged(string baseURI)
BaseExtensionChanged
event BaseExtensionChanged(string baseExtension)
MintCostChanged
event MintCostChanged(uint256 mintPrice)
PresaleMintCostChanged
event PresaleMintCostChanged(uint256 presaleMintCost)
BulkBuyLimitChanged
event BulkBuyLimitChanged(uint16 bulkBuyLimit)
MaxAllowListAmountChanged
event MaxAllowListAmountChanged(uint16 maxAllowListAmount)
isPausedToggled
event isPausedToggled(bool isPaused)
PresaleToggled
event PresaleToggled(bool isPresale)
allowListMintCount
mapping(address => uint256) allowListMintCount
constructor
constructor(string _name, string _symbol, string __baseURI, uint16 _bulkBuyLimit, uint16 _maxAllowListAmount, uint256 _mintCost, uint256 _presaleMintCost, uint256 _maxTotalSupply, address _newOwner, bytes32 _merkleRoot) public
isNotPaused
modifier isNotPaused()
Modifier to check if the contract is isPaused.
Throws if the contract is isPaused.
_isPresale
modifier _isPresale()
Modifier to check the sale state of the contract.
Throws if the contract is not in the presale period.
isPublicSale
modifier isPublicSale()
Modifier to check the sale state of the contract.
Throws if the contract is not in the public sale period.
isValidMerkleProof
modifier isValidMerkleProof(bytes32[] merkleProof, bytes32 root)
Modifier to check the proof of the allowList.
Throws if the proof is invalid.
mintNFT
function mintNFT(address to, uint256 amount) public payable
This function is used to mint a token.
this function is only callable when the contract is not paused, and the sale is public.
Parameters
to
address
the address to mint the token to.
amount
uint256
the amount of tokens to mint.
presaleMintNFT
function presaleMintNFT(bytes32[] proof, uint256 amount) public payable
This function is used to mint a token during the presale period.
this function is only callable when the contract is not paused, and the sale is presale.
Parameters
proof
bytes32[]
the merkle proof to check against the stored root.
amount
uint256
the amount of tokens to mint.
reserveTokens
function reserveTokens(uint256 amount) external
OnlyOwner function to mint tokens.
this function is only callable by the owner of the contract.
Parameters
amount
uint256
the amount of tokens to mint.
tokenURI
function tokenURI(uint256 tokenId) public view returns (string)
returns the tokenURI for a given token.
this function is only callable when the token exists.
Parameters
tokenId
uint256
the tokenID to get the tokenURI for.
setBaseURI
function setBaseURI(string __baseURI) external
Onlyowner function to set the base URI.
this function is only callable by the owner of the contract.
Parameters
__baseURI
string
the base URI to set.
setBaseExtension
function setBaseExtension(string _baseExtension) external
Onlyowner function to set the base extension.
this function is only callable by the owner of the contract.
Parameters
_baseExtension
string
the base extension to set.
setMintPrice
function setMintPrice(uint256 _mintPrice) external
Onlyowner function to set the mint price for the public sale.
this function is only callable by the owner of the contract.
Parameters
_mintPrice
uint256
the mint cost to set.
setPresaleMintPrice
function setPresaleMintPrice(uint256 _presaleMintPrice) external
Onlyowner function to set the mint price for the presale.
this function is only callable by the owner of the contract.
Parameters
_presaleMintPrice
uint256
the presale mint cost to set.
setBulkBuyLimit
function setBulkBuyLimit(uint16 _bulkBuyLimit) external
Onlyowner function to set the bulk buy limit.
this function is only callable by the owner of the contract.
Parameters
_bulkBuyLimit
uint16
the bulk buy limit to set.
setMaxAllowListAmount
function setMaxAllowListAmount(uint16 _maxAllowListAmount) external
Onlyowner function to set the max amount of tokens that can be minted during the presale.
this function is only callable by the owner of the contract.
Parameters
_maxAllowListAmount
uint16
the max amount of tokens that can be minted during the presale.
togglePaused
function togglePaused() external
Onlyowner function to set the paused state of the contract.
this function is only callable by the owner of the contract.
togglePresale
function togglePresale() external
Onlyowner function to set the presale state of the contract.
this function is only callable by the owner of the contract.
withdrawETH
function withdrawETH() external
Onlyowner function to withdraw any ETH sent to the contract.
this function is only callable by the owner of the contract.
withdrawERC20
function withdrawERC20(address _tokenAddr) public
Allows owner to withdraw any ERC20 tokens sent to this contract.
Only Contract Owner can use this function.
Parameters
_tokenAddr
address
The address of the ERC20 token.
_beforeTokenTransfers
function _beforeTokenTransfers(address from, address to, uint256 tokenId, uint256 quantity) internal
internal override function that is called before any token transfer.
this function will revert if the contract is paused, pausing transfers of tokens.
Parameters
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 typeOf() public pure returns (string)
function that returns the dagora contract type
Return Values
[0]
string
the dagora contract type
version
function version() public pure returns (string)
function that returns the dagora contract version
Return Values
[0]
string
the dagora contract version
_startTokenId
function _startTokenId() internal view virtual returns (uint256)
internal function that handles that starting tokenId of the collection
Return Values
[0]
uint256
the starting tokenId of the collection eg 1
Last updated
Was this helpful?