Blockwell

F1® Delta Time Inventory

About

Stats

Public Functions 54
Event Types 18
Code Size 105,685 bytes

Events (18) keyboard_arrow_up

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

CollectionsPaused Event

Parameters help
collectionIds
uint256[] help
pauser
address help

CollectionsUnpaused Event

Parameters help
collectionIds
uint256[] help
pauser
address help

FungibleCollection Event

Parameters help
id
address help

MinterAdded Event

Parameters help
account
address help

MinterRemoved Event

Parameters help
account
address help

NonFungibleCollection Event

Parameters help
id
address help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Paused Event

Parameters help
account
address help

PauserAdded Event

Parameters help
account
address help

PauserRemoved Event

Parameters help
account
address help

RelayHubChanged Event

Parameters help
oldRelayHub
address help
newRelayHub
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_tokenId
uint256 help

TransferBatch Event

Parameters help
_operator
address help
_from
address help
_to
address help
_ids
uint256[] help
_values
uint256[] help

TransferSingle Event

Parameters help
_operator
address help
_from
address help
_to
address help
_id
uint256 help
_value
uint256 help

URI Event

Parameters help
_value
string help
_id
uint256 help

Unpaused Event

Parameters help
account
address help

NF_BIT_MASK Constant

uint256 help
UNKNOWN VALUE

GAS_PRICE_SCALING_SCALE Constant

uint help
1000

RELAYED_CALL_ACCEPTED Constant

uint256 help
0

RELAYED_CALL_REJECTED Constant

uint256 help
11

POST_RELAYED_CALL_MAX_GAS Constant

uint256 help
100000

_gasToken Variable

address help

_payoutWallet Variable

address help

_gasPriceScaling Variable

uint help

_ipfsMigrated Variable

bool help
Internal Variable

_uriPrefix Variable

string help
Internal Variable

_ipfsUriPrefix Variable

string help
Internal Variable

_uris Variable

mapping(uint256 => bytes32) help
Internal Variable

_balances Variable

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

_operatorApprovals Variable

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

_tokenApprovals Variable

mapping(uint256 => address) help
Internal Variable

_owners Variable

mapping(uint256 => address) help
Internal Variable

_nftBalances Variable

mapping(address => uint256) help
Internal Variable

NF_COLLECTION_MASK Variable

uint256 help
Internal Variable

_pausedCollections Variable

mapping(uint256 => bool) help
Internal Variable

_paused Variable

bool help
Internal Variable

_pausers Variable

Roles.Role help
Internal Variable

_relayHub Variable

address help
Internal Variable

_owner Variable

address help
Internal Variable

_minters Variable

Roles.Role help
Internal Variable

Functions Expand All Collapse All

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

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

getHubAddr keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

relayHubVersion keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function relayHubVersion() public view returns (string memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return "1.0.0";
}

preRelayedCall keyboard_arrow_up

Parameters help

Name Type
context
bytes help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function preRelayedCall(bytes calldata context) external returns (bytes32) {
  require(msg.sender == getHubAddr(), "GSNRecipient: caller is not RelayHub");
  return _preRelayedCall(context);
}

postRelayedCall keyboard_arrow_up

Parameters help

Name Type
context
bytes help
success
bool help
actualCharge
uint256 help
preRetVal
bytes32 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function postRelayedCall(
  bytes calldata context,
  bool success,
  uint256 actualCharge,
  bytes32 preRetVal
) external {
  require(msg.sender == getHubAddr(), "GSNRecipient: caller is not RelayHub");
  _postRelayedCall(context, success, actualCharge, preRetVal);
}

setGasToken keyboard_arrow_up

Parameters help

Name Type
gasTokenAddress
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function setGasToken(address gasTokenAddress) public onlyOwner {
  _gasToken = IERC20(gasTokenAddress);
}

setPayoutWallet keyboard_arrow_up

Parameters help

Name Type
payoutWallet
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
function setPayoutWallet(address payoutWallet) public onlyOwner {
  require(payoutWallet != address(this));
  _payoutWallet = payoutWallet;
}

setGasPrice keyboard_arrow_up

