TokenWrapperToERC1155WithERC20FractionsDataManager
Contract for wrapping tokens into an ERC1155 and fractionalizing them through an ERC20 token
WrongWrappedObjectType
Error thrown when the wrapped type of the function is different of the token type
VaultNotInitialized
Error thrown when the vault is not initialized
VaultAlreadyInitialized
Error thrown when the vault is already initialized
MintNotSupported
Error thrown when mint function is called directly
TransferNotSuccessful
Error thrown when the transfer is not successful
ObjectWrapped
Event emitted when a token is wrapped
ObjectUnwrapped
Event emitted when a token is unwrapped
WrappedObjectType
Enum for the wrapped object type NOTE: The token types that can be wrapped are ERC20, ERC721, ERC1155 and ERC3643
WrappedObject
Struct for the wrapped object
Parameters
Name | Type | Description |
---|
vaultDO
The Data Point identifier for the Vault Data Object
vault
The Vault where the wrapped tokens are stored
_wrappedObjects
Mapping of the wrapped objects
constructor
initialize
Deploy vault in order to be ready to receive assets
This function MUST be called right after the constructor. Otherwise, wrapping and unwrapping will fail
Parameters
Name | Type | Description |
---|---|---|
_vaultFactory | address | An already deployed vault factory following GenericVaultFactory |
mint
Mint only supported via wrapping
wrapAndFractionalizeERC20
Wrap ERC20 tokens on a NFT (WrappedObject) and fractionalize it
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC20 | Token to wrap |
value | uint256 | Amount of tokens to wrap |
fractions | uint256 | Number of fractions to mint |
wrapAndFractionalizeERC721
Wrap ERC721 tokens on a NFT (WrappedObject) and fractionalize it
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC721 | Token to wrap |
id | uint256 | Token ID to wrap |
fractions | uint256 | Number of fractions to mint |
wrapAndFractionalizeERC721Batch
Wrap a batch of ERC721 tokens on a NFT (WrappedObject) and fractionalize it
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC721 | Token to wrap |
ids | uint256[] | Token IDs to wrap |
fractions | uint256 | Number of fractions to mint |
wrapAndFractionalizeERC1155
Wrap ERC1155 tokens on a NFT (WrappedObject) and fractionalize it
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC1155 | Token to wrap |
id | uint256 | Token ID to wrap |
value | uint256 | Amount of tokens to wrap |
erc1155TransferData | bytes | Additional data for the ERC1155 transfer |
fractions | uint256 | Number of fractions to mint |
wrapAndFractionalizeERC1155Batch
Wrap a batch of ERC1155 tokens on a NFT (WrappedObject) and fractionalize it
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC1155 | Token to wrap |
ids | uint256[] | Token IDs to wrap |
values | uint256[] | Amount of tokens to wrap |
erc1155TransferData | bytes | Additional data for the ERC1155 transfer |
fractions | uint256 | Number of fractions to mint |
wrapAndFractionalizeERC3643
Wrap ERC3643 tokens on a NFT (WrappedObject) and fractionalize it
Parameters
Name | Type | Description |
---|---|---|
token | contract IToken | Token to wrap |
value | uint256 | Amount of tokens to wrap |
fractions | uint256 | Number of fractions to mint |
wrapAndFractionalizeERC1400
Wrap ERC1400 tokens on a NFT (WrappedObject) and fractionalize it
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC1400 | Token to wrap |
value | uint256 | Amount of tokens to wrap |
fractions | uint256 | Number of fractions to mint |
data | bytes |
unwrapERC20
Unwrap previously wrapped ERC20 tokens
Sender MUST be owner of all minted Fractions
Parameters
Name | Type | Description |
---|---|---|
wid | uint256 | ID of Wrapped Object issued on wrapping |
unwrapERC721
Unwrap previously wrapped ERC721 tokens
Sender MUST be owner of all minted Fractions
Parameters
Name | Type | Description |
---|---|---|
wid | uint256 | ID of Wrapped Object issued on wrapping |
unwrapERC721Batch
Unwrap previously wrapped batch of ERC721 tokens
Sender MUST be owner of all minted Fractions
Parameters
Name | Type | Description |
---|---|---|
wid | uint256 | ID of Wrapped Object issued on wrapping |
unwrapERC1155
Unwrap previously wrapped ERC1155 tokens
Sender MUST be owner of all minted Fractions
Parameters
Name | Type | Description |
---|---|---|
wid | uint256 | ID of Wrapped Object issued on wrapping |
unwrapERC1155Batch
Unwrap previously wrapped batch of ERC1155 tokens
Sender MUST be owner of all minted Fractions
Parameters
Name | Type | Description |
---|---|---|
wid | uint256 | ID of Wrapped Object issued on wrapping |
unwrapERC3643
Unwrap previously wrapped ERC3643 tokens
Sender MUST be owner of all minted Fractions
Parameters
Name | Type | Description |
---|---|---|
wid | uint256 | ID of Wrapped Object issued on wrapping |
unwrapERC1400
Unwrap previously wrapped ERC1400 tokens
Sender MUST be owner of all minted Fractions
Parameters
Name | Type | Description |
---|---|---|
wid | uint256 | ID of Wrapped Object issued on wrapping |
data | bytes |
_wrapERC20
Wrap ERC20 tokens on a NFT (WrappedObject)
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC20 | Token to wrap |
value | uint256 | Amount of tokens to wrap |
_wrapERC721
Wrap ERC721 tokens on a NFT (WrappedObject)
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC721 | Token to wrap |
id | uint256 | Token ID to wrap |
_wrapERC721Batch
Wrap a batch of ERC721 tokens on a NFT (WrappedObject)
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC721 | Token to wrap |
ids | uint256[] | Token IDs to wrap |
_wrapERC1155
Wrap ERC1155 tokens on a NFT (WrappedObject)
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC1155 | Token to wrap |
id | uint256 | Token ID to wrap |
value | uint256 | Amount of tokens to wrap |
erc1155TransferData | bytes | Additional data for the ERC1155 transfer |
_wrapERC1155Batch
Wrap a batch of ERC1155 tokens on a NFT (WrappedObject)
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC1155 | Token to wrap |
ids | uint256[] | Token IDs to wrap |
values | uint256[] | Amount of tokens to wrap |
erc1155TransferData | bytes | Additional data for the ERC1155 transfer |
_wrapERC3643
Wrap ERC3643 tokens on a NFT (WrappedObject)
NOTE: As ERC3643 doesn't support safe transfers, we MUST ensure destination is able to handle the token sent.
Parameters
Name | Type | Description |
---|---|---|
token | contract IToken | Token to wrap |
value | uint256 | Amount of tokens to wrap |
_wrapERC1400
Wrap ERC1400 tokens on a NFT (WrappedObject)
NOTE: As ERC1400 doesn't support safe transfers, we MUST ensure destination is able to handle the token sent.
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC1400 | Token to wrap |
value | uint256 | Amount of tokens to wrap |
data | bytes |