OmnichainERC1155DataManager
Contract for managing an Omnichain ERC1155 token using a Omnichain Fungible Fractions Data Object
_This contract is used to manage an Omnichain ERC1155 token where a Data Object contract is used to store the token data on that chain.
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 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
constructor
registerOmnichainIncreaseBalanceHandler
Function to register this contract as an omnichain increase balance handler NOTE: This function must be called after the contract is deployed
afterOmnichainFungibleFractionsIncreaseBalanceOnTargetChain
Function called after a token transfer on target chain
Verifies success of transfer (if to is a contract, additional calls verifying it can accept tokens can be made)
Parameters
| Name | Type | Description |
|---|---|---|
| from | OmnichainAddress | The address from which the token was transferred |
| to | address | The address to which the token was transferred |
| id | uint256 | Id of the token |
| value | uint256 | The amount of the token transferred |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | If transfer verification successfull |
afterOmnichainFungibleFractionsIncreaseBalanceOnTargetChain
Function called after a batch token transfer on target chain
Verifies success of transfer (if to is a contract, additional calls verifying it can accept tokens can be made)
Parameters
| Name | Type | Description |
|---|---|---|
| from | OmnichainAddress | The address from which the token was transferred |
| to | address | The address to which the token was transferred |
| ids | uint256[] | Ids of the tokens |
| values | uint256[] | The amounts of the tokens transferred |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | If transfer verification successfull |
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 |

