clarity-lang / book

Clarity of Mind is both an introductory as well as a reference book for the Clarity smart contract language.
http://book.clarity-lang.org
Creative Commons Attribution Share Alike 4.0 International
70 stars 49 forks source link

NFT Example from book is not complete/accurate #9

Open gurugeek opened 2 years ago

gurugeek commented 2 years ago

the example at https://github.com/clarity-lang/book/blob/main/projects/sip009-nft/contracts/marvin-token.clar for instance

(define-read-only (get-token-uri (token-id uint))
    (ok none)
)

This will essentially show no image, so by definition is not a valid NTF. I assume that this should be changed to something like


(define-read-only (get-token-uri (token-id uint))

    (ok (some "https://....../{id}.json"))
)

or something similar with an IPFS address if one prefers to use that.

I think that Stacks looks very interesting and has a lot of potential but the only two tutorials available online are the one of this book and the one from hiro.so that is also wrong (doesn't provide with a viable example of a token to be minted only by the owner).

I really think that having a clear and updated NFT contract tutorial is absolutely crucial.

friedger commented 6 months ago

I'd say that NFT tutorials with all business, art, etc aspects are out of scope of this book.