ODCdataManagersERC1155linked-with-erc20-dm-with-callback

ERC20FractionWithCallbackDataManager

Contract for managing ERC20 fractions with Callback of an ERC1155 token

WrongParameters

error WrongParameters()

Error thrown when the params are wrong

WrongCaller

error WrongCaller()

Error thrown when the caller is not the fungible fractions data object

UnsupportedCallback

error UnsupportedCallback()

Error thrown when the callback function called is not supported

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

erc1155ID

uint256 erc1155ID

ERC1155 token ID

onlyFFDO

modifier onlyFFDO()

Modifier to check if the caller is the fungible fractions data object

constructor

constructor() public

initialize

function initialize(bytes32 datapoint_, address _dataIndex, address _fungibleFractionsDO, 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, 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

afterFungibleFractionTransfer

function afterFungibleFractionTransfer(address from, address to, uint256, uint256 value) external

Function called after a single id token transfer

Parameters

NameTypeDescription
fromaddressThe address from which the token was transferred
toaddressThe address to which the token was transferred
uint256
valueuint256The amount of the token transferred

afterFungibleFractionTransfer

function afterFungibleFractionTransfer(address, address, uint256[], uint256[]) external view

Function called after a batch of id tokens transfer

Parameters

NameTypeDescription
address
address
uint256[]
uint256[]

transfer

function transfer(address to, uint256 amount) external returns (bool)

transferFrom

function transferFrom(address from, address to, uint256 amount) external returns (bool)

_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)