Skip to main content

IMultiwrap

Thirdweb's Multiwrap contract lets you wrap arbitrary ERC20, ERC721 and ERC1155 tokens you own into a single wrapped token / NFT. A wrapped NFT can be unwrapped i.e. burned in exchange for its underlying contents.

Methods

unwrap

function unwrap(uint256 tokenId, address recipient) external nonpayable

Unwrap a wrapped NFT to retrieve underlying ERC1155, ERC721, ERC20 tokens.

Parameters

NameTypeDescription
tokenIduint256The token Id of the wrapped NFT to unwrap.
recipientaddressThe recipient of the underlying ERC1155, ERC721, ERC20 tokens of the wrapped NFT.

wrap

function wrap(ITokenBundle.Token[] wrappedContents, string uriForWrappedToken, address recipient) external payable returns (uint256 tokenId)

Parameters

NameTypeDescription
wrappedContentsITokenBundle.Token[]undefined
uriForWrappedTokenstringundefined
recipientaddressundefined

Returns

NameTypeDescription
tokenIduint256undefined

Events

TokensUnwrapped

event TokensUnwrapped(address indexed unwrapper, address indexed recipientOfWrappedContents, uint256 indexed tokenIdOfWrappedToken)

Emitted when tokens are unwrapped.

Parameters

NameTypeDescription
unwrapper indexedaddressundefined
recipientOfWrappedContents indexedaddressundefined
tokenIdOfWrappedToken indexeduint256undefined

TokensWrapped

event TokensWrapped(address indexed wrapper, address indexed recipientOfWrappedToken, uint256 indexed tokenIdOfWrappedToken, ITokenBundle.Token[] wrappedContents)

Emitted when tokens are wrapped.

Parameters

NameTypeDescription
wrapper indexedaddressundefined
recipientOfWrappedToken indexedaddressundefined
tokenIdOfWrappedToken indexeduint256undefined
wrappedContentsITokenBundle.Token[]undefined