Wrapped USDC:
name -> USDC item symbol -> iUSDCWrapped ETH:
name -> Ethereum item symbol -> iETHWrapped DAI:
name -> DAI item symbol -> iDAI
Wrapped Item amount = ERC20 amount*10^(18-ERC20 decimals)
1)If you wrap 1000 USDC (which has 6 decimals), it becomes 1000000000000000 iUSDC.Unwrapping 1000000000000000iUSDC gives you back 1000 USDC.2)If you wrap 350 HEX (which has 8 decimals), it becomes 3500000000000 iHEX.Unwrapping 3500000000000 iHEX gives you back 350 HEX.
struct
CreateItem
-> data for wrapping the ERC20CreateItem
must be passed as follows: struct
Header
-> composed of address
host
, string
name
, string
symbol
and string
uri
pass empty. These parameters are automatically populated by the contract. Look here for more infobytes32
collection
-> encoded ERC20 address of the token being wrapped. Pass 0x000...
for ETH.uint256
id
-> pass emptyaddress[]
accounts
-> address receiver of the Wrapped Item. Pass address(0)
to set receiver as msg.sender
. It can even be an address different from the msg.sender
uint256[]
amounts
-> amounts being wrappedamounts[]
array can specify the different amounts of the created wrapped Item to send to the receivers' addresses represented by the accounts[]
array. Each position of the amounts
array corresponds to the respective position of the accounts
array and so the amounts[]
and accounts[]
arrays must have the same length. If an address in the accounts[]
is passed as address(0)
, it automatically corresponds to the msg.sender
address. amount
(s) value(s) must be expressed in the decimals of the original ERC20 token.mintItems
functions, different ERC20 tokens can be wrapped in a single transaction since you can pass multiple CreateItem
structs.struct
CreateItem
-> data for wrapping the ERC20. Same as the previous mintItems functionbytes[]
permitSignatures ->
it can contain the bytes data representing the permit signature to perform the off-chain sign. If the permitSignatures
is passed as 0x
, the classic on-chain approve
is required.CreateItem
array corresponds to the respective position of the permitSignatures
array and so the CreateItem
and permitSignatures
arrays must have the same length. burn
function can be used to burn a wrapped ERC20/ETH Item amount and retrieve the relative amount of the original ERC20 token or ETH.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 two parameters:receiver
of the original ERC20 token once the Item is burned. Pass address(0)
to set receiver as msg.sender
. It can even be an address different from the msg.sender
:burnBatch
function can be used to burn multiple wrapped ERC20/ETH Items amounts and retrieve the relative amounts of the original ERC20 tokens or ETHs.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: