OmnichainUpgradeableERC1155DataManager
Contract for managing an Upgradeable Omnichain ERC1155 token using a Omnichain Fungible Fractions Data Object
_This contract is used to manage an Upgradeable Omnichain ERC1155 token where a Data Object contract is used to store the token data.
WrongParameters
Error thrown when the parameters are wrong
OmnichainMintBurnNotSupported
Error thrown when the from or to address is the zero address in a transfer
UnauthorizedCaller
Error thrown when the caller is not the Omnichain Fungible Fractions Data Object
NotRegisteredAsOmnichainIncreaseBalanceHandler
Error thrown when the contract is not registered as an Omnichain Increase Balance handler
_isRegisteredAsOmnichainIncreaseBalanceHandler
Variable to know if the contract is registered as an Omnichain Increase Balance handler
_datapoint
The Data Point identifier for the Omnichain Fungible Fractions Data Object
fungibleFractionsDO
The Omnichain Fungible Fractions Data Object
dataIndex
The Data Index implementation
constructor
initialize
__OmnichainUpgradeableERC1155DataManager_init
registerOmnichainIncreaseBalanceHandler
Function to register this contract as an omnichain increase balance handler NOTE: This function must be called after the contract is deployed
afterOmnichainFungibleFractionsIncreaseBalanceOnTargetChain
This function is called by the Omnichain Fungible Fractions Data Object to perform necessary checks and emit events
afterOmnichainFungibleFractionsIncreaseBalanceOnTargetChain
This function is called by the Omnichain Fungible Fractions Data Object to perform necessary checks and emit events
afterOmnichainFungibleFractionsFailedRefund
Function called if normal token refund procedure failed and balance of this
contract (the one which is called) is increased
Parameters
Name | Type | Description |
---|---|---|
OmnichainAddress | ||
to | OmnichainAddress | The address to which the token was originally transferred |
address | ||
ids | uint256[] | Ids of the tokens |
values | uint256[] | The amounts of the tokens transferred |
recoverTokens
Allows contract owner to transfer tokens which was sent to this contract Can be used to recover failed refunds
If onERC1155Received
will be added in an overriding contract, it should also override this function
and maybe afterOmnichainFungibleFractionsFailedRefund
to implement more sophisticated refund mechanics.
Parameters
Name | Type | Description |
---|---|---|
to | address | Destination address |
ids | uint256[] | Array of token IDs |
values | uint256[] | Array of amounts of tokens to transfer |
supportsInterface
_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
Set the URI for a token id
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | The token id |
tokenURI | string | The URI to set |
setBaseURI
Set the base URI for all token ids
Parameters
Name | Type | Description |
---|---|---|
baseURI | string | The base URI to set |
setDefaultURI
Set the default URI for all token ids
Parameters
Name | Type | Description |
---|---|---|
defaultURI | string | The default URI to set |
totalSupply
Returns the total supply of all tokens
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The total supply |
totalSupply
Returns the total supply of a specific token id
Parameters
Name | Type | Description |
---|---|---|
id | uint256 | The token id |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The total supply of the token id |
balanceOf
Returns the value of tokens of token type id
owned by account
.
balanceOfBatch
_xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
Requirements:
accounts
andids
must have the same length._
_checkMinter
SHOULD throw an error if the sender is not allowed to mint