Wrapped Rarible:
name -> Rarible item symbol -> iRARIWrapped Parallel:
name -> Parallel item symbol -> iLL
1)Wrapping 3 Zerion (which has no decimals) becomes 3000000000000000000 (3e18) wrapped Item Zerion.2)Wrapping 1 Parallel (which has no decimals) becomes 1000000000000000000 (1e18) wrapped Item Parallel.
To unwrap 1 such Item-wrapped ERC1155, you must burn 1e18. To unwrap 5, you must burn 5e18. If you re-wrap 1 such un-wrapped ERC1155 token, you receive 1e18 wrapped Items. If you re-wrap 5, you receive 5e18.
safeTransferFrom/safeBatchTranfserfFrom
function in order to correctly wrap and unwrap the tokensafeTransferFrom
sending the 1155 token to the Wrapper ERC1155 contract invoking the onERC1155Received
function. data
parameter of the safeTransferFrom
function must contain an encoded value that represents two parameters:Uint256[] values
-> represents the amount of Wrapped item to send to each receiver address. The values must be expressed in 0 decimals (such as 1, 2, 3 and so on) if you're wrapping a 0 decimals ERC1155 or in 18 decimals (1e18,2e18 and so on) if you're wrapping a 18 decimals ERC1155Address[] receivers
-> address receivers of the Deck Item. Pass address(0)
to set receiver as msg.sender
. It can even be an address different from the msg.sender
values []
and receivers[]
length must match .safeBatchTransferFrom
sending multiple 1155 tokens to the Wrapper ERC1155 contract invoking the onERC1155BatchReceived
function. data
parameter of the safeBatchTransferFrom
function must be a bytes[]. Each element of the array must contain the following encoded parameters for each id you're wrapping:Uint256 [] values
Address[] receivers
burn
function can be used to burn any amount of a wrapped ERC1155, and thereby retrieve that amount of the original ERC1155 tokens.address
account
-> represents the address that holds the Item to burn. The address account can correspond to the msg.sender
or not if the burn
function is called from an approved operator
address.uint256
itemId
-> represents the id of the wrapped Item to burnuint256
amount
->represents the wrapped Item amount to burnbytes
data
-> it is an encoded value and represents six parameters: tokenAddress
, the address of the original ERC1155 token to get backtokenId
, the id of the original ERC1155 token to get backreceiver
, the address that will receive the original ERC1155 after the burn. Pass address(0)
to set receiver as msg.sender
. It can even be an address different from the msg.sender
payload
, an optional payload that can be executed with the safeTransferFrom functionsafe
, a boolean value that represents whether safeTransferFrom will be executed (true) or transferFrom/transfer will be executed (false) withData
, a boolean value that represents whether safeTransferFrom will be executed with the additional payload (true) or without one (false). If safe is false, transferFrom without a payload will be executed, regardless of how withData is populated.burnBatch
function can be used to burn multiple wrapped ERC1155 Items amounts and retrieve the relative amounts of the original ERC1155 tokens.uint256[]
itemId
and uint256[]
amount
-> are arrays of values since you can unwrap multiple tokens at oncebytes
data
->The data
parameter in bytes format is an encoded value and represents a bytes[]
(one for each Item involved in the operation) containing the six parameters explained above in the burn section.