Wrapper
vaultDO
The Vault Data Object
_datapoint
The Data Point identifier for the Vault Data Object
dataIndex
The Data Index implementation
vaultFactory
The address of the Vault Factory
vaults
Mapping of nftId to the vault address
_wrappedObjects
Mapping of wrapped object index to Wrapped Object
_nftTokens
Mapping of nftId to enumerable map of token address to wrapped object index
_isApprovedForSpendingApprovedAssets
mapping of owner address to mapping of spender address to boolean NOTE: If address1 approves address2 then address2 can spend the approved tokens of address1 (by calling providerWrapAssets or providerWrapAssetsOnExistingNft)
constructor
initialize
__Wrapper_init
__Wrapper_init_unchained
_authorizeUpgrade
_Function that should revert when msg.sender
is not authorized to upgrade the contract. Called by
{upgradeToAndCall}.
Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
removeSpenderOfApprovedAssets
wrapAssets
Wrap assets on a newly created ERC721 token
Parameters
Name | Type | Description |
---|---|---|
wtypes | enum IWrapper.WrappedObjectType[] | Array of the types of the assets (ERCs) |
tokens | address[] | Array of the addresses of the tokens |
ids | uint256[] | Array of the ids of the tokens (not needed for fungible assets) |
values | uint256[] | Array of the values of the tokens (not needed for non-fungible assets) |
wrapAssetsOnExistingNft
Wrap assets on an already existing ERC721 token
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The id of the existing ERC721 token |
wtypes | enum IWrapper.WrappedObjectType[] | Array of the types of the assets (ERCs) |
tokens | address[] | Array of the addresses of the tokens |
ids | uint256[] | Array of the ids of the tokens (not needed for fungible assets) |
values | uint256[] | Array of the values of the tokens (not needed for non-fungible assets) |
providerWrapAssets
Wrap assets on a newly created ERC721 token, where tokens are acquired from provider and the new ERC721 is provided to the beneficiary
Parameters
Name | Type | Description |
---|---|---|
input | struct IWrapper.ProviderWrapAssetsInput | The input of the function. (Struct is described above) |
providerWrapAssetsOnExistingNft
Wrap assets on an already existing ERC721 token, where tokens are acquired from provider
Parameters
Name | Type | Description |
---|---|---|
input | struct IWrapper.ProviderWrapAssetsOnExistingNftInput | The input of the function. (Struct is described above) |
partiallyUnwrapAssets
Partially unwrap assets from an already existing ERC721 token
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The id of the existing ERC721 token |
tokens | address[] | Array of the addresses of the tokens |
ids | uint256[] | Array of the ids of the tokens (not needed for fungible assets) |
values | uint256[] | Array of the values of the tokens (not needed for non-fungible assets) |
fullyUnwrapAssets
Fully unwrap assets from an already existing ERC721 token
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The id of the existing ERC721 token |
percentageBeneficiaryPartiallyUnwrapAssets
Partially unwrap assets from an already existing ERC721 token, where from each asset a percentage of value is unwrapped, and the receiver is beneficiary
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The id of the existing ERC721 token |
percentage | uint256 | The percentage of each token's value to be unwrapped |
skipNonPercentageWtypes | bool | True if not percentage types should be skipped (NON-FUNGIBLE ASSETS) and false if not |
beneficiary | address | The address that receives the unwrapped assets |
beneficiaryPartiallyUnwrapAssets
Partially unwrap assets from an already existing ERC721 token, where tokens unwrapped are provided to beneficiary
Parameters
Name | Type | Description |
---|---|---|
input | struct IWrapper.BeneficiaryPartiallyUnwrapAssetsInput | The input of the function. (Struct is described above) |
beneficiaryFullyUnwrapAssets
Fully unwrap assets from an already existing ERC721 token, where beneficiary receives the unwrapped assets
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The id of the existing ERC721 token |
beneficiary | address | The address that receives the unwrapped assets |
execute
Function for executing transactions on wrapped assets
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | The id of the ERC721 token |
token | address | The address of the token to execute transactions for |
input | bytes | Input needed for the transaction execution |
_wrapERC20
Wrap ERC20 tokens.
Parameters
Name | Type | Description |
---|---|---|
nftId | uint256 | |
token | contract IERC20 | Token to wrap. |
value | uint256 | Amount of token to wrap. |
beneficiary | address | The address to acquire the tokens from. |
_wrapERC721
_wrapERC1155
_unwrapERC20
Unwrap previously wrapped ERC20 tokens