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 thrown when the params are wrong
ContractNotInitialized
Error thrown when the contract is not initialized
_datapoint
DataPoint used in the fungibleFractions data object
fungibleFractionsDO
Fungible Fractions Data Object contract
dataIndex
Data Index implementation
erc1155dm
ERC1155 data manager contract
erc1155ID
ERC1155 token ID
onlyTransferNotifier
Modifier to check if the caller is the ERC1155 data manager
initialize
Initializes the ERC20 Fraction Data Manager
__ERC20FractionDataManager_init_unchained
totalSupply
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
Name | Type | Description |
---|---|---|
[0] | uint256 | The amount of ERC20 tokens in circulation |
balanceOf
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
Name | Type | Description |
---|---|---|
account | address | The account to check the balance of |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The amount of ERC20 tokens the account has |
fractionTransferredNotify
Notify the transfer of a fraction
Parameters
Name | Type | Description |
---|---|---|
from | address | The address from which the fraction is transferred |
to | address | The address to which the fraction is transferred |
amount | uint256 |