-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Lumos should add for XUDT
testnet
both reference by type
, which is already included and data1
.
See:
- Discussion about the
hash_type
of xUDT script on testnet nervosnetwork/ckb-explorer#2072 - [0052] Extensible UDT nervosnetwork/rfcs#428 (comment)
I just noticed now that Lumos only included the reference by type
and not data1
in testnet, the one I assumed it was used. I kid you not, this caused for iCKB quite a mess that I unraveled just a few hours ago.
Lumos references XUDT by type
on testnet, while my wrong understanding was that it was referenced by data1
in predefined aggron. My bad. Also the iCKB script assumes reference by data1
, not type
. Which is okay if the Transaction is set up in the correct way. This means that iCKB XUDT was minted because the receipt existed, but the iCKB XUDT minted (type
as predefined by Lumos) was not the one recognized by ICKB script (data1
). So basically the Receipt was always fully burned. And a different not compatible not redeemable ICKB XUDT was minted.
By the way for quite some time I was wondering if it was better to change:
if in_udt_ickb + in_receipts_ickb < out_udt_ickb + in_deposits_ickb {
return Err(Error::AmountMismatch);
}
Into:
if in_udt_ickb + in_receipts_ickb != out_udt_ickb + in_deposits_ickb {
return Err(Error::AmountMismatch);
}
to avoid accidental burn and actually it would have prevented this whole mess!! 🤦♂️🤣🤣
At any rate, to prevent future tales like mine, please also add a second xUDT entry, with a different name. For example @Keith-CY added xUDT(final_rls).
Additionally iCKB will always reference xUDT by data1
, which is a completely different token from one referenced by type
, as this tale shows.
Keep up the great work 💪
Phroi