Parameters help

Name Type
gasPriceScaling
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function setGasPrice(uint256 gasPriceScaling) public onlyOwner {
  _gasPriceScaling = gasPriceScaling;
}

withdrawDeposits keyboard_arrow_up

Parameters help

Name Type
amount
uint256 help
payee
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function withdrawDeposits(uint256 amount, address payable payee)
  external
  onlyOwner
{
  _withdrawDeposits(amount, payee);
}

acceptRelayedCall keyboard_arrow_up

Parameters help

Name Type
address help
from
address help
bytes help
transactionFee
uint256 help
gasPrice
uint256 help
uint256 help
uint256 help
bytes help
maxPossibleCharge
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function acceptRelayedCall(
  address,
  address from,
  bytes memory,
  uint256 transactionFee,
  uint256 gasPrice,
  uint256,
  uint256,
  bytes memory,
  uint256 maxPossibleCharge
) public view returns (uint256, bytes memory) {
  if (
    _gasToken.balanceOf(from) <
    ((maxPossibleCharge * _gasPriceScaling) / GAS_PRICE_SCALING_SCALE)
  ) {
    return _rejectRelayedCall(uint256(ErrorCodes.INSUFFICIENT_BALANCE));
  }

  return
    _approveRelayedCall(
      abi.encode(from, maxPossibleCharge, transactionFee, gasPrice)
    );
}

isPauser keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

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

addPauser keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyPauser checks for the following:
null
Source Code
function addPauser(address account) public onlyPauser {
  _addPauser(account);
}

renouncePauser keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function renouncePauser() public {
  _removePauser(_msgSender());
}

paused keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function paused() public view returns (bool) {
  return _paused;
}

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyPauser checks for the following:
null
Source Code
function pause() public onlyPauser whenNotPaused {
  _paused = true;
  emit Paused(_msgSender());
}

unpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function unpause() public onlyPauser whenPaused {
  _paused = false;
  emit Unpaused(_msgSender());
}

pauseCollections keyboard_arrow_up

Parameters help

Name Type
collectionIds
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyPauser checks for the following:
null
Source Code
function pauseCollections(uint256[] memory collectionIds) public onlyPauser {
  for (uint256 i = 0; i < collectionIds.length; i++) {
    uint256 collectionId = collectionIds[i];
    require(!isNFT(collectionId)); // only works on collections
    _pausedCollections[collectionId] = true;
  }
  emit CollectionsPaused(collectionIds, _msgSender());
}

unpauseCollections keyboard_arrow_up

Parameters help

Name Type
collectionIds
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyPauser checks for the following:
null
Source Code
function unpauseCollections(uint256[] memory collectionIds) public onlyPauser {
  for (uint256 i = 0; i < collectionIds.length; i++) {
    uint256 collectionId = collectionIds[i];
    require(!isNFT(collectionId)); // only works on collections
    _pausedCollections[collectionId] = false;
  }
  emit CollectionsUnpaused(collectionIds, _msgSender());
}

collectionOf keyboard_arrow_up

Parameters help

Name Type
id
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
function collectionOf(uint256 id) public view returns (uint256) {
  require(isNFT(id));
  return id & NF_COLLECTION_MASK;
}

isFungible keyboard_arrow_up

Parameters help

Name Type
id
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function isFungible(uint256 id) public view returns (bool) {
  return id & (NF_BIT_MASK) == 0;
}

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) {
  require(isNFT(tokenId));
  address tokenOwner = _owners[tokenId];
  require(tokenOwner != address(0x0));
  return tokenOwner;
}

safeTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
id
uint256 help
value
uint256 help
data
bytes help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function safeTransferFrom(
  address from,
  address to,
  uint256 id,
  uint256 value,
  bytes memory data
) public whenNotPaused whenIdNotPaused(id) {
  super.safeTransferFrom(from, to, id, value, data);
}

safeBatchTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
ids
uint256[] help
values
uint256[] help
data
bytes help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function safeBatchTransferFrom(
  address from,
  address to,
  uint256[] memory ids,
  uint256[] memory values,
  bytes memory data
) public whenNotPaused {
  for (uint256 i = 0; i < ids.length; ++i) {
    require(!idPaused(ids[i]));
  }
  super.safeBatchTransferFrom(from, to, ids, values, data);
}

