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

NameTypeDescription

to

address

The address that received the token

tokenId

uint256

The id of the token that was minted

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

NameTypeDescription

baseURI

string

The new baseURI

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

NameTypeDescription

baseExtension

string

The new baseExtension

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

NameTypeDescription

mintPrice

uint256

The new mintPrice

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

NameTypeDescription

bulkBuyLimit

uint256

The new bulkBuyLimit

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

NameTypeDescription

paused

bool

The new paused state

constructor

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

The constructor for the contract

Parameters

NameTypeDescription

name_

string

The name of the token

symbol_

string

The symbol of the token

baseURI_

string

The base URI for the token

_bulkBuyLimit

uint16

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

_mintPrice

uint256

The price of a single token

_maxSupply

uint256

The maximum number of tokens that can be minted

_newOwner

address

The address that will be the owner of the contract

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

NameTypeDescription

to

address

The address that will receive the minted tokens

amount

uint256

The number of tokens to mint can be one or up to bulkBuyLimit

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

NameTypeDescription

amount

uint256

The number of tokens to mint can be one or up to bulkBuyLimit

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

NameTypeDescription

tokenId

uint256

The id of the token

Return Values

NameTypeDescription

[0]

string

the tokenURI for the given token

setBaseURI

function setBaseURI(string _baseURI) public

onlyInOwner function to change the baseURI

the function can only be called by the owner

Parameters

NameTypeDescription

_baseURI

string

The new baseURI

setBaseExtension

function setBaseExtension(string _baseExtension) public

onlyInOwner function to change the baseExtension

the function can only be called by the owner

Parameters

NameTypeDescription

_baseExtension

string

The new baseExtension

setMintPrice

function setMintPrice(uint256 _mintPrice) public

onlyInOwner function to change the mintPrice

the function can only be called by the owner

Parameters

NameTypeDescription

_mintPrice

uint256

The new mintPrice

setBulkBuyLimit

function setBulkBuyLimit(uint16 _bulkBuyLimit) public

onlyInOwner function to change the bulkBuyLimit

the function can only be called by the owner

Parameters

NameTypeDescription

_bulkBuyLimit

uint16

The new bulkBuyLimit

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

NameTypeDescription

token

address

The address of the ERC20 token

_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

NameTypeDescription

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

NameTypeDescription

[0]

string

the dagora contract type

version

function version() public pure returns (string)

function that returns the dagora contract version

Return Values

NameTypeDescription

[0]

string

the dagora contract version

_startTokenId

function _startTokenId() internal pure returns (uint256)

internal function that handles that starting tokenId of the collection

Return Values

NameTypeDescription

[0]

uint256

the starting tokenId of the collection eg 1

Last updated

Logo