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

The price of a single token

maxSupply

The maximum number of tokens that can be minted

Minted

the event that is emitted when a token is minted

Parameters

Name
Type
Description

to

address

The address that received the token

tokenId

uint256

The id of the token that was minted

BaseURIChanged

the event that is emitted when the baseURI is changed

The baseURI is the URI at the beginning of the tokenURI

Parameters

Name
Type
Description

baseURI

string

The new baseURI

BaseExtensionChanged

the event that is emitted when the baseExtension is changed

The baseExtension is the extension at the end of the baseURI

Parameters

Name
Type
Description

baseExtension

string

The new baseExtension

MintCostChanged

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

Name
Type
Description

mintPrice

uint256

The new mintPrice

BulkBuyLimitChanged

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

Name
Type
Description

bulkBuyLimit

uint256

The new bulkBuyLimit

PausedToggled

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

The contract can only be paused or unpaused by the owner

Parameters

Name
Type
Description

paused

bool

The new paused state

constructor

The constructor for the contract

Parameters

Name
Type
Description

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 to check if the contract is paused

Throws if the contract is paused

mintNFT

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

Name
Type
Description

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

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

Name
Type
Description

amount

uint256

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

tokenURI

function that returns the tokenURI for a given token

the function can only be called if the token exists

Parameters

Name
Type
Description

tokenId

uint256

The id of the token

Return Values

Name
Type
Description

[0]

string

the tokenURI for the given token

setBaseURI

onlyInOwner function to change the baseURI

the function can only be called by the owner

Parameters

Name
Type
Description

_baseURI

string

The new baseURI

setBaseExtension

onlyInOwner function to change the baseExtension

the function can only be called by the owner

Parameters

Name
Type
Description

_baseExtension

string

The new baseExtension

setMintPrice

onlyInOwner function to change the mintPrice

the function can only be called by the owner

Parameters

Name
Type
Description

_mintPrice

uint256

The new mintPrice

setBulkBuyLimit

onlyInOwner function to change the bulkBuyLimit

the function can only be called by the owner

Parameters

Name
Type
Description

_bulkBuyLimit

uint16

The new bulkBuyLimit

togglePaused

onlyInOwner function to change the isPaused state

the function can only be called by the owner

withdrawETH

onlyInOwner function to withdraw ETH from the contract

the function can only be called by the owner

withdrawERC20

onlyInOwner function to withdraw ERC20 tokens from the contract

the function can only be called by the owner

Parameters

Name
Type
Description

token

address

The address of the ERC20 token

_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?