-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trait for minting NFT's with any FT and STX using unified interface #60
Comments
@LNow Yes, please! That is a good proposal. We should also add standard error codes for
I would like to move from sip-10 to sip-transferable (#52) For wrapped stx
I suggest to not include stx minting here but define |
Can this approach work with Arkadikos or ALEX's wrapped bitcoin as in SP3DX3H4FEYZJZ586MFBS25ZW3HZDMEW92260R2PR.Wrapped-Bitcoin SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.token-wbtc ? |
Does this suggestion also impact sip-0013 ? |
What do you mean when you say
With regards to wSTX name, I'm not attached to it. We can change it to STX-FT or anything else.
The key concept of this idea is to not have separate function for ustx or anything else. Instead of implementing different logic for STX, and different for FT you'll have just one. Example: https://github.com/LNow/clarity-projects/blob/2163db81b9286f0c30b00dd7728fb0e93dfc6243/contracts/tokens/mintable-nft-token.clar#L42-L59 One function to rule them all |
@radicleart that's the thing - it will work with any fungible token that is compliant with SIP-010. Citycoins, USDA, DIKO, Nothing, wbtc, xbtc, wrapped-bitcoin, ANY.
Sure, why not. |
@LNow i think most people (me for sure, stxnft i believe) are following this for the commission since crash punks
which could be generalised to...
and the listing and buying methods also need to be generalised...
to
likewise for the buy-in-ustx ? |
@radicleart Yes, generalized version of #51 would look like you described it. |
@LNow so is the answer to @friedger on this point?
that at this line
the Hence only one function needed for both transfer types in the main contract? |
Yes |
How do you build post conditions for these txs if they can transfer either STXs or FTs? |
The same way Alex/Arkadiko/Stackswaps are doing it. Based on token address user picked on the UI. With one additional if statement. |
Great idea. Is there a way to allow for flexibility in payment schedule? When the Jellyboo NFT project was launched, it featured a pay-what-you-want model to mint (with a set minimum). The standard would be a lot more flexibility if you can set a price per NFT in |
…r dao and create and swap fungible tokens. Ultimate goal is to address the unified interface for NFT stacksgov/sips#60
@MarvinJanssen something like this? (define-public (mint-with (tender <sip-010-trait>) (customPrice (optional uint)))
(let
(
(pricing (unwrap! (map-get? TenderPricing (contract-of tender)) ERR_UNKNOWN_TENDER))
(price (match customPrice price (max price (get price pricing)) (get price pricing)))
;; remaining local variables
)
;; minting operations
(ok true)
)
)
(define-private (max (a uint) (b uint))
(if (> a b) a b)
) or (define-public (mint-with (tender <sip-010-trait>) (customPrice uint))
(let
(
(pricing (unwrap! (map-get? TenderPricing (contract-of tender)) ERR_UNKNOWN_TENDER))
(price (max customPrice (get price pricing)))
;; remaining local variables
)
;; minting operations
(ok true)
)
)
(define-private (max (a uint) (b uint))
(if (> a b) a b)
) with extra function that returns price if it has been set: (define-read-only (get-mint-price-in (tender <sip-010-trait>))
(get price (map-get? TenderPricing (contract-of tender)))
) |
I LOVE IT! |
We could even extend it to tradables which would include nfts |
Started on this here @friedger - see list-in-token and buy-in-token ? |
As the ecosystem grows we see more and more NFT contracts that can be minted not only with plain STX but also with different FT (ie. CityCoins). Each have a slightly different function name and signature. I think we can do better.
There should be a trait that defines unified interface which can be used to mint new NFT with STX and any SIP-010 compliant FT. Such trait could look like this:
And to make it work also for STX we could define global wrapped STX SIP-010 compliant FT that is not issuing new token, but uses plain STX:
Very similar approach can be used by NFT marketplaces to define unified interface for listing/buying NFTs for STX and any SIP-010 compliant FT.
@Jamil @friedger @dantrevino @MarvinJanssen @radicleart
The text was updated successfully, but these errors were encountered: