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

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 paused.

default value is true, contract is paused on deployment.

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

The merkle root for the allowList.

bulkBuyLimit

The maximum number of tokens that can be minted in a single transaction.

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

The cost to mint a token.

presaleMintPrice

The cost to mint a token during the presale period.

maxSupply

The maximum number of tokens that can be minted.

Minted

AllowListMinted

BaseURIChanged

BaseExtensionChanged

MintCostChanged

presaleMintPriceChanged

BulkBuyLimitChanged

MaxAllowListAmountChanged

PausedToggled

PreSaleToggled

RoyaltysChanged

allowListMintCount

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

constructor

The constructor for the contract.

Parameters

Name
Type
Description

_params

struct PowerPlusNFT.Params

The struct containing the parameters for the contract.

isNotPaused

Modifier to check if the contract is paused.

isValidMerkleProof

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

Name
Type
Description

merkleProof

bytes32[]

The merkle proof for the address.

root

bytes32

The merkle root for the allowList.

isPublicSale

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

isPreSale

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

mintNFT

Fcuntion to mint nfts.

this function is used during the public sale period.

Parameters

Name
Type
Description

to

address

amount

uint256

The number of tokens to mint.

presaleMintNFT

Function to mint nfts during the presale period.

Parameters

Name
Type
Description

_proof

bytes32[]

The merkle proof for the address.

amount

uint256

The number of tokens to mint.

reserveTokens

Function to mint nfts during the presale period.

this function is used to mint tokens for the team.

Parameters

Name
Type
Description

amount

uint256

The number of tokens to mint.

tokenURI

returns the token URI for a given token.

Parameters

Name
Type
Description

tokenId

uint256

The token ID.

togglePaused

Function to toggle the paused state of the contract.

togglePresale

OnlyOwner Function to toggle the presale state of the contract.

setBaseURI

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

Parameters

Name
Type
Description

_base_URI

string

The new base URI.

setBaseExtension

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

Parameters

Name
Type
Description

_baseExtension

string

The new base extension.

setMintPrice

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

Name
Type
Description

_mintPrice

uint256

The new mint cost during the public sale period.

setPresaleMintPrice

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

Parameters

Name
Type
Description

_presaleMintPrice

uint256

The new mint cost during the presale period.

setBulkBuyLimit

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

Parameters

Name
Type
Description

_bulkBuyLimit

uint16

The new bulk buy limit.

setMaxAllowListAmount

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

Parameters

Name
Type
Description

_amount

uint16

The new max allow list amount per address.

setMerkleRoot

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

Name
Type
Description

_merkleRoot

bytes32

The new merkle root.

setRoyalties

Function to set the royalties for the contract.

Parameters

Name
Type
Description

_royaltyRecipient

address

The new royalty recipient.

_royaltyBps

uint96

The new royalty bps, denominated by 10000.

withdrawETH

OnlyOwner Function to withdraw ETH from the contract.

withdrawERC20

OnlyOwner function to withdraw ERC20 tokens from the contract.

Parameters

Name
Type
Description

_tokenAddr

address

The address of the ERC20 token to withdraw.

supportsInterface

_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

Was this helpful?