public-awesome / cw-nfts

Examples and helpers to build NFT contracts on CosmWasm
Apache License 2.0
188 stars 180 forks source link

`cw721-sylvia-base` #127

Open JakeHartnell opened 1 year ago

JakeHartnell commented 1 year ago

Adds a similar contract to cw721-base but written with the Sylvia smart contract framework.

There are a few advantages to Sylvia over the extension based pattern we currently have:

Have some open questions which I would love folks thoughts on if they have them:

Closes #31 hopefully someday :crossed_fingers:

the-frey commented 1 year ago

Top line thought: this is useful to have in the repo. If Sylvia becomes more widely adopted, we should begin to provide a 'paved path'. If it doesn't, then it's either still useful documentation for somebody, or could be hypothetically removed later (although, personally once something is in, I think we should maintain it, see below).

Do we still want to support extensions at all for token metadata? Or do we just kill them? (personally leaning towards the later)

Depending on the effort to do so, yes, because they are widely in production and it's probably better to offer alternatives rather than hard deprecate a given pattern.

How should we organize this codebase? Took a stab based on some Sylvia examples, but open to suggestions.

No strong thoughts on this one as don't personally use Sylvia.

As we move forward, should we focus more on a Sylvia based approach? Or stick with the extension pattern we have (which is already well used).

I guess as referred to in my first response I think folks that want to focus on Sylvia can put those contracts here so that other people can use them, but if people don't want to use Sylvia, then that's valid. Any framework usually has some drawbacks WRT flexibility and from my understanding the same is true here.

There's another question of whether it's more approachable to beginners. My guess would be no, as there's a bit more upfront type stuff to parse in exchange for simpler definitions of data, but could be wrong about that!

JakeHartnell commented 1 year ago

Added more tests, coverage should be decent by now. Will add a template for a basic sylvia cw721 contract after this is reviewed.