Dagora NFT-A-Plus Wizard
NFTAPlus
isPaused
bool isPausedBoolean to determine if the contract is isPaused.
default value is true, contract is isPaused on deployment.
isPresale
bool isPresaleBoolean to determine if the contract is in the presale period.
default value is true.
baseURI
string baseURIThe base URI for all tokens.
baseExtension
string baseExtensionThe file extension of the metadata can be set to nothing.
default value is json
merkleRoot
bytes32 merkleRootThe merkle root for the allowList, this is used to verify the allowList.
bulkBuyLimit
uint16 bulkBuyLimitThe maximum number of tokens that can be minted in a single transaction.
maxAllowListAmount
uint16 maxAllowListAmountThe 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 mintPriceThe cost to mint a token.
presaleMintPrice
uint256 presaleMintPriceThe cost to mint a token during the presale period.
maxSupply
uint256 maxSupplyThe 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) allowListMintCountconstructor
constructor(string _name, string _symbol, string __baseURI, uint16 _bulkBuyLimit, uint16 _maxAllowListAmount, uint256 _mintCost, uint256 _presaleMintCost, uint256 _maxTotalSupply, address _newOwner, bytes32 _merkleRoot) publicisNotPaused
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 payableThis 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 payableThis 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) externalOnlyOwner 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) externalOnlyowner 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) externalOnlyowner 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) externalOnlyowner 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) externalOnlyowner 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) externalOnlyowner 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) externalOnlyowner 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() externalOnlyowner function to set the paused state of the contract.
this function is only callable by the owner of the contract.
togglePresale
function togglePresale() externalOnlyowner function to set the presale state of the contract.
this function is only callable by the owner of the contract.
withdrawETH
function withdrawETH() externalOnlyowner 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) publicAllows 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) internalinternal 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?
