Blockwell

Blockwell-QR Index

About

Stats

Public Functions 25
Event Types 5
Code Size 24,115 bytes

Library Use

Uses Groups for Groups.GroupMap.
Uses SafeMath for uint256.

AddedToGroup Event

Parameters help
groupId
uint8 help
account
address help

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

RemovedFromGroup Event

Parameters help
groupId
uint8 help
account
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_tokenId
uint256 help

Functions Expand All Collapse All

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

unrestrictMinting keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function unrestrictMinting() public onlyAdmin {
        unrestrictedMinting = true;
    }

restrictMinting keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function restrictMinting() public onlyAdmin {
        unrestrictedMinting = false;
    }

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) {
        return tokenName;
    }

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) {
        return tokenSymbol;
    }

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

balanceOf keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function balanceOf(address account) public view returns (uint256) {
        require(account != address(0));
        return tokenCount[account];
    }

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 = owners[tokenId];
        require(owner != address(0));
        return owner;
    }

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));
        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());
        return allTokens[index];
    }

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));
        return approval[tokenId];
    }

isApprovedForAll keyboard_arrow_up

Parameters help

Name Type
account
address help
operator
address help

Properties

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

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) {
        require(_exists(tokenId));
        return uri[tokenId];
    }

addAdmin keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function addAdmin(address account) public onlyAdmin {
        _addAdmin(account);
    }

removeAdmin keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function removeAdmin(address account) public onlyAdmin {
        groups.remove(ADMIN, account);
        emit RemovedFromGroup(ADMIN, account);
    }

isAdmin keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isAdmin(address account) public view returns (bool) {
        return groups.contains(ADMIN, account);
    }

approve keyboard_arrow_up

Parameters help

Name Type
account
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function approve(address account, uint256 tokenId) public {
        address owner = ownerOf(tokenId);

        require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

        approval[tokenId] = account;
        emit Approval(owner, account, tokenId);
    }

setApprovalForAll keyboard_arrow_up

Parameters help

Name Type
to
address help
approved
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setApprovalForAll(address to, bool approved) public {
        require(to != msg.sender);
        operatorApproval[msg.sender][to] = approved;
        emit ApprovalForAll(msg.sender, to, approved);
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function transferFrom(address from, address to, uint256 tokenId) public {
        require(_isApprovedOrOwner(msg.sender, tokenId));
        require(to != address(0));

        _clearApproval(from, tokenId);
        _removeTokenFrom(from, tokenId);
        _addTokenTo(to, tokenId);

        emit Transfer(from, to, tokenId);
    }

safeTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help payable

Requirements help

null
null
Source Code
    function safeTransferFrom(address from, address to, uint256 tokenId) external payable {
        transferFrom(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, ""));
    }

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 payable

Requirements help

null
null
Source Code
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external payable {
        transferFrom(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data));
    }

mint keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
null
Source Code
    function mint(address to, uint256 tokenId) public onlyAdmin returns (bool) {
        _mint(to, tokenId);
        return true;
    }

mintWithTokenURI keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
URIForToken
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

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

addQr keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function addQr(uint256 tokenId) public returns (bool) {
        if (!unrestrictedMinting) {
            require(isAdmin(msg.sender), "Must be an admin");
        }
        _mint(tokenOwner, tokenId);
        _setTokenURI(tokenId, concat("https://qr.blockwell.ai/qri/", uint2str(tokenId)));
        return true;
    }

burn keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function burn(uint256 tokenId) public {
        require(msg.sender == ownerOf(tokenId));
        _burn(msg.sender, tokenId);
    }