Parameters help

Name Type
tokenOwner
address help
id
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
function balanceOf(address tokenOwner, uint256 id)
  public
  view
  returns (uint256)
{
  require(tokenOwner != address(0x0));

  if (isNFT(id)) {
    return _owners[id] == tokenOwner ? 1 : 0;
  }

  return _balances[id][tokenOwner];
}

balanceOfBatch keyboard_arrow_up

Parameters help

Name Type
tokenOwners
address[] help
ids
uint256[] help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOfBatch(address[] memory tokenOwners, uint256[] memory ids)
  public
  view
  returns (uint256[] memory)
{
  require(tokenOwners.length == ids.length);

  uint256[] memory balances = new uint256[](tokenOwners.length);

  for (uint256 i = 0; i < tokenOwners.length; ++i) {
    require(tokenOwners[i] != address(0x0));

    uint256 id = ids[i];

    if (isNFT(id)) {
      balances[i] = _owners[id] == tokenOwners[i] ? 1 : 0;
    } else {
      balances[i] = _balances[id][tokenOwners[i]];
    }
  }

  return balances;
}

setApprovalForAll keyboard_arrow_up

Parameters help

Name Type
to
address help
approved
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function setApprovalForAll(address to, bool approved) public whenNotPaused {
  super.setApprovalForAll(to, approved);
}

isApprovedForAll keyboard_arrow_up

Parameters help

Name Type
tokenOwner
address help
operator
address help

Properties

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

Parameters help

Name Type
tokenOwner
address help

Properties

Visibility help public
Mutability help view

Requirements help

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

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
  whenNotPaused
  whenIdNotPaused(tokenId)
{
  super.approve(to, tokenId);
}

