CharacterBoundToken

Git Source

Inherits: Context, ERC165, IERC1155, IERC1155MetadataURI, AccessControlEnumerable

State Variables

MINTER_ROLE

bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

_balances

mapping(uint256 => mapping(uint256 => uint256)) private _balances;

_operatorApprovals

mapping(address => mapping(address => bool)) private _operatorApprovals;

_tokenURIs

mapping(uint256 => string) private _tokenURIs;

web3Entry

address public web3Entry;

_currentTokenNumbers

mapping(uint256 => uint256) private _currentTokenNumbers;

Functions

constructor

constructor(address web3Entry_);

mint

function mint(uint256 characterId, uint256 tokenId) external onlyRole(MINTER_ROLE);

burn

function burn(uint256 characterId, uint256 tokenId, uint256 amount) external;

setTokenURI

function setTokenURI(uint256 tokenId, string memory tokenURI) external onlyRole(MINTER_ROLE);

safeTransferFrom

See {IERC1155-safeTransferFrom}.

function safeTransferFrom(address, address, uint256, uint256, bytes memory) external virtual override;

safeBatchTransferFrom

See {IERC1155-safeBatchTransferFrom}.

function safeBatchTransferFrom(address, address, uint256[] memory, uint256[] memory, bytes memory)
    external
    virtual
    override;

setApprovalForAll

See {IERC1155-setApprovalForAll}.

function setApprovalForAll(address operator, bool approved) external virtual override;

balanceOfBatch

function balanceOfBatch(address[] memory accounts, uint256[] memory tokenIds)
    external
    view
    virtual
    override
    returns (uint256[] memory);

supportsInterface

See {IERC165-supportsInterface}.

function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(AccessControlEnumerable, ERC165, IERC165)
    returns (bool);

balanceOf

function balanceOf(address account, uint256 tokenId) public view virtual override returns (uint256 balance);

balanceOf

function balanceOf(uint256 characterId, uint256 tokenId) public view virtual returns (uint256);

uri

function uri(uint256 tokenId) public view virtual override returns (string memory);

isApprovedForAll

See {IERC1155-isApprovedForAll}.

function isApprovedForAll(address account, address operator) public view virtual override returns (bool);

_setApprovalForAll

Approve operator to operate on all of owner tokens Emits an {ApprovalForAll} event.

function _setApprovalForAll(address owner, address operator, bool approved) internal virtual;

_setURI

function _setURI(uint256 tokenId, string memory tokenURI) internal virtual;

Events

Mint

event Mint(uint256 indexed to, uint256 indexed tokenId, uint256 indexed tokenNumber);

Burn

event Burn(uint256 indexed from, uint256 indexed tokenId, uint256 indexed amount);