ODCdataManagersERC1155linked-with-erc20-dm

ERC20FractionDataManager

Contract for managing ERC20 fractions of an ERC1155 token

This contract is used to manage fractions of an ERC1155WithERC20FractionsDataManager contract as a ERC20 token, exposing the ERC20 functionalities and emitting the Transfer event Mint/burn functionality is not added here, instead one can mint/burn via ERC1155 counterpart

WrongParameters

error WrongParameters()

Error thrown when the params are wrong

ContractNotInitialized

error ContractNotInitialized()

Error thrown when the contract is not initialized

_datapoint

DataPoint _datapoint

DataPoint used in the fungibleFractions data object

fungibleFractionsDO

contract IDataObject fungibleFractionsDO

Fungible Fractions Data Object contract

dataIndex

contract IDataIndex dataIndex

Data Index implementation

erc1155dm

address erc1155dm

ERC1155 data manager contract

erc1155ID

uint256 erc1155ID

ERC1155 token ID

onlyTransferNotifier

modifier onlyTransferNotifier()

Modifier to check if the caller is the ERC1155 data manager

initialize

function initialize(bytes32 datapoint_, address _dataIndex, address _fungibleFractionsDO, address _erc1155dm, uint256 _erc1155ID, string name_, string symbol_) external

Initializes the ERC20 Fraction Data Manager

__ERC20FractionDataManager_init_unchained

function __ERC20FractionDataManager_init_unchained(bytes32 datapoint_, address _dataIndex, address _fungibleFractionsDO, address _erc1155dm, uint256 _erc1155ID) internal

totalSupply

function totalSupply() external view returns (uint256)

Total supply of the ERC20 token

This function reads the total supply from the fungible fractions data object NOTE: This total supply is equal to the amount of fractions of the ERC1155 token with the id erc1155ID

Return Values

NameTypeDescription
[0]uint256The amount of ERC20 tokens in circulation

balanceOf

function balanceOf(address account) external view returns (uint256)

Balance of an account

This function reads the balance of the account from the fungible fractions data object NOTE: This balance is equal to the amount of fractions of the ERC1155 token with the id erc1155ID the account has

Parameters

NameTypeDescription
accountaddressThe account to check the balance of

Return Values

NameTypeDescription
[0]uint256The amount of ERC20 tokens the account has

fractionTransferredNotify

function fractionTransferredNotify(address from, address to, uint256 amount) external

Notify the transfer of a fraction

Parameters

NameTypeDescription
fromaddressThe address from which the fraction is transferred
toaddressThe address to which the fraction is transferred
amountuint256

_writeTransfer

function _writeTransfer(address from, address to, uint256 amount) internal

_msgSender

function _msgSender() internal view returns (address)

_msgData

function _msgData() internal view returns (bytes)

_contextSuffixLength

function _contextSuffixLength() internal view returns (uint256)