DigitalaxGenesis
About
Stats
Public Functions
23
Event Types
9
Code Size
74,954 bytes
Library Use
Uses SafeMath for uint256.
Events (9) keyboard_arrow_up
Functions
supportsInterface keyboard_arrow_up
balanceOf keyboard_arrow_up
Source Code
function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _holderTokens[owner].length();
}
ownerOf keyboard_arrow_up
name keyboard_arrow_up
symbol keyboard_arrow_up
tokenURI keyboard_arrow_up
Requirements help
null
Source Code
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
return tokenURI_;
}
tokenOfOwnerByIndex keyboard_arrow_up
totalSupply keyboard_arrow_up
tokenByIndex keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address to, uint256 tokenId) public virtual override {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
getApproved keyboard_arrow_up
Requirements help
null
Source Code
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
setApprovalForAll keyboard_arrow_up
Requirements help
Source Code
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
isApprovedForAll keyboard_arrow_up
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
safeTransferFrom keyboard_arrow_up
Requirements help
Source Code
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
safeTransferFrom keyboard_arrow_up
Requirements help
Source Code
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
buyOrIncreaseContribution keyboard_arrow_up
buy keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
fundsTransferSuccess must be true
null
Source Code
function buy() public payable {
require(contribution[_msgSender()] == 0, "DigitalaxGenesisNFT.buy: You already own a genesis NFT");
require(
_getNow() >= genesisStartTimestamp && _getNow() <= genesisEndTimestamp,
"DigitalaxGenesisNFT.buy: No genesis are available outside of the genesis window"
);
uint256 _contributionAmount = msg.value;
require(
_contributionAmount >= minimumContributionAmount,
"DigitalaxGenesisNFT.buy: Contribution does not meet minimum requirement"
);
require(
_contributionAmount <= maximumContributionAmount,
"DigitalaxGenesisNFT.buy: You cannot exceed the maximum contribution amount"
);
require(remainingGenesisTokens() > 0, "DigitalaxGenesisNFT.buy: Total number of genesis token holders reached");
contribution[_msgSender()] = _contributionAmount;
totalContributions = totalContributions.add(_contributionAmount);
(bool fundsTransferSuccess,) = fundsMultisig.call{value : _contributionAmount}("");
require(fundsTransferSuccess, "DigitalaxGenesisNFT.buy: Unable to send contribution to funds multisig");
uint256 tokenId = totalSupply().add(1);
_safeMint(_msgSender(), tokenId);
emit GenesisPurchased(_msgSender(), tokenId, _contributionAmount);
}
increaseContribution keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
maximumContributionAmount
must be greater than or equal to
contribution for the result of calling _msgSender
fundsTransferSuccess must be true
Source Code
function increaseContribution() public payable {
require(
_getNow() >= genesisStartTimestamp && _getNow() <= genesisEndTimestamp,
"DigitalaxGenesisNFT.increaseContribution: No increases are possible outside of the genesis window"
);
require(
contribution[_msgSender()] > 0,
"DigitalaxGenesisNFT.increaseContribution: You do not own a genesis NFT"
);
uint256 _amountToIncrease = msg.value;
contribution[_msgSender()] = contribution[_msgSender()].add(_amountToIncrease);
require(
contribution[_msgSender()] <= maximumContributionAmount,
"DigitalaxGenesisNFT.increaseContribution: You cannot exceed the maximum contribution amount"
);
totalContributions = totalContributions.add(_amountToIncrease);
(bool fundsTransferSuccess,) = fundsMultisig.call{value : _amountToIncrease}("");
require(
fundsTransferSuccess,
"DigitalaxGenesisNFT.increaseContribution: Unable to send contribution to funds multisig"
);
emit ContributionIncreased(_msgSender(), _amountToIncrease);
}
adminBuy keyboard_arrow_up
Requirements help
null
Source Code
function adminBuy(address _beneficiary) external {
require(
accessControls.hasAdminRole(_msgSender()),
"DigitalaxGenesisNFT.adminBuy: Sender must be admin"
);
require(_beneficiary != address(0), "DigitalaxGenesisNFT.adminBuy: Beneficiary cannot be ZERO");
require(balanceOf(_beneficiary) == 0, "DigitalaxGenesisNFT.adminBuy: Beneficiary already owns a genesis NFT");
uint256 tokenId = totalSupply().add(1);
_safeMint(_beneficiary, tokenId);
// Increase admin mint counts
totalAdminMints = totalAdminMints.add(1);
emit AdminGenesisMinted(_beneficiary, _msgSender(), tokenId);
}
updateGenesisEnd keyboard_arrow_up
Requirements help
Source Code
function updateGenesisEnd(uint256 _end) external {
require(
accessControls.hasAdminRole(_msgSender()),
"DigitalaxGenesisNFT.updateGenesisEnd: Sender must be admin"
);
// If already passed, dont allow opening again
require(genesisEndTimestamp > _getNow(), "DigitalaxGenesisNFT.updateGenesisEnd: End time already passed");
// Only allow setting this once
require(!genesisEndTimestampLocked, "DigitalaxGenesisNFT.updateGenesisEnd: End time locked");
genesisEndTimestamp = _end;
// Lock future end time modifications
genesisEndTimestampLocked = true;
emit GenesisEndUpdated(genesisEndTimestamp, _msgSender());
}
updateAccessControls keyboard_arrow_up
Requirements help
UNKNOWN VALUE
must not be equal to
UNKNOWN VALUE
Source Code
function updateAccessControls(DigitalaxAccessControls _accessControls) external {
require(
accessControls.hasAdminRole(_msgSender()),
"DigitalaxGenesisNFT.updateAccessControls: Sender must be admin"
);
require(address(_accessControls) != address(0), "DigitalaxGenesisNFT.updateAccessControls: Zero Address");
accessControls = _accessControls;
emit AccessControlsUpdated(address(_accessControls));
}