Blockwell

Banned From The Internet Open Edition by Slime Sunday

About

Stats

Public Functions 20
Event Types 5
Code Size 51,694 bytes

Library Use

Uses Counters for Counters.Counter.

Approval Event

Parameters help
owner
address help
approved
address help
tokenId
uint256 help

ApprovalForAll Event

Parameters help
owner
address help
operator
address help
approved
bool help

NiftyCreated Event

Parameters help
new_owner
address help
_niftyType
uint help
_tokenId
uint help

NiftyPurchased Event

Parameters help
_buyer
address help
_amount
uint256 help
_tokenId
uint help

Transfer Event

Parameters help
from
address help
to
address help
tokenId
uint256 help

Functions Expand All Collapse All

balanceOf keyboard_arrow_up

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view

Requirements help

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

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

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

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
   function safeTransferFrom(address from, address to, uint256 tokenId) public {
       safeTransferFrom(from, to, tokenId, "");
   }

transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

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

Parameters help

Name Type
to
address help
approved
bool help

Properties

Visibility help public
Mutability help transaction

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

Parameters help

Name Type
owner
address help
operator
address help

Properties

Visibility help public
Mutability help view
Source Code
   function isApprovedForAll(address owner, address operator) public view returns (bool) {
       return _operatorApprovals[owner][operator];
   }

safeTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help
_data
bytes help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
   function name() external view returns (string memory) {
       return _name;
   }

symbol keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
   function symbol() external view returns (string memory) {
       return _symbol;
   }

tokenURI keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

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

Parameters help

Name Type
interfaceId
bytes4 help

Properties

Visibility help public
Mutability help view
Source Code
   function supportsInterface(bytes4 interfaceId) external view returns (bool) {
       return _supportedInterfaces[interfaceId];
   }

tokenIPFSHash keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
   function totalSupply() public view returns (uint256) {
       return _allTokens.length;
   }

tokenOfOwnerByIndex keyboard_arrow_up

Parameters help

Name Type
owner
address help
index
uint256 help

Properties

Visibility help public
Mutability help view
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

Parameters help

Name Type
index
uint256 help

Properties

Visibility help public
Mutability help view

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

Parameters help

Name Type
niftyType
uint help
ipfs_hash
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

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.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function closeContract() onlyValidSender public {
        //permanently close this open edition
        isClosed = true;
        
    }

giftNifty keyboard_arrow_up

Parameters help

Name Type
collector_address
address help
niftyType
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers 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);
   }