Blockwell

JOYWORLD JOYtoys

About

Stats

Public Functions 44
Event Types 12
Code Size 75,799 bytes

Library Use

Uses SafeMath for uint256.

Events (12) keyboard_arrow_up

AddJOYCollector Event

Parameters help
JOYtoyId
uint256 help
joyTokenId
uint256 help
joyCollectorPercent
uint256 help
collectorActive
bool help

AddJOYtoyRoyalties Event

Parameters help
JOYtoyId
uint256 help
count
uint256 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

ClearRoyalties Event

Parameters help
JOYtoyId
uint256 help

CloseJOYtoyWindow Event

Parameters help
JOYtoyId
uint256 help

NewArtworkAdded Event

Parameters help
JOYtoyToUpdate
uint256 help
artworkHash
string help
artworkType
string help
artworkIndex
uint256 help

NewJOYtoyCreated Event

Parameters help
artworkHash
string help
artworkType
string help
power
string help
toyName
string help
feature
string help
editionSize
uint256 help
vendingMachine
bool help
price
uint256 help
royalty
uint256 help
JOYtoyIndex
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
from
address help
to
address help
tokenId
uint256 help

UpdateFeature Event

Parameters help
JOYtoyToUpdate
uint256 help
newFeatures
string help

UpdatePrice Event

Parameters help
JOYtoyToUpdate
uint256 help
price
uint256 help

_ERC721_RECEIVED Constant

bytes4 help
0x150b7a02

_INTERFACE_ID_ERC721 Constant

bytes4 help
0x80ac58cd

_INTERFACE_ID_ERC721_METADATA Constant

bytes4 help
0x5b5e139f

_INTERFACE_ID_ERC721_ENUMERABLE Constant

bytes4 help
0x780e9d63

_INTERFACE_ID_ERC165 Constant

bytes4 help
0x01ffc9a7

joyWallet Variable

address help

joyContractAddress Variable

address help

artist Variable

string help

artworkTypeList Variable

string help

JOYtoyIndex Variable

uint256 help
Internal Variable

JOYtoyArtwork Variable

mapping(uint256 => string[]) help
Internal Variable

artworkTypeMemory Variable

mapping(uint256 => string[]) help
Internal Variable

artworkSlotFilled Variable

mapping(uint256 => bool[]) help
Internal Variable

royaltyAddressMemory Variable

mapping(uint256 => address[]) help
Internal Variable

royaltyPercentageMemory Variable

mapping(uint256 => uint256[]) help
Internal Variable

toyNameMemory Variable

mapping(uint256 => string) help
Internal Variable

featuresMemory Variable

mapping(uint256 => string) help
Internal Variable

editionSizeMemory Variable

mapping(uint256 => uint256) help
Internal Variable

powerMemory Variable

mapping(uint256 => string) help
Internal Variable

editionNumberMemory Variable

mapping(uint256 => uint256) help
Internal Variable

totalCreated Variable

mapping(uint256 => uint256) help
Internal Variable

totalMinted Variable

mapping(uint256 => uint256) help
Internal Variable

vendingMachineMode Variable

mapping(uint256 => bool) help
Internal Variable

priceMemory Variable

mapping(uint256 => uint256) help
Internal Variable

royaltyLengthMemory Variable

mapping(uint256 => uint256) help
Internal Variable

royaltyMemory Variable

mapping(uint256 => uint256) help
Internal Variable

artworkJOYtoyReference Variable

mapping(uint256 => uint256) help
Internal Variable

toyMintingActive Variable

mapping(uint256 => bool) help
Internal Variable

joyCollabTokenId Variable

mapping(uint256 => uint256) help
Internal Variable

joyHolderCollaborator Variable

mapping(uint256 => address) help
Internal Variable

joyHolderCollabActive Variable

mapping(uint256 => bool) help
Internal Variable

joyHolderCollabPercent Variable

mapping(uint256 => uint256) help
Internal Variable

collaboratorNamesMemory Variable

mapping(uint256 => string) help
Internal Variable

JOYtoyURI1 Variable

string help
Internal Variable

JOYtoyURI2 Variable

string help
Internal Variable

joyWorld Variable

JOYContract help
Internal Variable

_holderTokens Variable

mapping(address => EnumerableSet.UintSet) help
Internal Variable

_tokenOwners Variable

EnumerableMap.UintToAddressMap help
Internal Variable

_tokenApprovals Variable

mapping(uint256 => address) help
Internal Variable

_operatorApprovals Variable

