Blockwell

Bengs Art

About

Stats

Public Functions 33
Event Types 13
Code Size 58,095 bytes

Library Use

Uses SafeMath for uint256.
Uses Strings for string.

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

BatchBurned Event

Parameters help
metaId
string help
ids
uint256[] help

BatchForSale Event

Parameters help
ids
uint256[] help
metaId
string help

BatchTransfered Event

Parameters help
metaId
string help
recipients
address[] help
ids
uint256[] help

Bought Event

Parameters help
tokenId
uint256 help
metaId
string help
value
uint256 help

Destroy Event

Parameters help

ErrorOut Event

Parameters help
error
string help
tokenId
uint256 help

Minted Event

Parameters help
id
uint256 help
metaId
string help

MinterAdded Event

Parameters help
account
address help

MinterRemoved Event

Parameters help
account
address help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
from
address help
to
address help
tokenId
uint256 help

Price Event

Members
tokenId
uint256 help
price
uint256 help
metaId
string help
state
TokenState help

Functions Expand All Collapse All

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function owner() public view returns (address) {
        return _owner;
    }

isOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

renounceOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

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

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];
    }

burn keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function burn(uint256 tokenId) public {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
        _burn(tokenId);
    }

isMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isMinter(address account) public view returns (bool) {
        return _minters.has(account);
    }

addMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
    function addMinter(address account) public onlyMinter {
        _addMinter(account);
    }

renounceMinter keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function renounceMinter() public {
        _removeMinter(_msgSender());
    }

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
Source Code
  function tokenURI(uint256 _tokenId) public view returns (string memory) {
    return Strings.strConcat(
        baseUri,
        items[_tokenId].metaId
    );
  }

mintWithTokenURI keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
tokenURI
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
    function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) {
        _mint(to, tokenId);
        _setTokenURI(tokenId, tokenURI);
        return true;
    }

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];
    }

setTokenState keyboard_arrow_up

Parameters help

Name Type
ids
uint256[] help
isEnabled
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
  function setTokenState(uint256[] memory ids, bool isEnabled) public onlyMinter {
    for (uint256 i = 0; i < ids.length; i++) {
      if(isEnabled == true){
        items[ids[i]].state = TokenState.ForSale;
      } else {
        items[ids[i]].state = TokenState.Pending;
      }
    }
     emit BatchForSale(ids, items[ids[0]].metaId);
  }

setTokenPrice keyboard_arrow_up

Parameters help

Name Type
ids
uint256[] help
setPrice
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
  function setTokenPrice(uint256[] memory ids, uint256 setPrice) public onlyMinter {
    for (uint256 i = 0; i < ids.length; i++) {
      items[ids[i]].price = setPrice;
    }
  }

buyThing keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help

Properties

Visibility help public
Mutability help payable
Source Code
  function buyThing(uint256 _tokenId) public payable returns (bool) {

    require(msg.value >= items[_tokenId].price, "Price issue");
    require(TokenState.ForSale == items[_tokenId].state, "No Sale");

    if(items[_tokenId].price >= 0) {
      uint256 fee = mintbaseFee(msg.value);
      uint256 withFee = SafeMath.sub(msg.value, fee);

      maker.transfer(withFee);
      feeAddress.transfer(fee);
    }

    _transferFrom(maker, msg.sender, _tokenId);
    items[_tokenId].state = TokenState.Sold;

    emit Bought(_tokenId, items[_tokenId].metaId, msg.value);
  }

destroyAndSend keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
  function destroyAndSend() public onlyOwner {
    emit Destroy();
    selfdestruct(maker);
  }

batchTransfer keyboard_arrow_up

Parameters help

Name Type
giver
address help
recipients
address[] help
values
uint256[] help

Properties

Visibility help public
Mutability help transaction
Source Code
  function batchTransfer(address giver, address[] memory recipients, uint256[] memory values) public {

    for (uint256 i = 0; i < values.length; i++) {
      transferFrom(giver, recipients[i], values[i]);
     items[values[i]].state = TokenState.Transferred;
    }
    emit BatchTransfered(items[values[0]].metaId, recipients, values);
  }

batchMint keyboard_arrow_up

Parameters help

Name Type
to
address help
amountToMint
uint256 help
metaId
string help
setPrice
uint256 help
isForSale
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null

Requirements help

Source Code
  function batchMint(address to, uint256 amountToMint, string memory metaId, uint256 setPrice, bool isForSale) public onlyMinter {

    require(amountToMint <= 40, "Over 40");

    for (uint256 i = 0; i < amountToMint; i++) {
      id = id.add(1);
      items[id].price = setPrice;
      items[id].metaId = metaId;
      if(isForSale == true){
        items[id].state = TokenState.ForSale;
        
      } else {
        items[id].state = TokenState.Pending;
      }
      _mint(to, id);
      emit Minted(id, metaId);
    }
   
  }

batchBurn keyboard_arrow_up

Parameters help

Name Type
tokenIds
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
  function batchBurn(uint256[] memory tokenIds) public onlyMinter {
    for (uint256 i = 0; i < tokenIds.length; i++) {
      _burn(tokenIds[i]);
    }
    emit BatchBurned(items[tokenIds[0]].metaId, tokenIds);
  }

tokensOfOwner keyboard_arrow_up

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view
Source Code
  function tokensOfOwner(address owner) public view returns (uint256[] memory) {
    return _tokensOfOwner(owner);
  }