Dagora SimpleNFT Wizard

Below is the technical documentation for the Dagora SimpleNFT wizard contract, that uses ERC721A.

SimpleNFTA

isPaused

bool isPaused

State variable to track if the contract is paused

baseURI

string baseURI

The base URI for all tokens

baseExtension

string baseExtension

The Extension at the end of the URI

bulkBuyLimit

uint16 bulkBuyLimit

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

mintPrice

uint256 mintPrice

The price of a single token

maxSupply

uint256 maxSupply

The maximum number of tokens that can be minted

Minted

event Minted(address to, uint256 tokenId)

the event that is emitted when a token is minted

Parameters

BaseURIChanged

event BaseURIChanged(string baseURI)

the event that is emitted when the baseURI is changed

The baseURI is the URI at the beginning of the tokenURI

Parameters

BaseExtensionChanged

event BaseExtensionChanged(string baseExtension)

the event that is emitted when the baseExtension is changed

The baseExtension is the extension at the end of the baseURI

Parameters

MintCostChanged

event MintCostChanged(uint256 mintPrice)

the event that is emitted when the mintPrice is changed

The mintPrice is the price of a single token can only be changed by the owner

Parameters

BulkBuyLimitChanged

event BulkBuyLimitChanged(uint256 bulkBuyLimit)

the event that is emitted when the bulkBuyLimit is changed

The bulkBuyLimit is the maximum number of tokens that can be minted in a single transaction

Parameters

PausedToggled

event PausedToggled(bool paused)

the event that is emitted when the contract is paused or unpaused

The contract can only be paused or unpaused by the owner

Parameters

constructor

constructor(string name_, string symbol_, string baseURI_, uint16 _bulkBuyLimit, uint256 _mintPrice, uint256 _maxSupply, address _newOwner) public

The constructor for the contract

Parameters

isNotPaused

modifier isNotPaused()

Modifier to check if the contract is paused

Throws if the contract is paused

mintNFT

function mintNFT(address to, uint256 amount) public payable

the function to mint nft tokens can be one or up to bulkBuyLimit

the function can only be called if the contract is not paused

Parameters

reserveTokens

function reserveTokens(uint256 amount) public

onlyOwner function to mint nft tokens can be one or up to bulkBuyLimit

the function can only be called if the contract is not paused

Parameters

tokenURI

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

function that returns the tokenURI for a given token

the function can only be called if the token exists

Parameters

Return Values

setBaseURI

function setBaseURI(string _baseURI) public

onlyInOwner function to change the baseURI

the function can only be called by the owner

Parameters

setBaseExtension

function setBaseExtension(string _baseExtension) public

onlyInOwner function to change the baseExtension

the function can only be called by the owner

Parameters

setMintPrice

function setMintPrice(uint256 _mintPrice) public

onlyInOwner function to change the mintPrice

the function can only be called by the owner

Parameters

setBulkBuyLimit

function setBulkBuyLimit(uint16 _bulkBuyLimit) public

onlyInOwner function to change the bulkBuyLimit

the function can only be called by the owner

Parameters

togglePaused

function togglePaused() public

onlyInOwner function to change the isPaused state

the function can only be called by the owner

withdrawETH

function withdrawETH() public

onlyInOwner function to withdraw ETH from the contract

the function can only be called by the owner

withdrawERC20

function withdrawERC20(address token) public

onlyInOwner function to withdraw ERC20 tokens from the contract

the function can only be called by the owner

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 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 pure returns (uint256)

internal function that handles that starting tokenId of the collection

Return Values

Last updated

Logo