ODCinterfacesdataManagers

IWrapper

WrongParameters

error WrongParameters()

Error thrown when the parameters are wrong

InvalidArrayLength

error InvalidArrayLength()

Error thrown when the params length mismatch or are 0

CannotDoubleWrapSameERC20Token

error CannotDoubleWrapSameERC20Token(address token)

CannotDoubleWrapSameERC1155TokenId

error CannotDoubleWrapSameERC1155TokenId(address token, uint256 id)

WrongWrappedType

error WrongWrappedType()

PercentageUnwrapNotSupported

error PercentageUnwrapNotSupported()

OnlyNFTOwnerCanUnwrapOrExecute

error OnlyNFTOwnerCanUnwrapOrExecute()

WrongAssetToUnwrapOrExecute

error WrongAssetToUnwrapOrExecute()

WrongValueToUnwrap

error WrongValueToUnwrap()

NonexistentId

error NonexistentId()

SpenderAlreadyApprovedOrUnapproved

error SpenderAlreadyApprovedOrUnapproved(address spender)

WrongSpender

error WrongSpender(address spender)

ObjectWrapped

event ObjectWrapped(uint256 wid, address from, address beneficiary, address token, uint256 id, uint256 value)

ObjectUnwrapped

event ObjectUnwrapped(uint256 wid, address beneficiary, address token, uint256 id, uint256 value)

SpenderApprovedOrUnapproved

event SpenderApprovedOrUnapproved(address spender, address owner, bool approved)

Executed

event Executed(uint256 nftId, address token, bytes input)

WrappedObjectType

enum WrappedObjectType {
  ERC20,
  ERC721,
  ERC1155
}

ProviderWrapAssetsInput

The input of the providerWrapAssets function

Parameters

NameTypeDescription
struct ProviderWrapAssetsInput {
  enum IWrapper.WrappedObjectType[] wtypes;
  address[] tokens;
  uint256[] ids;
  uint256[] values;
  address provider;
  address beneficiary;
}

ProviderWrapAssetsOnExistingNftInput

The input of the providerWrapAssetsOnExistingNft function

Parameters

NameTypeDescription
struct ProviderWrapAssetsOnExistingNftInput {
  uint256 nftId;
  enum IWrapper.WrappedObjectType[] wtypes;
  address[] tokens;
  uint256[] ids;
  uint256[] values;
  address provider;
}

BeneficiaryPartiallyUnwrapAssetsInput

The input of the beneficiaryPartiallyUnwrapAssets function

Parameters

NameTypeDescription
struct BeneficiaryPartiallyUnwrapAssetsInput {
  uint256 nftId;
  address[] tokens;
  uint256[] ids;
  uint256[] values;
  address beneficiary;
}

WrappedObject

struct WrappedObject {
  enum IWrapper.WrappedObjectType wtype;
  struct EnumerableSet.UintSet ids;
  mapping(uint256 => uint256) values;
}

approveSpenderOfApprovedAssets

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) external 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) external

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) external

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) external

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