Question, the two functions "define-non-fungible-token" and "define-trait" are unrelated... right? The function "define-non-fungible-token" is used to create an NFT. While the function "define-trait" is used so that another contract can utilize that "trait" via dependency in the .toml file.
Can the function "define-non-fungible token" be used within the "define-trait" function? If so the snippet with "define-n-f-t" would have to come after "define-trait" right
define-trait
allows you to define a set of public functions that any contract which complies to this trait must have. And by public I mean function defined withdefine-public
and functions defined with define-read-only that returns result type.Here's a good walkthrough of traits: https://book.clarity-lang.org/ch09-00-traits.html
define-non-fungible-token
is a built-in function that can't be called from the outside world. It is also a top-level function that does not return anything. Because of that you shouldn't use it in your trait definition.It is only used to define a new NFT.