Dagora Pay-Splitter NFT
DagoraPaymentSplitterNFT
PayeeShare
struct PayeeShare {
address payee;
uint256 shareAmount;
}
isPaused
bool isPaused
Boolean to determine if the contract is isPaused.
default value is true, contract is isPaused on deployment.
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
bulkBuyLimit
uint16 bulkBuyLimit
The maximum number of tokens that can be minted in a single transaction.
mintPrice
uint256 mintPrice
The cost to mint a token.
maxSupply
uint256 maxSupply
The maximum number of tokens that can be minted.
payeeCount
uint256 payeeCount
The number of payees.
payeeShares
mapping(uint256 => struct DagoraPaymentSplitterNFT.PayeeShare) payeeShares
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)
isPausedToggled
event isPausedToggled(bool isPaused)
PayeeAdded
event PayeeAdded(address account, uint256 shares)
PaymentReleased
event PaymentReleased(address to, uint256 amount)
ERC20PaymentReleased
event ERC20PaymentReleased(contract IERC20 token, address to, uint256 amount)
PaymentReceived
event PaymentReceived(address from, uint256 amount)
constructor
constructor(string name_, string symbol_, address[] payees, uint256[] shares_, uint256 _mintPrice, uint256 _maxSupply, uint16 _bulkBuyLimit, string _baseURI, string _baseExtension, address newOwner) public
Constructor for the contract.
Parameters
name_
string
the name of the contract and token
symbol_
string
the symbol of the token
payees
address[]
the addresses of the payees
shares_
uint256[]
the amount of shares each payee has
_mintPrice
uint256
the cost to mint a token
_maxSupply
uint256
the maximum number of tokens that can be minted
_bulkBuyLimit
uint16
the maximum number of tokens that can be minted in a single transaction
_baseURI
string
the base URI for all tokens
_baseExtension
string
the file extension of the metadata can be set to nothing
newOwner
address
the address of the new owner
isNotPaused
modifier isNotPaused()
Modifier to check if the contract is isPaused.
Throws if the contract is isPaused.
mintNFT
function mintNFT(address to, uint256 amount) public payable
Funtion to mint one or more tokens.
Throws if the number of tokens to mint exceeds the bulk buy limit. Throws if the number of tokens to mint exceeds the max supply. Throws if the amount of ETH sent is less than the cost to mint a token.
Parameters
to
address
the address to mint the tokens to
amount
uint256
the number of tokens to mint
reserveTokens
function reserveTokens(uint256 amount) public
onlyOwner function to mint one or more tokens.
Throws if the number of tokens to mint exceeds the max supply.
Parameters
amount
uint256
the number of tokens to mint
totalShares
function totalShares() public view returns (uint256)
getter function for the total shares.
Return Values
[0]
uint256
the total shares
totalReleased
function totalReleased() public view returns (uint256)
getter function for the total released.
Return Values
[0]
uint256
the total released
totalReleased
function totalReleased(contract IERC20 token) public view returns (uint256)
getter function for the total released.
Parameters
token
contract IERC20
the token to check
shares
function shares(address account) public view returns (uint256)
getter function for the shares.
Parameters
account
address
the address to check
Return Values
[0]
uint256
the shares for the address
released
function released(address account) public view returns (uint256)
getter function for the released.
Parameters
account
address
the address to check
Return Values
[0]
uint256
the released for the address
released
function released(contract IERC20 token, address account) public view returns (uint256)
getter function for the released.
Parameters
token
contract IERC20
the token to check
account
address
the address to check
payee
function payee(uint256 index) public view returns (address)
getter function for the payees.
Parameters
index
uint256
the index of the payee
Return Values
[0]
address
the address of the payee
releasable
function releasable(address account) public view returns (uint256)
getter function for checking how much a payee is owed.
Parameters
account
address
the address to check
Return Values
[0]
uint256
the amount of ETH owed to the address
releasable
function releasable(contract IERC20 token, address account) public view returns (uint256)
getter function for checking how much a payee is owed.
Parameters
token
contract IERC20
the token to check
account
address
the address to check
Return Values
[0]
uint256
the amount of tokens owed to the address
release
function release(address payable account) public
function to release the amount owed to a payee.
Throws if the address has no shares. Throws if the address is not due payment.
Parameters
account
address payable
the address to release the payment to
tokenURI
function tokenURI(uint256 tokenId) public view returns (string)
returns the tokenURI for a given token.
this function is only callable when the token exists.
Parameters
tokenId
uint256
the tokenID to get the tokenURI for.
setBaseURI
function setBaseURI(string __baseURI) external
Onlyowner function to set the base URI.
this function is only callable by the owner of the contract.
Parameters
__baseURI
string
the base URI to set.
setBaseExtension
function setBaseExtension(string _baseExtension) external
Onlyowner function to set the base extension.
this function is only callable by the owner of the contract.
Parameters
_baseExtension
string
the base extension to set.
setMintPrice
function setMintPrice(uint256 _mintPrice) external
Onlyowner function to set the mint price for the public sale.
this function is only callable by the owner of the contract.
Parameters
_mintPrice
uint256
the mint cost to set.
setBulkBuyLimit
function setBulkBuyLimit(uint16 _bulkBuyLimit) external
Onlyowner function to set the bulk buy limit.
this function is only callable by the owner of the contract.
Parameters
_bulkBuyLimit
uint16
the bulk buy limit to set.
togglePaused
function togglePaused() external
Onlyowner function to set the paused state of the contract.
this function is only callable by the owner of the contract.
_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
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
[0]
string
the dagora contract type
version
function version() public pure returns (string)
function that returns the dagora contract version
Return Values
[0]
string
the dagora contract version
_startTokenId
function _startTokenId() internal view virtual returns (uint256)
internal function that handles that starting tokenId of the collection
Return Values
[0]
uint256
the starting tokenId of the collection eg 1
receive
receive() external payable virtual
_The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the reliability of the events, and not the actual splitting of Ether.
To learn more about this see the Solidity documentation for https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback functions]._
Last updated
Was this helpful?