ODCdataManagersERC1155

ERC1155DataManager

Contract for managing ERC1155 token using a Fungible Fractions Data Object

This contract is used to manage an ERC1155 token where a Data Object contract is used to store the token data This contract MUST be approved to interact to the data point associated with the fungible fractions data object

WrongParameters

error WrongParameters()

Error thrown when the parameters are wrong

_datapoint

DataPoint _datapoint

The Data Point identifier for the Fungible Fractions Data Object

fungibleFractionsDO

contract IDataObject fungibleFractionsDO

The Fungible Fractions Data Object

dataIndex

contract IDataIndex dataIndex

The Data Index implementation

constructor

constructor(bytes32 datapoint_, address _dataIndex, address _fungibleFractionsDO, string name_, string symbol_) public

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

_Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._

setURI

function setURI(uint256 tokenId, string tokenURI) external

Set the URI for a token id

Parameters

NameTypeDescription
tokenIduint256The token id
tokenURIstringThe URI to set

setBaseURI

function setBaseURI(string baseURI) external

Set the base URI for all token ids

Parameters

NameTypeDescription
baseURIstringThe base URI to set

setDefaultURI

function setDefaultURI(string defaultURI) external

Set the default URI for all token ids

Parameters

NameTypeDescription
defaultURIstringThe default URI to set

totalSupply

function totalSupply() public view returns (uint256)

Returns the total supply of all tokens

Return Values

NameTypeDescription
[0]uint256The total supply

totalSupply

function totalSupply(uint256 id) public view returns (uint256)

Returns the total supply of a specific token id

Parameters

NameTypeDescription
iduint256The token id

Return Values

NameTypeDescription
[0]uint256The total supply of the token id

balanceOf

function balanceOf(address account, uint256 id) public view returns (uint256)

Returns the value of tokens of token type id owned by account.

balanceOfBatch

function balanceOfBatch(address[] accounts, uint256[] ids) public view returns (uint256[])

_xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.

Requirements:

  • accounts and ids must have the same length._

_checkMinter

function _checkMinter() internal view

SHOULD throw an error if the sender is not allowed to mint

_writeTransfer

function _writeTransfer(address from, address to, uint256 id, uint256 value) internal virtual

_writeTransferBatch

function _writeTransferBatch(address from, address to, uint256[] ids, uint256[] values) internal virtual

On this page