ODCdataManagerswrappers

Wrapper

vaultDO

contract IDataObject vaultDO

The Vault Data Object

_datapoint

DataPoint _datapoint

The Data Point identifier for the Vault Data Object

dataIndex

contract IDataIndex dataIndex

The Data Index implementation

vaultFactory

address vaultFactory

The address of the Vault Factory

vaults

mapping(uint256 => address) vaults

Mapping of nftId to the vault address

_wrappedObjects

mapping(uint256 => struct IWrapper.WrappedObject) _wrappedObjects

Mapping of wrapped object index to Wrapped Object

_nftTokens

mapping(uint256 => struct EnumerableMap.AddressToUintMap) _nftTokens

Mapping of nftId to enumerable map of token address to wrapped object index

_isApprovedForSpendingApprovedAssets

mapping(address => mapping(address => bool)) _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

constructor() public

initialize

function initialize(bytes32 dp, address dataIndex_, address vaultDO_, address vaultFactory_, string name_, string symbol_) external

__Wrapper_init

function __Wrapper_init(bytes32 dp, address dataIndex_, address vaultDO_, address vaultFactory_, string name_, string symbol_) internal

__Wrapper_init_unchained

function __Wrapper_init_unchained(bytes32 dp, address dataIndex_, address vaultDO_, address vaultFactory_) internal

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

_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}.

function _authorizeUpgrade(address) internal onlyOwner {}
```_
 
### approveSpenderOfApprovedAssets
 
```solidity
function approveSpenderOfApprovedAssets(address spender) external

removeSpenderOfApprovedAssets

function removeSpenderOfApprovedAssets(address spender) external

wrapAssets

function wrapAssets(enum IWrapper.WrappedObjectType[] wtypes, address[] tokens, uint256[] ids, uint256[] values) external returns (uint256)

Wrap assets on a newly created ERC721 token

Parameters

NameTypeDescription
wtypesenum IWrapper.WrappedObjectType[]Array of the types of the assets (ERCs)
tokensaddress[]Array of the addresses of the tokens
idsuint256[]Array of the ids of the tokens (not needed for fungible assets)
valuesuint256[]Array of the values of the tokens (not needed for non-fungible assets)

wrapAssetsOnExistingNft

function wrapAssetsOnExistingNft(uint256 nftId, enum IWrapper.WrappedObjectType[] wtypes, address[] tokens, uint256[] ids, uint256[] values) external

Wrap assets on an already existing ERC721 token

Parameters

NameTypeDescription
nftIduint256The id of the existing ERC721 token
wtypesenum IWrapper.WrappedObjectType[]Array of the types of the assets (ERCs)
tokensaddress[]Array of the addresses of the tokens
idsuint256[]Array of the ids of the tokens (not needed for fungible assets)
valuesuint256[]Array of the values of the tokens (not needed for non-fungible assets)

providerWrapAssets

function providerWrapAssets(struct IWrapper.ProviderWrapAssetsInput input) public returns (uint256)

Wrap assets on a newly created ERC721 token, where tokens are acquired from provider and the new ERC721 is provided to the beneficiary

Parameters

NameTypeDescription
inputstruct IWrapper.ProviderWrapAssetsInputThe input of the function. (Struct is described above)

providerWrapAssetsOnExistingNft

function providerWrapAssetsOnExistingNft(struct IWrapper.ProviderWrapAssetsOnExistingNftInput input) public

Wrap assets on an already existing ERC721 token, where tokens are acquired from provider

Parameters

NameTypeDescription
inputstruct IWrapper.ProviderWrapAssetsOnExistingNftInputThe input of the function. (Struct is described above)

partiallyUnwrapAssets

function partiallyUnwrapAssets(uint256 nftId, address[] tokens, uint256[] ids, uint256[] values) external

Partially unwrap assets from an already existing ERC721 token

Parameters

NameTypeDescription
nftIduint256The id of the existing ERC721 token
tokensaddress[]Array of the addresses of the tokens
idsuint256[]Array of the ids of the tokens (not needed for fungible assets)
valuesuint256[]Array of the values of the tokens (not needed for non-fungible assets)

