stacksgov / sips

Community-submitted Stacks Improvement Proposals (SIPs)
131 stars 80 forks source link

Create SIP for transferrable assets #35

Closed friedger closed 2 years ago

friedger commented 2 years ago

There should a trait for digital assets that are transferable. The trait should work for the two native fungible and non-fungible assets. It should be some kind the smallest common denominator between NFTs (sip-9 like assets) and FTs (sip-10 like assets).

MarvinJanssen commented 2 years ago

Here is another example where things are made more difficult by the incompatibility of SIP009 and SIP010.

https://github.com/MarvinJanssen/stx-atomic-swap/blob/master/stx/contracts/sip009-sip010-htlc.clar

Edit:

And a transferable-trait for reference.

(define-trait transferable-trait
    (
        (transfer (uint principal principal) (response bool uint))
    )
)
friedger commented 2 years ago

Native nfts and fts are incompatible by nature because the further are transferred by identifier, the latter by amount. However, for NFTs that use a uint as identifier, the same method signature for transfer can be used as FTs.

MarvinJanssen commented 2 years ago

Sure, but in the case of SIP009 and SIP010 the above used to work which is pretty powerful. It is not out of the ordinary to represent either an amount or a token ID in a single uint.

friedger commented 2 years ago

Closing this in favor of #52