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

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

default value is true, contract is isPaused on deployment.

mintPrice

uint256 mintPrice

The cost to mint a token.

maxSupply

uint256 maxSupply

The maximum number of tokens that can be minted.

bulkBuyLimit

uint16 bulkBuyLimit

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

Minted

event Minted(address to, uint256 tokenId)

BaseURIChanged

event BaseURIChanged(string baseURI)

BaseExtensionChanged

event BaseExtensionChanged(string baseExtension)

MintCostChanged

event MintCostChanged(uint256 mintPrice)

BulkBuyLimitChanged

event BulkBuyLimitChanged(uint16 bulkBuyLimit)

PausedToggled

event PausedToggled(bool isPaused)

RoyaltysChanged

event RoyaltysChanged(address royaltyRecipient, uint96 royaltyBps)

constructor

constructor(string _name, string _symbol, string __baseURI, uint16 _bulkBuyLimit, uint96 _royaltyBps, uint256 _mintPrice, uint256 _maxTotalSupply, address _royaltyRecipient, address _newOwner) public

The constructor for the PowerNFT contract.

Parameters

isNotPaused

modifier isNotPaused()

Modifer to check if the contract is isPaused.

mintNFT

function mintNFT(address to, uint256 amount) public payable

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

reserveTokens

function reserveTokens(uint256 amount) public

Function to reserve nfts.

only the owner can call this function.

Parameters

tokenURI

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

returns the Uri for a token.

The token must exist.

Parameters

setBaseURI

function setBaseURI(string __baseURI) public

OnlyOwner function to set the baseURI.

only the owner can call this function.

Parameters

setBaseExtension

function setBaseExtension(string _baseExtension) public

OnlyOwner function to set the baseExstension.

only the owner can call this function.

Parameters

setMintPrice

function setMintPrice(uint256 _mintPrice) public

OnlyOwner function to set the mint cost of a nft.

only the owner can call this function.

Parameters

setBulkBuyLimit

function setBulkBuyLimit(uint16 _bulkBuyLimit) public

OnlyOwner function to set the bulk buy limit.

only the owner can call this function.

Parameters

togglePaused

function togglePaused() public

OnlyOwner function to toggle the isPaused state of the contract.

only the owner can call this function.

setRoyalties

function setRoyalties(address _royaltyRecipient, uint96 _royaltyBps) public

OnlyOwner function to set the royalties.

only the owner can call this function.

Parameters

supportsInterface

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

withdrawETH

function withdrawETH() public

OnlyOwner function to withdraw ETH.

only the owner can call this function. the owner can withdraw the ETH from the contract.

withdrawERC20

function withdrawERC20(address _tokenAddr) public

OnlyOwner function to withdraw ERC20 tokens.

only the owner can call this function.

Parameters

_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