fullyUnwrapAssets

function fullyUnwrapAssets(uint256 nftId) external

Fully unwrap assets from an already existing ERC721 token

Parameters

NameTypeDescription
nftIduint256The id of the existing ERC721 token

percentageBeneficiaryPartiallyUnwrapAssets

function percentageBeneficiaryPartiallyUnwrapAssets(uint256 nftId, uint256 percentage, bool skipNonPercentageWtypes, address beneficiary) external

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

NameTypeDescription
nftIduint256The id of the existing ERC721 token
percentageuint256The percentage of each token's value to be unwrapped
skipNonPercentageWtypesboolTrue if not percentage types should be skipped (NON-FUNGIBLE ASSETS) and false if not
beneficiaryaddressThe address that receives the unwrapped assets

beneficiaryPartiallyUnwrapAssets

function beneficiaryPartiallyUnwrapAssets(struct IWrapper.BeneficiaryPartiallyUnwrapAssetsInput input) public

Partially unwrap assets from an already existing ERC721 token, where tokens unwrapped are provided to beneficiary

Parameters

NameTypeDescription
inputstruct IWrapper.BeneficiaryPartiallyUnwrapAssetsInputThe input of the function. (Struct is described above)

beneficiaryFullyUnwrapAssets

function beneficiaryFullyUnwrapAssets(uint256 nftId, address beneficiary) public

Fully unwrap assets from an already existing ERC721 token, where beneficiary receives the unwrapped assets

Parameters

NameTypeDescription
nftIduint256The id of the existing ERC721 token
beneficiaryaddressThe address that receives the unwrapped assets

execute

function execute(uint256 nftId, address token, bytes input) external payable

Function for executing transactions on wrapped assets

Parameters

NameTypeDescription
nftIduint256The id of the ERC721 token
tokenaddressThe address of the token to execute transactions for
inputbytesInput needed for the transaction execution

_wrapERC20

function _wrapERC20(uint256 nftId, contract IERC20 token, uint256 value, address beneficiary) internal

Wrap ERC20 tokens.

Parameters

NameTypeDescription
nftIduint256
tokencontract IERC20Token to wrap.
valueuint256Amount of token to wrap.
beneficiaryaddressThe address to acquire the tokens from.

_wrapERC721

function _wrapERC721(uint256 nftId, contract IERC721 token, uint256 id, address beneficiary) internal

_wrapERC1155

function _wrapERC1155(uint256 nftId, contract IERC1155 token, uint256 id, uint256 value, address beneficiary) internal

_unwrapERC20

function _unwrapERC20(uint256 nftId, address token, address beneficiary, uint256 value) internal

Unwrap previously wrapped ERC20 tokens

_unwrapERC721

function _unwrapERC721(uint256 nftId, address token, address beneficiary, uint256 id) internal

_unwrapERC1155

function _unwrapERC1155(uint256 nftId, address token, address beneficiary, uint256 id, uint256 value) internal

_unwrapERC1155Batch

function _unwrapERC1155Batch(uint256 nftId, address token, address beneficiary, uint256[] ids, uint256[] values) internal

_deployVault

function _deployVault(address _vaultFactory, bytes32 salt) internal returns (contract IVault)

_vaultTransferERC20

function _vaultTransferERC20(uint256 nftId, address token, address to, uint256 value) internal

_vaultTransferERC721

function _vaultTransferERC721(uint256 nftId, address token, address to, uint256 id) internal

_vaultTransferERC1155

function _vaultTransferERC1155(uint256 nftId, address token, address to, uint256 id, uint256 value) internal

_vaultBatchTransferERC1155

function _vaultBatchTransferERC1155(uint256 nftId, address token, address to, uint256[] ids, uint256[] values) internal

_checkIfSupportedPercentageType

function _checkIfSupportedPercentageType(enum IWrapper.WrappedObjectType wrappedObjectType) internal pure returns (bool)

_createWrappedObject

function _createWrappedObject() internal returns (struct IWrapper.WrappedObject wrappedObject, uint256 wrappedObjectIndex)