Beeple Round 2 Open Edition
About
Stats
Public Functions
24
Event Types
5
Code Size
52,496 bytes
Library Use
Uses Counters for Counters.Counter.
Events (5) keyboard_arrow_up
Functions
balanceOf keyboard_arrow_up
Source Code
function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _ownedTokensCount[owner].current();
}
ownerOf keyboard_arrow_up
Source Code
function ownerOf(uint256 tokenId) public view returns (address) {
address owner = _tokenOwner[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
safeTransferFrom keyboard_arrow_up
Requirements help
Source Code
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(address from, address to, uint256 tokenId) public {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transferFrom(from, to, tokenId);
}
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address to, uint256 tokenId) public {
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"
);
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
getApproved keyboard_arrow_up
Requirements help
null
Source Code
function getApproved(uint256 tokenId) public view 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 to, bool approved) public {
require(to != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][to] = approved;
emit ApprovalForAll(_msgSender(), to, approved);
}
isApprovedForAll keyboard_arrow_up
safeTransferFrom keyboard_arrow_up
Requirements help
Source Code
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransferFrom(from, to, tokenId, _data);
}
name keyboard_arrow_up
symbol keyboard_arrow_up
tokenURI keyboard_arrow_up
Requirements help
null
Source Code
function tokenURI(uint256 tokenId) external view returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
return _tokenURIs[tokenId];
}
supportsInterface keyboard_arrow_up
tokenIPFSHash keyboard_arrow_up
Requirements help
null
Source Code
function tokenIPFSHash(uint256 tokenId) external view returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
//master for static calls
BuilderMaster bm = BuilderMaster(masterBuilderContract);
uint nifty_type = bm.getNiftyTypeId(tokenId);
return _niftyTypeIPFSHashes[nifty_type];
}
tokenName keyboard_arrow_up
Requirements help
null
Source Code
function tokenName(uint256 tokenId) external view returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
//master for static calls
BuilderMaster bm = BuilderMaster(masterBuilderContract);
uint nifty_type = bm.getNiftyTypeId(tokenId);
return _niftyTypeName[nifty_type];
}
totalSupply keyboard_arrow_up
tokenOfOwnerByIndex keyboard_arrow_up
Source Code
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
tokenByIndex keyboard_arrow_up
Requirements help
Source Code
function tokenByIndex(uint256 index) public view returns (uint256) {
require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
setNiftyName keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setNiftyName (uint niftyType, string memory niftyName) onlyOwner public {
//allow owner to change nifty name
_setNiftyTypeName(niftyType, niftyName);
}
setBaseURI keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setBaseURI(string memory newBaseURI) onlyOwner public {
//allow owner to change base URI
baseURI = newBaseURI;
}
isNiftySoldOut keyboard_arrow_up
Source Code
function isNiftySoldOut(uint niftyType) public view returns (bool) {
if (niftyType > numNiftiesCurrentlyInContract) {
return true;
}
if (_numNiftyMinted[niftyType].current() > _numNiftyPermitted[niftyType]) {
return (true);
} else {
return (false);
}
}
giftNifty keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function giftNifty(address collector_address,
uint niftyType) onlyOwner public {
//master for static calls
BuilderMaster bm = BuilderMaster(masterBuilderContract);
_numNiftyMinted[niftyType].increment();
//check if this nifty is sold out
if (isNiftySoldOut(niftyType)==true) {
revert("Nifty sold out!");
}
//mint a nifty
uint specificTokenId = _numNiftyMinted[niftyType].current();
uint tokenId = bm.encodeTokenId(contractId, niftyType, specificTokenId);
string memory tokenIdStr = bm.uint2str(tokenId);
string memory tokenURI = bm.strConcat(baseURI, tokenIdStr);
//mint token
_mint(collector_address, tokenId);
_setTokenURI(tokenId, tokenURI);
//do events
emit NiftyCreated(collector_address, niftyType, tokenId);
}
massMintNFTs keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function massMintNFTs(address collector_address, uint numToMint, uint niftyType) onlyOwner public {
//loop through array and create nifties
for (uint i=0; i < numToMint; i++) {
giftNifty(collector_address,niftyType);
}
}
closeOpenEdition keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
Source Code
function closeOpenEdition() onlyOwner public {
_numNiftyPermitted[1] = _numNiftyMinted[1].current();
_numNiftyPermitted[2] = _numNiftyMinted[2].current();
_numNiftyPermitted[3] = _numNiftyMinted[3].current();
}