Can we add an extension to xUDT that locks CKB in proportional to xUDT amount?

In other smart contract platform, there are usually extensions to the base token contract, e.g. ERC-20 has permit extension that enables gasless approval, Cosmos CW20 has CW20-ICS that enables IBC transfer. In Nervos, can we have a xUDT example that does similar things?

An example I find interesting is an extension that requires CKB locked in the cell in proportional to the xUDT amount in the cell. Spore NFT has this property naturally, since each cell can only holds 1 Spore NFT(I believe so, right?). By having this extension, we achieve similar outcome that each xUDT always backed by certain amount of CKB.

When users are minting the first inscription MEME (which is an xUDT) on Omiga, I roughly remember some power users used scripts to be able to merge mint MEME, effectively bypassed the mint fee set on Omiga frrontend. If Omiga used this script, it would have prevented that.

3 Likes

Can we add an extension to xUDT that locks CKB in proportional to xUDT amount?

Yes, this is completely possible. You could also add a configurable ratio for the requirement of the CKB amount to the token amount. ie: 1:1, 2:1, 1:10

Interestingly, this would enable a fungible token to have tokenomics which have similar properties to Spore, and it would guarantee a floor price for the token.

3 Likes

Yes that’s the idea, can you point me to some code that I can play with? I think the current xUDT code is written in c? That’s too beginner unfriendly, if it’s in rust i can try to understand it, but c is out of my league

1 Like

here is a tutorial about xudt, it does look like all is in C though unfortunately

2 Likes