dcl://dg_summer_2020
About
Stats
Public Functions
32
Event Types
9
Code Size
53,830 bytes
Events (9) 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(msg.sender, 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(msg.sender == owner || isApprovedForAll(owner, msg.sender),
"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 != msg.sender, "ERC721: approve to caller");
_operatorApprovals[msg.sender][to] = approved;
emit ApprovalForAll(msg.sender, 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 {
transferFrom(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
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: received a URI query for a nonexistent token");
return string(abi.encodePacked(baseURI, _tokenPaths[_tokenId]));
}
supportsInterface keyboard_arrow_up
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];
}
owner keyboard_arrow_up
isOwner keyboard_arrow_up
renounceOwnership keyboard_arrow_up
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Source Code
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
setBaseURI keyboard_arrow_up
setAllowed keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Requirements help
Source Code
function setAllowed(address _operator, bool _allowed) public onlyOwner {
require(_operator != address(0), "Invalid address");
require(allowed[_operator] != _allowed, "You should set a different value");
allowed[_operator] = _allowed;
emit Allowed(_operator, _allowed);
}
batchTransferFrom keyboard_arrow_up
Source Code
function batchTransferFrom(address _from, address _to, uint256[] calldata _tokenIds) external {
for (uint256 i = 0; i < _tokenIds.length; i++) {
transferFrom(_from, _to, _tokenIds[i]);
}
}
wearablesCount keyboard_arrow_up
completeCollection keyboard_arrow_up
addWearables keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Requirements help
Source Code
function addWearables(bytes32[] calldata _wearableIds, uint256[] calldata _maxIssuances) external onlyOwner {
require(_wearableIds.length == _maxIssuances.length, "Parameters should have the same length");
for (uint256 i = 0; i < _wearableIds.length; i++) {
addWearable(_wearableIds[i].bytes32ToString(), _maxIssuances[i]);
}
}
addWearable keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Requirements help
Source Code
function addWearable(string memory _wearableId, uint256 _maxIssuance) public onlyOwner {
require(!isComplete, "The collection is complete");
bytes32 key = getWearableKey(_wearableId);
require(maxIssuance[key] == 0, "Can not modify an existing wearable");
require(_maxIssuance > 0, "Max issuance should be greater than 0");
maxIssuance[key] = _maxIssuance;
wearables.push(_wearableId);
emit AddWearable(key, _wearableId, _maxIssuance);
}
safeBatchTransferFrom keyboard_arrow_up
Source Code
function safeBatchTransferFrom(address _from, address _to, uint256[] memory _tokenIds) public {
safeBatchTransferFrom(_from, _to, _tokenIds, "");
}
safeBatchTransferFrom keyboard_arrow_up
Parameters help
Source Code
function safeBatchTransferFrom(address _from, address _to, uint256[] memory _tokenIds, bytes memory _data) public {
for (uint256 i = 0; i < _tokenIds.length; i++) {
safeTransferFrom(_from, _to, _tokenIds[i], _data);
}
}
getWearableKey keyboard_arrow_up
issueToken keyboard_arrow_up
issueTokens keyboard_arrow_up
Modifiers help
onlyAllowed checks for the following:
Requirements help
Source Code
function issueTokens(address[] calldata _beneficiaries, bytes32[] calldata _wearableIds) external onlyAllowed {
require(_beneficiaries.length == _wearableIds.length, "Parameters should have the same length");
for(uint256 i = 0; i < _wearableIds.length; i++) {
_issueToken(_beneficiaries[i], _wearableIds[i].bytes32ToString());
}
}