ART of RESISTANCE Open Editions by PR1MAL CYPHER
About
Stats
Public Functions
20
Event Types
5
Code Size
51,694 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");
return _tokenIPFSHashes[tokenId];
}
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];
}
setNiftyIPFSHash keyboard_arrow_up
Source Code
function setNiftyIPFSHash(uint niftyType,
string memory ipfs_hash) onlyValidSender public {
//can only be set once
if (_IPFSHashHasBeenSet[niftyType] == true) {
revert("Can only be set once");
} else {
_niftyIPFSHashes[niftyType] = ipfs_hash;
_IPFSHashHasBeenSet[niftyType] = true;
}
}
closeContract keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function closeContract() onlyValidSender public {
//permanently close this open edition
isClosed = true;
}
giftNifty keyboard_arrow_up
Requirements help
Source Code
function giftNifty(address collector_address,
uint niftyType) onlyValidSender public {
//master for static calls
BuilderMaster bm = BuilderMaster(masterBuilderContract);
_numNiftyMinted[niftyType].increment();
//check if this collection is closed
if (isClosed==true) {
revert("This contract is closed!");
}
//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);
string memory ipfsHash = _niftyIPFSHashes[niftyType];
//mint token
_mint(collector_address, tokenId);
_setTokenURI(tokenId, tokenURI);
_setTokenIPFSHash(tokenId, ipfsHash);
//do events
emit NiftyCreated(collector_address, niftyType, tokenId);
}