mapping(address => mapping(address => bool)) help
Internal Variable

_name Variable

string help
Internal Variable

_symbol Variable

string help
Internal Variable

_tokenURIs Variable

mapping(uint256 => string) help
Internal Variable

_baseURI Variable

string help
Internal Variable

_supportedInterfaces Variable

mapping(bytes4 => bool) help
Internal Variable

_owner Variable

address help
Internal Variable

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

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transferOwnership(address newOwner) public virtual onlyOwner {
  require(newOwner != address(0), "Ownable: new owner is the zero address");
  emit OwnershipTransferred(_owner, newOwner);
  _owner = newOwner;
}

supportsInterface keyboard_arrow_up

Parameters help

Name Type
interfaceId
bytes4 help

Properties

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

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
function balanceOf(address owner) public view override returns (uint256) {
  require(owner != address(0), "ERC721: balance query for the zero address");

  return _holderTokens[owner].length();
}

ownerOf keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function ownerOf(uint256 tokenId) public view override returns (address) {
  return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() public view override 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)
  public
  view
  override
  returns (string memory)
{
  require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
  return string(abi.encodePacked(_baseURI, tokenId.toString()));
}

baseURI keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function baseURI() public view returns (string memory) {
  return _baseURI;
}

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
  override
  returns (uint256)
{
  return _holderTokens[owner].at(index);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function totalSupply() public view override returns (uint256) {
  // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
  return _tokenOwners.length();
}

tokenByIndex keyboard_arrow_up

Parameters help

Name Type
index
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function tokenByIndex(uint256 index) public view override returns (uint256) {
  (uint256 tokenId, ) = _tokenOwners.at(index);
  return tokenId;
}

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 virtual override {
  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"
  );

  _approve(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 override returns (address) {
  require(_exists(tokenId), "ERC721: approved query for nonexistent token");

  return _tokenApprovals[tokenId];
}

setApprovalForAll keyboard_arrow_up

Parameters help

Name Type
operator
address help
approved
bool help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setApprovalForAll(address operator, bool approved)
  public
  virtual
  override
{
  require(operator != _msgSender(), "ERC721: approve to caller");

  _operatorApprovals[_msgSender()][operator] = approved;
  emit ApprovalForAll(_msgSender(), operator, 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
  override
  returns (bool)
{
  return _operatorApprovals[owner][operator];
}

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 virtual override {
  //solhint-disable-next-line max-line-length
  require(
    _isApprovedOrOwner(_msgSender(), tokenId),
    "ERC721: transfer caller is not owner nor approved"
  );

  _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 transaction
Source Code
function safeTransferFrom(
  address from,
  address to,
  uint256 tokenId
) public virtual override {
  safeTransferFrom(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 transaction
Source Code
function safeTransferFrom(
  address from,
  address to,
  uint256 tokenId,
  bytes memory _data
) public virtual override {
  require(
    _isApprovedOrOwner(_msgSender(), tokenId),
    "ERC721: transfer caller is not owner nor approved"
  );
  _safeTransfer(from, to, tokenId, _data);
}

createJOYtoy keyboard_arrow_up

Parameters help

Name Type
artworkHash
string help
artworkType
string help
power
string help
toyName
string help
feature
string help
editionSize
uint256 help
vendingMachine
bool help
price
uint256 help
royalty
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function createJOYtoy(
  string memory artworkHash,
  string memory artworkType,
  string memory power,
  string memory toyName,
  string memory feature,
  uint256 editionSize,
  bool vendingMachine,
  uint256 price,
  uint256 royalty
) public onlyOwner {
  toyMintingActive[JOYtoyIndex] = true;

  JOYtoyArtwork[JOYtoyIndex][1] = artworkHash;
  artworkTypeMemory[JOYtoyIndex][1] = artworkType;
  powerMemory[JOYtoyIndex] = power;
  toyNameMemory[JOYtoyIndex] = toyName;
  featuresMemory[JOYtoyIndex] = feature;
  editionSizeMemory[JOYtoyIndex] = editionSize;
  totalCreated[JOYtoyIndex] = 0;
  totalMinted[JOYtoyIndex] = 0;
  artworkSlotFilled[JOYtoyIndex][1] = true;
  vendingMachineMode[JOYtoyIndex] = vendingMachine;
  priceMemory[JOYtoyIndex] = price;
  royaltyMemory[JOYtoyIndex] = royalty;

  emit NewJOYtoyCreated(
    artworkHash,
    artworkType,
    power,
    toyName,
    feature,
    editionSize,
    vendingMachine,
    price,
    royalty,
    JOYtoyIndex
  );

  JOYtoyIndex = JOYtoyIndex + 1;
}

addJOYtoyRoyalties keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help
royaltyAddresses
address[] help
royaltyPercentage
uint256[] help
collaboratorNames
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function addJOYtoyRoyalties(
  uint256 JOYtoyId,
  address[] memory royaltyAddresses,
  uint256[] memory royaltyPercentage,
  string memory collaboratorNames
) public onlyOwner {
  require(royaltyAddresses.length == royaltyPercentage.length);
  require(royaltyAddresses.length <= 5);

  uint256 totalCollaboratorRoyalties;
  collaboratorNamesMemory[JOYtoyId] = collaboratorNames;

  for (uint256 i = 0; i < royaltyAddresses.length; i++) {
    royaltyAddressMemory[JOYtoyId][i] = royaltyAddresses[i];
    royaltyPercentageMemory[JOYtoyId][i] = royaltyPercentage[i];
    totalCollaboratorRoyalties =
      totalCollaboratorRoyalties +
      royaltyPercentage[i];
  }

  royaltyLengthMemory[JOYtoyId] = royaltyAddresses.length;

  emit AddJOYtoyRoyalties(JOYtoyId, royaltyAddresses.length);
}

getRoyalties keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function getRoyalties(uint256 JOYtoyId)
  public
  view
  returns (address[5] memory addresses, uint256[5] memory percentages)
{
  for (uint256 i = 0; i < royaltyLengthMemory[JOYtoyId]; i++) {
    addresses[i] = royaltyAddressMemory[JOYtoyId][i];
    percentages[i] = royaltyPercentageMemory[JOYtoyId][i];
  }
}

addJOYCollector keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help
joyTokenId
uint256 help
joyCollectorPercent
uint256 help
collectorActive
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function addJOYCollector(
  uint256 JOYtoyId,
  uint256 joyTokenId,
  uint256 joyCollectorPercent,
  bool collectorActive
) public onlyOwner {
  joyCollabTokenId[JOYtoyId] = joyTokenId;
  joyHolderCollaborator[JOYtoyId] = originalJOYOwner(joyTokenId);
  joyHolderCollabPercent[JOYtoyId] = joyCollectorPercent;
  joyHolderCollabActive[JOYtoyId] = collectorActive;

  emit AddJOYCollector(
    JOYtoyId,
    joyTokenId,
    joyCollectorPercent,
    collectorActive
  );
}

getJoyCollaborator keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function getJoyCollaborator(uint256 JOYtoyId)
  public
  view
  returns (
    uint256 joyTokenId,
    address joyTokenHolder,
    uint256 joyCollectorPercent,
    bool collectorActive
  )
{
  joyTokenId = joyCollabTokenId[JOYtoyId];
  joyTokenHolder = joyHolderCollaborator[JOYtoyId];
  joyCollectorPercent = joyHolderCollabPercent[JOYtoyId];
  collectorActive = joyHolderCollabActive[JOYtoyId];
}

clearRoyalties keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function clearRoyalties(uint256 JOYtoyId) public onlyOwner {
  for (uint256 i = 0; i < royaltyLengthMemory[JOYtoyId]; i++) {
    royaltyAddressMemory[JOYtoyId][
      i
    ] = 0x0000000000000000000000000000000000000000;
    royaltyPercentageMemory[JOYtoyId][i] = 0;
  }

  collaboratorNamesMemory[JOYtoyId] = "";
  royaltyLengthMemory[JOYtoyId] = 0;

  emit ClearRoyalties(JOYtoyId);
}

addJOYtoyArtwork keyboard_arrow_up

Parameters help

Name Type
JOYtoyToUpdate
uint256 help
artworkHash
string help
artworkType
string help
artworkIndex
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function addJOYtoyArtwork(
  uint256 JOYtoyToUpdate,
  string memory artworkHash,
  string memory artworkType,
  uint256 artworkIndex
) public onlyOwner {
  require(artworkSlotFilled[JOYtoyToUpdate][artworkIndex] == false);

  JOYtoyArtwork[JOYtoyToUpdate][artworkIndex] = artworkHash;
  artworkTypeMemory[JOYtoyToUpdate][artworkIndex] = artworkType;

  artworkSlotFilled[JOYtoyToUpdate][artworkIndex] = true;

  emit NewArtworkAdded(JOYtoyToUpdate, artworkHash, artworkType, artworkIndex);
}

updateFeature keyboard_arrow_up

Parameters help

Name Type
JOYtoyToUpdate
uint256 help
newFeatures
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updateFeature(uint256 JOYtoyToUpdate, string memory newFeatures)
  public
  onlyOwner
{
  featuresMemory[JOYtoyToUpdate] = newFeatures;

  emit UpdateFeature(JOYtoyToUpdate, newFeatures);
}

updatePrice keyboard_arrow_up

Parameters help

Name Type
JOYtoyToUpdate
uint256 help
price
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updatePrice(uint256 JOYtoyToUpdate, uint256 price) public onlyOwner {
  priceMemory[JOYtoyToUpdate] = price;

  emit UpdatePrice(JOYtoyToUpdate, price / 10**18);
}

mintJOYtoy keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help
amountToMint
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function mintJOYtoy(uint256 JOYtoyId, uint256 amountToMint) public onlyOwner {
  require(toyMintingActive[JOYtoyId] == true);
  require(totalMinted[JOYtoyId] + amountToMint <= editionSizeMemory[JOYtoyId]);

  for (
    uint256 i = totalMinted[JOYtoyId];
    i < amountToMint + totalMinted[JOYtoyId];
    i++
  ) {
    uint256 tokenId = totalSupply() + 1;
    artworkJOYtoyReference[tokenId] = JOYtoyId;
    editionNumberMemory[tokenId] = i + 1;

    _safeMint(msg.sender, tokenId);
  }

  totalMinted[JOYtoyId] = totalMinted[JOYtoyId] + amountToMint;

  if (totalMinted[JOYtoyId] == editionSizeMemory[JOYtoyId]) {
    closeJOYtoyWindow(JOYtoyId);
  }
}

JOYtoyMachine keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help

Properties

Visibility help public
Mutability help payable

Requirements help

null
Source Code
function JOYtoyMachine(uint256 JOYtoyId) public payable {
  require(toyMintingActive[JOYtoyId] == true);
  require(totalMinted[JOYtoyId] + 1 <= editionSizeMemory[JOYtoyId]);
  require(vendingMachineMode[JOYtoyId] == true);
  require(msg.value == priceMemory[JOYtoyId]);

  uint256 tokenId = totalSupply() + 1;
  artworkJOYtoyReference[tokenId] = JOYtoyId;
  editionNumberMemory[tokenId] = totalMinted[JOYtoyId] + 1;

  (
    address[5] memory royaltyAddress,
    uint256[5] memory percentage
  ) = getRoyalties(JOYtoyId);

  for (uint256 i = 0; i < royaltyLengthMemory[JOYtoyId]; i++) {
    address payable artistWallet = address(uint160(royaltyAddress[i]));
    artistWallet.transfer((msg.value / 100) * percentage[i]);
  }

  if (joyHolderCollabActive[JOYtoyId] == true) {
    address payable joyHolder = address(
      uint160(joyHolderCollaborator[JOYtoyId])
    );
    uint256 joyHolderPercentage = joyHolderCollabPercent[JOYtoyId];

    joyHolder.transfer((msg.value / 100) * joyHolderPercentage);
  }

  joyWallet.transfer(address(this).balance);

  _safeMint(msg.sender, tokenId);

  totalMinted[JOYtoyId] = totalMinted[JOYtoyId] + 1;

  if (totalMinted[JOYtoyId] == editionSizeMemory[JOYtoyId]) {
    closeJOYtoyWindow(JOYtoyId);
  }
}

closeJOYtoyWindow keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function closeJOYtoyWindow(uint256 JOYtoyId) public onlyOwner {
  toyMintingActive[JOYtoyId] = false;
  editionSizeMemory[JOYtoyId] = totalMinted[JOYtoyId];

  emit CloseJOYtoyWindow(JOYtoyId);
}

withdrawFunds keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function withdrawFunds() public onlyOwner {
  msg.sender.transfer(address(this).balance);
}

getJOYtoyArtworkData keyboard_arrow_up

Parameters help

Name Type
JOYtoyId
uint256 help
index
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function getJOYtoyArtworkData(uint256 JOYtoyId, uint256 index)
  public
  view
  returns (
    string memory artworkHash,
    string memory artworkType,
    uint256 unmintedEditions
  )
{
  artworkHash = JOYtoyArtwork[JOYtoyId][index];
  artworkType = artworkTypeMemory[JOYtoyId][index];
  unmintedEditions = editionSizeMemory[JOYtoyId] - totalMinted[JOYtoyId];
}

getMetadata keyboard_arrow_up

getRoyaltyData keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
function getRoyaltyData(uint256 tokenId)
  public
  view
  returns (address artistAddress, uint256 royaltyFeeById)
{
  require(_exists(tokenId), "Token does not exist.");
  uint256 JOYtoyRef = artworkJOYtoyReference[tokenId];

  artistAddress = joyWallet;
  royaltyFeeById = royaltyMemory[JOYtoyRef];
}

getArtworkData keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help
index
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
function getArtworkData(uint256 tokenId, uint256 index)
  public
  view
  returns (string memory artworkHash, string memory artworkType)
{
  require(_exists(tokenId), "Token does not exist.");
  uint256 JOYtoyRef = artworkJOYtoyReference[tokenId];

  artworkHash = JOYtoyArtwork[JOYtoyRef][index];
  artworkType = artworkTypeMemory[JOYtoyRef][index];
}

updateGalleryLink keyboard_arrow_up

updatePaymentWallet keyboard_arrow_up

Parameters help

Name Type
newWallet
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updatePaymentWallet(address payable newWallet) public onlyOwner {
  joyWallet = newWallet;
}

updateURI keyboard_arrow_up

Parameters help

Name Type
newURI
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updateURI(string memory newURI) public onlyOwner {
  _setBaseURI(newURI);
}

updateJOYtoyURI keyboard_arrow_up

Parameters help

Name Type
newURI1
string help
newURI2
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updateJOYtoyURI(string memory newURI1, string memory newURI2)
  public
  onlyOwner
{
  JOYtoyURI1 = newURI1;
  JOYtoyURI2 = newURI2;
}

JOYtoyURI keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help
artworkIndex
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
function JOYtoyURI(uint256 tokenId, uint256 artworkIndex)
  external
  view
  returns (string memory)
{
  require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
  return
    string(
      abi.encodePacked(
        JOYtoyURI1,
        integerToString(tokenId),
        JOYtoyURI2,
        integerToString(artworkIndex)
      )
    );
}

originalJOYOwner keyboard_arrow_up

Parameters help

Name Type
joyTokenId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function originalJOYOwner(uint256 joyTokenId)
  public
  view
  returns (address ownerOfJOY)
{
  ownerOfJOY = joyWorld.ownerOf(joyTokenId);
}

updateArtworkTypeList keyboard_arrow_up

Parameters help

Name Type
newArtworkTypeList
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updateArtworkTypeList(string memory newArtworkTypeList)
  public
  onlyOwner
{
  artworkTypeList = newArtworkTypeList;
}

updateJOYContractAddress keyboard_arrow_up

Parameters help

Name Type
newJOYaddress
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updateJOYContractAddress(address newJOYaddress) public onlyOwner {
  joyContractAddress = newJOYaddress;
  joyWorld = JOYContract(joyContractAddress);
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal JOYtoys.integerToString keyboard_arrow_up

Parameters help

Name Type
_i
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function integerToString(uint256 _i) internal pure returns (string memory) {
  if (_i == 0) {
    return "0";
  }

  uint256 j = _i;
  uint256 len;

  while (j != 0) {
    len++;
    j /= 10;
  }

  bytes memory bstr = new bytes(len);
  uint256 k = len - 1;

  while (_i != 0) {
    bstr[k--] = byte(uint8(48 + (_i % 10)));
    _i /= 10;
  }
  return string(bstr);
}

internal ERC721._safeTransfer keyboard_arrow_up

Parameters help

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

Properties

Visibility help internal
Mutability help transaction
Source Code
function _safeTransfer(
  address from,
  address to,
  uint256 tokenId,
  bytes memory _data
) internal virtual {
  _transfer(from, to, tokenId);
  require(
    _checkOnERC721Received(from, to, tokenId, _data),
    "ERC721: transfer to non ERC721Receiver implementer"
  );
}

internal ERC721._exists keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help internal
Mutability help view
Source Code
function _exists(uint256 tokenId) internal view returns (bool) {
  return _tokenOwners.contains(tokenId);
}

internal ERC721._isApprovedOrOwner keyboard_arrow_up

Parameters help

Name Type
spender
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help view

Requirements help

null
Source Code
function _isApprovedOrOwner(address spender, uint256 tokenId)
  internal
  view
  returns (bool)
{
  require(_exists(tokenId), "ERC721: operator query for nonexistent token");
  address owner = ownerOf(tokenId);
  return (spender == owner ||
    getApproved(tokenId) == spender ||
    isApprovedForAll(owner, spender));
}

internal ERC721._safeMint keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _safeMint(address to, uint256 tokenId) internal virtual {
  _safeMint(to, tokenId, "");
}

internal ERC721._safeMint keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
_data
bytes help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _safeMint(
  address to,
  uint256 tokenId,
  bytes memory _data
) internal virtual {
  _mint(to, tokenId);
  require(
    _checkOnERC721Received(address(0), to, tokenId, _data),
    "ERC721: transfer to non ERC721Receiver implementer"
  );
}

internal ERC721._mint keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _mint(address to, uint256 tokenId) internal virtual {
  require(to != address(0), "ERC721: mint to the zero address");
  require(!_exists(tokenId), "ERC721: token already minted");

  _beforeTokenTransfer(address(0), to, tokenId);

  _holderTokens[to].add(tokenId);

  _tokenOwners.set(tokenId, to);

  emit Transfer(address(0), to, tokenId);
}

internal ERC721._burn keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burn(uint256 tokenId) internal virtual {
  address owner = ownerOf(tokenId);

  _beforeTokenTransfer(owner, address(0), tokenId);

  // Clear approvals
  _approve(address(0), tokenId);

  // Clear metadata (if any)
  if (bytes(_tokenURIs[tokenId]).length != 0) {
    delete _tokenURIs[tokenId];
  }

  _holderTokens[owner].remove(tokenId);

  _tokenOwners.remove(tokenId);

  emit Transfer(owner, address(0), tokenId);
}

internal ERC721._transfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _transfer(
  address from,
  address to,
  uint256 tokenId
) internal virtual {
  require(
    ownerOf(tokenId) == from,
    "ERC721: transfer of token that is not own"
  );
  require(to != address(0), "ERC721: transfer to the zero address");

  _beforeTokenTransfer(from, to, tokenId);

  // Clear approvals from the previous owner
  _approve(address(0), tokenId);

  _holderTokens[from].remove(tokenId);
  _holderTokens[to].add(tokenId);

  _tokenOwners.set(tokenId, to);

  emit Transfer(from, to, tokenId);
}

internal ERC721._setTokenURI keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help
_tokenURI
string help

Properties

Visibility help internal
Mutability help transaction

Requirements help

null
Source Code
function _setTokenURI(uint256 tokenId, string memory _tokenURI)
  internal
  virtual
{
  require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
  _tokenURIs[tokenId] = _tokenURI;
}

internal ERC721._setBaseURI keyboard_arrow_up

Parameters help

Name Type
baseURI_
string help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setBaseURI(string memory baseURI_) internal virtual {
  _baseURI = baseURI_;
}

internal ERC721._checkOnERC721Received keyboard_arrow_up

Parameters help

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

Properties

Visibility help private
Mutability help transaction
Source Code
function _checkOnERC721Received(
  address from,
  address to,
  uint256 tokenId,
  bytes memory _data
) private returns (bool) {
  if (!to.isContract()) {
    return true;
  }
  bytes memory returndata = to.functionCall(
    abi.encodeWithSelector(
      IERC721Receiver(to).onERC721Received.selector,
      _msgSender(),
      from,
      tokenId,
      _data
    ),
    "ERC721: transfer to non ERC721Receiver implementer"
  );
  bytes4 retval = abi.decode(returndata, (bytes4));
  return (retval == _ERC721_RECEIVED);
}

internal ERC721._approve keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help private
Mutability help transaction
Source Code
function _approve(address to, uint256 tokenId) private {
  _tokenApprovals[tokenId] = to;
  emit Approval(ownerOf(tokenId), to, tokenId);
}

internal ERC721._beforeTokenTransfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _beforeTokenTransfer(
  address from,
  address to,
  uint256 tokenId
) internal virtual {}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal ERC165.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
constructor() internal {
  // Derived contracts need only register support for their own interfaces,
  // we register support for ERC165 itself here
  _registerInterface(_INTERFACE_ID_ERC165);
}

internal ERC165._registerInterface keyboard_arrow_up

Parameters help

Name Type
interfaceId
bytes4 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _registerInterface(bytes4 interfaceId) internal virtual {
  require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
  _supportedInterfaces[interfaceId] = true;
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  address msgSender = _msgSender();
  _owner = msgSender;
  emit OwnershipTransferred(address(0), msgSender);
}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}