Redeem x2/x5 WUSD Notes
Redeeming (burning) a note allows you to mint the amount of WUSD denoted by the note's ticker.
To redeem WUSD note tokens (x2/x5), use the safeTransferFrom
or safeBatchTransferFrom
method directly from the WUSD Token Collection itself to the WUSDNoteController x2 and WUSDNoteController x5 contracts, as follows:
from
-> senderaddress
to
-> WUSDNoteController x2address
or x5address
objectId/s
-> WUSD note x2 object Id or x5 object Idamount/s
-> WUSD note amount to redeem, or an array containing the amounts in case ofsafeBatchTransferFrom
data
-> 0, nopayload
is needed
The onERC1155Received/onERC1155BatchReceived
function takes care of burning the WUSD note amount that arrives to the WUSDNoteController contract, calling the native collection's burn method:
burnBatch
in case of safeBatchTransferFrom
and so onERC1155BatchReceived
and then transfers the amount of WUSD minted via the redeeming of the WUSD notes to the receiver. The amount to send is calculated as value * multiplier
, where value is the amount of WUSD notes sent through the safeTransferFrom
or safeBatchTransferFrom
to the WUSDNoteController, and multiplier is equal to "2" in the case of WUSD note x2, or "5" in the case of WUSD note x5.
Last updated