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)

Wrap multiple ERC1155, ERC721, ERC20 tokens into a single wrapped NFT.

Parameters

NameTypeDescription
wrappedContentsITokenBundle.Token[]The tokens to wrap.
uriForWrappedTokenstringThe metadata URI for the wrapped NFT.
recipientaddressThe recipient of the wrapped NFT.

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