Dagora PowerPlus NFT Wizard

PowerPlusNFT

PowerPlusNFT is ERC721A contract that is ownable, has royalties, and a pre-sale.

This contract is used as a template for creating new NFT contracts.

Params

struct Params {
  string name_;
  string symbol_;
  string baseURI_;
  uint16 _bulkBuyLimit;
  uint16 _maxAllowListAmount;
  uint96 _royaltyBps;
  uint256 _mintPrice;
  uint256 _presaleMintCost;
  uint256 _maxSupply;
  address _royaltyRecipient;
  address _newOwner;
  bytes32 _merkleRoot;
}

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

royaltyRecipient

address royaltyRecipient

The address that will receive the royalties.

isPaused

bool isPaused

Boolean to determine if the contract is paused.

default value is true, contract is paused on deployment.

preSaleActive

bool preSaleActive

Boolean to determine if the contract is in the pre-sale period.

default value is true, contract is in presale state on deployment.

merkleRoot

bytes32 merkleRoot

The merkle root for 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)

AllowListMinted

event AllowListMinted(address to, uint256 tokenId)

BaseURIChanged

event BaseURIChanged(string baseURI)

BaseExtensionChanged

event BaseExtensionChanged(string baseExtension)

MintCostChanged

event MintCostChanged(uint256 mintPrice)

presaleMintPriceChanged

event presaleMintPriceChanged(uint256 presaleMintPrice)

BulkBuyLimitChanged

event BulkBuyLimitChanged(uint16 bulkBuyLimit)

MaxAllowListAmountChanged

event MaxAllowListAmountChanged(uint16 maxAllowListAmount)

PausedToggled

event PausedToggled(bool paused)

PreSaleToggled

event PreSaleToggled(bool preSaleActive)

RoyaltysChanged

event RoyaltysChanged(address royaltyRecipient, uint96 royaltyBps)

allowListMintCount

mapping(address => uint256) allowListMintCount

Mapping to track the number of tokens minted for each address during presale.

constructor

constructor(struct PowerPlusNFT.Params _params) public

The constructor for the contract.

Parameters

isNotPaused

modifier isNotPaused()

Modifier to check if the contract is paused.

isValidMerkleProof

modifier isValidMerkleProof(bytes32[] merkleProof, bytes32 root)

Modifier to check the address is allowed to mint during the presale period.

check the proof provided against the root stored in the contract.

Parameters

isPublicSale

modifier isPublicSale()

a modifier to check if the contract is in the public sale period.

isPreSale

modifier isPreSale()

a modifier to check if the contract is in the presale period.

mintNFT

function mintNFT(address to, uint256 amount) public payable

Fcuntion to mint nfts.

this function is used during the public sale period.

Parameters

presaleMintNFT

function presaleMintNFT(bytes32[] _proof, uint256 amount) public payable

Function to mint nfts during the presale period.

Parameters

reserveTokens

function reserveTokens(uint256 amount) public

Function to mint nfts during the presale period.

this function is used to mint tokens for the team.

Parameters

tokenURI

function tokenURI(uint256 tokenId) public view returns (string)

returns the token URI for a given token.

Parameters

togglePaused

function togglePaused() public

Function to toggle the paused state of the contract.

togglePresale

function togglePresale() public

OnlyOwner Function to toggle the presale state of the contract.

setBaseURI

function setBaseURI(string _base_URI) public

OnlyOwner Function to set the base URI for the token URIs.

Parameters

setBaseExtension

function setBaseExtension(string _baseExtension) public

OnlyOwner Function to set the base extension for the token URIs.

Parameters

setMintPrice

function setMintPrice(uint256 _mintPrice) public

OnlyOwner Function to set the mint cost during the public sale period.

this function is used to set the mint cost during the public sale period.

Parameters

setPresaleMintPrice

function setPresaleMintPrice(uint256 _presaleMintPrice) public

OnlyOwner Function to set the mint cost during the presale period.

Parameters

setBulkBuyLimit

function setBulkBuyLimit(uint16 _bulkBuyLimit) public

OnlyOwner Function to set the bulk buy limit per transaction, during the public sale period.

Parameters

setMaxAllowListAmount

function setMaxAllowListAmount(uint16 _amount) public

OnlyOwner Function to set the max allow list amount per address, during the presale period.

Parameters

setMerkleRoot

function setMerkleRoot(bytes32 _merkleRoot) public

OnlyOwner Function to set the merkle root for the presale.

this function is used to set the merkle root for the presale, this is used to verify the merkle proof and check if a address is included.

Parameters

setRoyalties

function setRoyalties(address _royaltyRecipient, uint96 _royaltyBps) public

Function to set the royalties for the contract.

Parameters

withdrawETH

function withdrawETH() public

OnlyOwner Function to withdraw ETH from the contract.

withdrawERC20

function withdrawERC20(address _tokenAddr) public

OnlyOwner function to withdraw ERC20 tokens from the contract.

Parameters

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

_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

typeOf

function typeOf() public pure virtual returns (string)

function that returns the dagora contract type

Return Values

version

function version() public pure returns (string)

function that returns the dagora contract version

Return Values

_startTokenId

function _startTokenId() internal view virtual returns (uint256)

internal function that handles that starting tokenId of the collection

Return Values

Last updated

Logo