getApproved keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
null
Source Code
function getApproved(uint256 tokenId) public view returns (address) {
  require(isNFT(tokenId) && exists(tokenId));
  return _tokenApprovals[tokenId];
}

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
null
Source Code
function transferFrom(
  address from,
  address to,
  uint256 tokenId
) public whenNotPaused whenIdNotPaused(tokenId) {
  super.transferFrom(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

Requirements help

null
null
Source Code
function safeTransferFrom(
  address from,
  address to,
  uint256 tokenId
) public whenNotPaused whenIdNotPaused(tokenId) {
  super.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

Requirements help

null
null
Source Code
function safeTransferFrom(
  address from,
  address to,
  uint256 tokenId,
  bytes memory data
) public whenNotPaused whenIdNotPaused(tokenId) {
  super.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) public view returns (bool) {
  return (// ERC165 interface id
  interfaceId == 0x01ffc9a7 ||
    // ERC721 interface id
    interfaceId == 0x80ac58cd ||
    // ERC721Metadata interface id
    interfaceId == 0x5b5e139f ||
    // ERC721Exists interface id
    interfaceId == 0x4f558e79 ||
    // ERC1155 interface id
    interfaceId == 0xd9b67a26 ||
    // ERC1155AssetCollections interface id
    interfaceId == 0x09ce5c46 ||
    // ERC1155MetadataURI interface id
    interfaceId == 0x0e89341c);
}

exists keyboard_arrow_up

Parameters help

Name Type
id
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function exists(uint256 id) public view returns (bool) {
  address tokenOwner = _owners[id];
  return tokenOwner != address(0x0);
}

idPaused keyboard_arrow_up

Parameters help

Name Type
id
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function idPaused(uint256 id) public view returns (bool) {
  if (isNFT(id)) {
    return _pausedCollections[collectionOf(id)];
  } else {
    return _pausedCollections[id];
  }
}

createCollection keyboard_arrow_up

Parameters help

Name Type
collectionId
uint256 help
byteUri
bytes32 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null

Requirements help

Source Code
function createCollection(uint256 collectionId, bytes32 byteUri)
  external
  onlyMinter
{
  require(_ipfsMigrated ? uint256(byteUri) > 0 : uint256(byteUri) == 0);
  require(!isNFT(collectionId));
  _setURI(collectionId, byteUri);
}

batchMint keyboard_arrow_up

Parameters help

Name Type
to
address[] help
ids
uint256[] help
uris
bytes32[] help
values
uint256[] help
safe
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
function batchMint(
  address[] memory to,
  uint256[] memory ids,
  bytes32[] memory uris,
  uint256[] memory values,
  bool safe
) public onlyMinter {
  require(
    ids.length == to.length &&
      ids.length == uris.length &&
      ids.length == values.length
  );

  for (uint256 i = 0; i < ids.length; i++) {
    if (isNFT(ids[i]) && values[i] == 1) {
      _mintNonFungible(to[i], ids[i], uris[i], safe);
    } else if (isFungible(ids[i]) && uint256(uris[i]) == 0) {
      _mintFungible(to[i], ids[i], values[i]);
    } else {
      revert();
    }
  }
}

mintNonFungible keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
byteUri
bytes32 help
safe
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
function mintNonFungible(
  address to,
  uint256 tokenId,
  bytes32 byteUri,
  bool safe
) external onlyMinter {
  require(isNFT(tokenId)); // solium-disable-line error-reason
  _mintNonFungible(to, tokenId, byteUri, safe);
}

mintFungible keyboard_arrow_up

Parameters help

Name Type
to
address help
collection
uint256 help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null

Requirements help

Source Code
function mintFungible(
  address to,
  uint256 collection,
  uint256 value
) external onlyMinter {
  require(isFungible(collection));
  _mintFungible(to, collection, value);
}

setUriPrefix keyboard_arrow_up

Parameters help

Name Type
uriPrefix
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function setUriPrefix(string calldata uriPrefix) external onlyOwner {
  _uriPrefix = uriPrefix;
}

setIPFSUriPrefix keyboard_arrow_up

Parameters help

Name Type
ipfsUriPrefix
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function setIPFSUriPrefix(string calldata ipfsUriPrefix) external onlyOwner {
  _ipfsUriPrefix = ipfsUriPrefix;
}

setURI keyboard_arrow_up

Parameters help

Name Type
id
uint256 help
byteUri
bytes32 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null

Requirements help

Source Code
function setURI(uint256 id, bytes32 byteUri) external onlyMinter {
  require(!_ipfsMigrated && uint256(byteUri) > 0);
  require(exists(id));

  _setURI(id, byteUri);
}

migrateToIPFS keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
function migrateToIPFS() public onlyMinter {
  _ipfsMigrated = true;
}

uri keyboard_arrow_up

Parameters help

Name Type
id
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function uri(uint256 id) public view returns (string memory) {
  if (uint256(_uris[id]) == 0) {
    return _fullUriFromId(id);
  }

  return _fullUriFromHash(_uris[id]);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function name() external view returns (string memory) {
  return "F1® Delta Time Inventory";
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() external view returns (string memory) {
  return "F1DTI";
}

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 memory) {
  require(exists(tokenId));
  return uri(tokenId);
}

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 DeltaTimeInventory._mintNonFungible keyboard_arrow_up

Parameters help

Name Type
to
address help
id
uint256 help
byteUri
bytes32 help
safe
bool help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _mintNonFungible(
  address to,
  uint256 id,
  bytes32 byteUri,
  bool safe
) internal {
  require(to != address(0x0));
  require(!exists(id));

  uint256 collection = id & NF_COLLECTION_MASK;

  _owners[id] = to;
  _nftBalances[to] = SafeMath.add(_nftBalances[to], 1);
  _balances[collection][to] = SafeMath.add(_balances[collection][to], 1);

  emit Transfer(address(0x0), to, id);
  emit TransferSingle(_msgSender(), address(0x0), to, id, 1);

  _setURI(id, byteUri);

  if (safe) {
    require( // solium-disable-line error-reason
      _checkERC1155AndCallSafeTransfer(
        _msgSender(),
        address(0x0),
        to,
        id,
        1,
        "",
        false,
        false
      ),
      "failCheck"
    );
  }
}

internal DeltaTimeInventory._mintFungible keyboard_arrow_up

Parameters help

Name Type
to
address help
collection
uint256 help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mintFungible(
  address to,
  uint256 collection,
  uint256 value
) internal {
  require(to != address(0x0));
  require(value > 0);

  _balances[collection][to] = SafeMath.add(_balances[collection][to], value);

  emit TransferSingle(_msgSender(), address(0x0), to, collection, value);

  require( // solium-disable-line error-reason
    _checkERC1155AndCallSafeTransfer(
      _msgSender(),
      address(0x0),
      to,
      collection,
      value,
      "",
      false,
      false
    ),
    "failCheck"
  );
}

internal DeltaTimeInventory._setURI keyboard_arrow_up

Parameters help

Name Type
id
uint256 help
byteUri
bytes32 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setURI(uint256 id, bytes32 byteUri) internal {
  if (uint256(byteUri) > 0) {
    _uris[id] = byteUri;
    emit URI(_fullUriFromHash(byteUri), id);
  } else {
    emit URI(_fullUriFromId(id), id);
  }
}

internal DeltaTimeInventory._fullUriFromHash keyboard_arrow_up

Parameters help

Name Type
byteUri
bytes32 help

Properties

Visibility help private
Mutability help view
Source Code
function _fullUriFromHash(bytes32 byteUri)
  private
  view
  returns (string memory)
{
  return string(abi.encodePacked(_ipfsUriPrefix, Bytes.hash2base32(byteUri)));
}

internal DeltaTimeInventory._fullUriFromId keyboard_arrow_up

Parameters help

Name Type
id
uint256 help

Properties

Visibility help private
Mutability help view
Source Code
function _fullUriFromId(uint256 id) private view returns (string memory) {
  return
    string(abi.encodePacked(abi.encodePacked(_uriPrefix, Bytes.uint2str(id))));
}

internal AssetsInventory._setApprovalForAll keyboard_arrow_up

Parameters help

Name Type
sender
address help
operator
address help
approved
bool help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setApprovalForAll(
  address sender,
  address operator,
  bool approved
) internal {
  _operatorApprovals[sender][operator] = approved;
  emit ApprovalForAll(sender, operator, approved);
}

internal AssetsInventory.isNFT keyboard_arrow_up

Parameters help

Name Type
id
uint256 help

Properties

Visibility help internal
Mutability help view
Source Code
function isNFT(uint256 id) internal view returns (bool) {
  // A base type has the NF bit and an index
  return (id & (NF_BIT_MASK) != 0) && (id & (~NF_COLLECTION_MASK) != 0);
}

internal AssetsInventory._transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help
data
bytes help
safe
bool help

Properties

Visibility help internal
Mutability help transaction

Requirements help

null
null
Source Code
function _transferFrom(
  address from,
  address to,
  uint256 tokenId,
  bytes memory data,
  bool safe
) internal {
  require(to != address(0x0));
  require(isNFT(tokenId));

  address sender = _msgSender();
  bool operatable = (from == sender ||
    _operatorApprovals[from][sender] == true);

  _transferNonFungible(from, to, tokenId, operatable);

  emit Transfer(from, to, tokenId);
  emit TransferSingle(sender, from, to, tokenId, 1);

  require(
    _checkERC1155AndCallSafeTransfer(
      sender,
      from,
      to,
      tokenId,
      1,
      data,
      true,
      safe
    )
  );
}

internal AssetsInventory._transferNonFungible keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
id
uint256 help
operatable
bool help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transferNonFungible(
  address from,
  address to,
  uint256 id,
  bool operatable
) internal {
  require(from == _owners[id]);

  address sender = _msgSender();
  require(operatable || ownerOf(id) == sender || getApproved(id) == sender);

  // clear approval
  if (_tokenApprovals[id] != address(0x0)) {
    _tokenApprovals[id] = address(0x0);
  }

  uint256 nfCollection = id & NF_COLLECTION_MASK;
  _balances[nfCollection][from] = SafeMath.sub(
    _balances[nfCollection][from],
    1
  );
  _balances[nfCollection][to] = SafeMath.add(_balances[nfCollection][to], 1);

  _nftBalances[from] = SafeMath.sub(_nftBalances[from], 1);
  _nftBalances[to] = SafeMath.add(_nftBalances[to], 1);

  _owners[id] = to;
}

internal AssetsInventory._transferFungible keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
collectionId
uint256 help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _transferFungible(
  address from,
  address to,
  uint256 collectionId,
  uint256 value
) internal {
  _balances[collectionId][from] = SafeMath.sub(
    _balances[collectionId][from],
    value
  );
  _balances[collectionId][to] = SafeMath.add(
    _balances[collectionId][to],
    value
  );
}

internal AssetsInventory._checkERC721AndCallSafeTransfer keyboard_arrow_up

Parameters help

Name Type
operator
address help
from
address help
to
address help
tokenId
uint256 help
data
bytes help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _checkERC721AndCallSafeTransfer(
  address operator,
  address from,
  address to,
  uint256 tokenId,
  bytes memory data
) internal returns (bool) {
  if (!Address.isContract(to)) {
    return true;
  }
  return (IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) ==
    0x150b7a02); // 0x150b7a02: ERC721 receive magic value
}

internal AssetsInventory._checkERC1155AndCallSafeTransfer keyboard_arrow_up

Parameters help

Name Type
operator
address help
from
address help
to
address help
id
uint256 help
value
uint256 help
data
bytes help
erc721
bool help
erc721Safe
bool help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _checkERC1155AndCallSafeTransfer(
  address operator,
  address from,
  address to,
  uint256 id,
  uint256 value,
  bytes memory data,
  bool erc721,
  bool erc721Safe
) internal returns (bool) {
  if (!Address.isContract(to)) {
    return true;
  }
  if (erc721) {
    if (!_checkIsERC1155Receiver(to)) {
      if (erc721Safe) {
        return _checkERC721AndCallSafeTransfer(operator, from, to, id, data);
      } else {
        return true;
      }
    }
  }
  return
    IERC1155TokenReceiver(to).onERC1155Received(
      operator,
      from,
      id,
      value,
      data
    ) == 0xf23a6e61; // 0xf23a6e61: ERC1155 receive magic value
}

internal AssetsInventory._checkERC1155AndCallSafeBatchTransfer keyboard_arrow_up

Parameters help

Name Type
operator
address help
from
address help
to
address help
ids
uint256[] help
values
uint256[] help
data
bytes help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _checkERC1155AndCallSafeBatchTransfer(
  address operator,
  address from,
  address to,
  uint256[] memory ids,
  uint256[] memory values,
  bytes memory data
) internal returns (bool) {
  if (!Address.isContract(to)) {
    return true;
  }
  bytes4 retval = IERC1155TokenReceiver(to).onERC1155BatchReceived(
    operator,
    from,
    ids,
    values,
    data
  );
  return (retval == 0xbc197c81); // 0xbc197c81: ERC1155 batch receive magic value
}

internal AssetsInventory._checkIsERC1155Receiver keyboard_arrow_up

Parameters help

Name Type
_contract
address help

Properties

Visibility help internal
Mutability help view

Requirements help

Source Code
function _checkIsERC1155Receiver(address _contract)
  internal
  view
  returns (bool)
{
  bytes4 erc1155ReceiverID = 0x4e2312e0;
  bytes4 INTERFACE_ID_ERC165 = 0x01ffc9a7;
  bool success;
  uint256 result;
  // solium-disable-next-line security/no-inline-assembly
  assembly {
    let x := mload(0x40) // Find empty storage location using "free memory pointer"
    mstore(x, INTERFACE_ID_ERC165) // Place signature at beginning of empty storage
    mstore(add(x, 0x04), erc1155ReceiverID) // Place first argument directly next to signature

    success := staticcall(
      10000, // 10k gas
      _contract, // To addr
      x, // Inputs are stored at location x
      0x24, // Inputs are 36 bytes long
      x, // Store output over input (saves space)
      0x20
    ) // Outputs are 32 bytes long

    result := mload(x) // Load the result
  }
  // (10000 / 63) "not enough for supportsInterface(...)" // consume all gas, so caller can potentially know that there was not enough gas
  assert(gasleft() > 158);
  return success && result == 1;
}

internal Context.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {}

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 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 returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal Pausable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _paused = false;
}

internal Context.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {}

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 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 returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal PauserRole.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _addPauser(_msgSender());
}

internal PauserRole._addPauser keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _addPauser(address account) internal {
  _pausers.add(account);
  emit PauserAdded(account);
}

internal PauserRole._removePauser keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _removePauser(address account) internal {
  _pausers.remove(account);
  emit PauserRemoved(account);
}

internal Context.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {}

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 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 returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal ERC20Fees.constructor keyboard_arrow_up

Parameters help

Name Type
gasTokenAddress
address help
payoutWallet
address help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
constructor(address gasTokenAddress, address payoutWallet) internal {
  setGasToken(gasTokenAddress);
  setPayoutWallet(payoutWallet);
}

internal ERC20Fees._preRelayedCall keyboard_arrow_up

Parameters help

Name Type
context
bytes help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _preRelayedCall(bytes memory context) internal returns (bytes32) {
  (address from, uint256 maxPossibleCharge) = abi.decode(
    context,
    (address, uint256)
  );

  // The maximum token charge is pre-charged from the user
  require(
    _gasToken.transferFrom(
      from,
      _payoutWallet,
      (maxPossibleCharge * _gasPriceScaling) / GAS_PRICE_SCALING_SCALE
    )
  );
}

internal ERC20Fees._postRelayedCall keyboard_arrow_up

Parameters help

Name Type
context
bytes help
bool help
actualCharge
uint256 help
bytes32 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _postRelayedCall(
  bytes memory context,
  bool,
  uint256 actualCharge,
  bytes32
) internal {
  (
    address from,
    uint256 maxPossibleCharge,
    uint256 transactionFee,
    uint256 gasPrice
  ) = abi.decode(context, (address, uint256, uint256, uint256));

  // actualCharge is an _estimated_ charge, which assumes postRelayedCall will use all available gas.
  // This implementation's gas cost can be roughly estimated as 10k gas, for the two SSTORE operations in an
  // ERC20 transfer.
  uint256 overestimation = _computeCharge(
    SafeMath.sub(POST_RELAYED_CALL_MAX_GAS, 10000),
    gasPrice,
    transactionFee
  );
  actualCharge = SafeMath.sub(actualCharge, overestimation);

  // After the relayed call has been executed and the actual charge estimated, the excess pre-charge is returned
  require(
    _gasToken.transferFrom(
      _payoutWallet,
      from,
      (SafeMath.sub(maxPossibleCharge, actualCharge) * _gasPriceScaling) /
        GAS_PRICE_SCALING_SCALE
    )
  );
}

internal GSNRecipient._upgradeRelayHub keyboard_arrow_up

Parameters help

Name Type
newRelayHub
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _upgradeRelayHub(address newRelayHub) internal {
  address currentRelayHub = _relayHub;
  require(
    newRelayHub != address(0),
    "GSNRecipient: new RelayHub is the zero address"
  );
  require(
    newRelayHub != currentRelayHub,
    "GSNRecipient: new RelayHub is the current one"
  );

  emit RelayHubChanged(currentRelayHub, newRelayHub);

  _relayHub = newRelayHub;
}

internal GSNRecipient._withdrawDeposits keyboard_arrow_up

Parameters help

Name Type
amount
uint256 help
payee
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _withdrawDeposits(uint256 amount, address payable payee) internal {
  IRelayHub(_relayHub).withdraw(amount, payee);
}

internal GSNRecipient._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view returns (address payable) {
  if (msg.sender != _relayHub) {
    return msg.sender;
  } else {
    return _getRelayedCallSender();
  }
}

internal GSNRecipient._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view returns (bytes memory) {
  if (msg.sender != _relayHub) {
    return msg.data;
  } else {
    return _getRelayedCallData();
  }
}

internal GSNRecipient._preRelayedCall keyboard_arrow_up

Parameters help

Name Type
context
bytes help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _preRelayedCall(bytes memory context) internal returns (bytes32);

internal GSNRecipient._postRelayedCall keyboard_arrow_up

Parameters help

Name Type
context
bytes help
success
bool help
actualCharge
uint256 help
preRetVal
bytes32 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _postRelayedCall(
  bytes memory context,
  bool success,
  uint256 actualCharge,
  bytes32 preRetVal
) internal;

internal GSNRecipient._approveRelayedCall keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help pure
Source Code
function _approveRelayedCall() internal pure returns (uint256, bytes memory) {
  return _approveRelayedCall("");
}

internal GSNRecipient._approveRelayedCall keyboard_arrow_up

Parameters help

Name Type
context
bytes help

Properties

Visibility help internal
Mutability help pure
Source Code
function _approveRelayedCall(bytes memory context)
  internal
  pure
  returns (uint256, bytes memory)
{
  return (RELAYED_CALL_ACCEPTED, context);
}

internal GSNRecipient._rejectRelayedCall keyboard_arrow_up

Parameters help

Name Type
errorCode
uint256 help

Properties

Visibility help internal
Mutability help pure
Source Code
function _rejectRelayedCall(uint256 errorCode)
  internal
  pure
  returns (uint256, bytes memory)
{
  return (RELAYED_CALL_REJECTED + errorCode, "");
}

internal GSNRecipient._computeCharge keyboard_arrow_up

Parameters help

Name Type
gas
uint256 help
gasPrice
uint256 help
serviceFee
uint256 help

Properties

Visibility help internal
Mutability help pure
Source Code
function _computeCharge(
  uint256 gas,
  uint256 gasPrice,
  uint256 serviceFee
) internal pure returns (uint256) {
  // The fee is expressed as a percentage. E.g. a value of 40 stands for a 40% fee, so the recipient will be
  // charged for 1.4 times the spent amount.
  return (gas * gasPrice * (100 + serviceFee)) / 100;
}

internal GSNRecipient._getRelayedCallSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help private
Mutability help pure
Source Code
function _getRelayedCallSender() private pure returns (address payable result) {
  // We need to read 20 bytes (an address) located at array index msg.data.length - 20. In memory, the array
  // is prefixed with a 32-byte length value, so we first add 32 to get the memory read index. However, doing
  // so would leave the address in the upper 20 bytes of the 32-byte word, which is inconvenient and would
  // require bit shifting. We therefore subtract 12 from the read index so the address lands on the lower 20
  // bytes. This can always be done due to the 32-byte prefix.

  // The final memory read index is msg.data.length - 20 + 32 - 12 = msg.data.length. Using inline assembly is the
  // easiest/most-efficient way to perform this operation.

  // These fields are not accessible from assembly
  bytes memory array = msg.data;
  uint256 index = msg.data.length;

  // solhint-disable-next-line no-inline-assembly
  assembly {
    // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
    result := and(
      mload(add(array, index)),
      0xffffffffffffffffffffffffffffffffffffffff
    )
  }
  return result;
}

internal GSNRecipient._getRelayedCallData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help private
Mutability help pure
Source Code
function _getRelayedCallData() private pure returns (bytes memory) {
  // RelayHub appends the sender address at the end of the calldata, so in order to retrieve the actual msg.data,
  // we must strip the last 20 bytes (length of an address type) from it.

  uint256 actualDataLength = msg.data.length - 20;
  bytes memory actualData = new bytes(actualDataLength);

  for (uint256 i = 0; i < actualDataLength; ++i) {
    actualData[i] = msg.data[i];
  }

  return actualData;
}

internal Context.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {}

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 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 returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

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 Ownable._transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help internal
Mutability help transaction

Requirements help

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

internal Context.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {}

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 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 returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal MinterRole.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _addMinter(_msgSender());
}

internal MinterRole._addMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _addMinter(address account) internal {
  _minters.add(account);
  emit MinterAdded(account);
}

internal MinterRole._removeMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _removeMinter(address account) internal {
  _minters.remove(account);
  emit MinterRemoved(account);
}

internal Context.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {}

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 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 returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}