CosmWasm / cw-template

Quickstart template to get started writing your own cosmwasm contracts
Apache License 2.0
287 stars 172 forks source link

Leaner template #96

Closed the-frey closed 2 years ago

the-frey commented 2 years ago

Hey folks, we've been writing a lot of smart contracts with this template over the last week, and we've really noticed that there's a lot going on in the template that we are removing every time.

It would be good to make a much leaner version that is only exposing the entrypoints and basic file structure with errors and whatnot.

Opening this as a starting point for discussion 🙂 hopefully other devs can chime in with what a minimal template would look like to them.

JakeHartnell commented 2 years ago

Second this! When I start a new contract I have to spend like 5-10 minutes deleting stuff. A more minimal template would be awesome.

elitelephant commented 2 years ago

Yes it will be fantastic!

elitelephant commented 2 years ago

Is this somehow related to Terra Bites, getting a Template Terra Contract video made on April and today's Stable Kwon? Because it's called my attention, while trying to solve the problem that Stable Knon propose as a "entry exam" to work with him and his team. I thought they probably the best place to star, learning how to deploy a smart contract and the tools needed to do so would be Terra Bites series Terra Basic Development. While I was progressing through the videos, and trying and more important adding what wasn't really show on camera but said and solving the inconvenience found in that previous task to make the token and solve the "public task". When I start watching this and having connect WSL2, it really call my attention that we were using "rust up default stable" considering that Terra was originally built by Stable Know. Instead of keep going into creating the token, I focused on what you left "between lines" and the comments of Terra Bites développer, who laughs when mentioning that in the future, Terra was going to be updated to Colombus 5 and that the Terra smart contract sample was going to be on 1.3 instead of 1.0 and also the way he conjugate the verbs was really strange or appealing that what we were doing wasn't really what was happening. The following hours I tried to solve that puzzle but I don't know if there was actually a puzzle, because it don't what was supposed to really happen. In addition to the way he conjugate, refer to the contract also we use "rustup default stable" and the result is something on "unknown domain". So it was really funny to watch the videos but I didn't get to the solution until know that I turned of my computer. Could we eliminate this problem, bug or thing that shouldn't be happening by eliminating "stable" of the option or things that can follow default as we "reset" / set rustup to "default" and then we add "stable". Somehow we invalidate the first instructions with the second and that should be happening really. Also : Was I talking with someone while trying different thing on the console?

webmaster128 commented 2 years ago

I think there is value in having a populated template that shows how to do a few basic things. What about an optional argument like --empty true that removes all the code using the tempate engine of cargo-generate?

ethanfrey commented 2 years ago

@stgoreyes This has nothing to do with Terra.

Confio built CosmWasm contract engine. Terra built on top of it and forked almost all the tooling. They should give support on their tutorials. They also have a very non-standard runtime (rather than use wasmd, they change much of the Go code), and do not support compatibility with standard Cosmos ecosystem tooling like Keplr and CosmJS, so we are unable to even provide support as we don't know their tooling.

elitelephant commented 2 years ago

Please wait, I will develop my thought on this problem and send them to @.*** In a .txt document create on visual studio but based on something that came from my mind that is personnal

El mar, 16 nov 2021 a las 11:05, Ethan Frey @.***>) escribió:

@stgoreyes https://github.com/stgoreyes This has nothing to do with Terra.

Confio built CosmWasm contract engine. Terra built on top of it and forked almost all the tooling. They should give support on their tutorials. They also have a very non-standard runtime (rather than use wasmd, they change much of the Go code), and do not support compatibility with standard Cosmos ecosystem tooling like Keplr and CosmJS, so we are unable to even provide support as we don't know their tooling.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CosmWasm/cw-template/issues/96#issuecomment-970112776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYEQFWWMR77EM2R3E7CKX3UMIUFTANCNFSM5H2VJHYQ .

-- Santiago Reyes

webmaster128 commented 2 years ago

Aha. Could you please avoid email replies to GitHub issues? Nobody understands what the actual message is.

the-frey commented 2 years ago

@webmaster128 I think your suggestion sounds sensible. That would solve our use case in bootstrapping smaller pieces and also mean that people using it for the first time would get the scaffolding :)

elitelephant commented 2 years ago

Can you send me an email from the address were I should send it to? Please :)

El mar, 16 nov 2021 a las 11:22, the-frey @.***>) escribió:

@webmaster128 https://github.com/webmaster128 I think your suggestion sounds sensible. That would solve our use case in bootstrapping smaller pieces and also mean that people using it for the first time would get the scaffolding :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CosmWasm/cw-template/issues/96#issuecomment-970127226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYEQFT6QNARMG3WLGFPRN3UMIWFDANCNFSM5H2VJHYQ .

-- Santiago Reyes

webmaster128 commented 2 years ago

@the-frey would you be willing to give it a shot and open a PR? Let's do one case first to see this is the right direction, like an empty execute implementation.

The CI should run and pass with both empty = false (default) and empty = true. Maybe there is a better name for empty – not sure.

elitelephant commented 2 years ago

Please, I already write my initial though but I don't know where to submit them

El mar, 16 nov 2021 a las 11:05, Ethan Frey @.***>) escribió:

@stgoreyes https://github.com/stgoreyes This has nothing to do with Terra.

Confio built CosmWasm contract engine. Terra built on top of it and forked almost all the tooling. They should give support on their tutorials. They also have a very non-standard runtime (rather than use wasmd, they change much of the Go code), and do not support compatibility with standard Cosmos ecosystem tooling like Keplr and CosmJS, so we are unable to even provide support as we don't know their tooling.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CosmWasm/cw-template/issues/96#issuecomment-970112776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYEQFWWMR77EM2R3E7CKX3UMIUFTANCNFSM5H2VJHYQ .

-- Santiago Reyes

elitelephant commented 2 years ago

And to whom, please sir

El mar, 16 nov 2021 a las 12:23, Santiago Reyes @.***>) escribió:

Please, I already write my initial though but I don't know where to submit them

El mar, 16 nov 2021 a las 11:05, Ethan Frey @.***>) escribió:

@stgoreyes https://github.com/stgoreyes This has nothing to do with Terra.

Confio built CosmWasm contract engine. Terra built on top of it and forked almost all the tooling. They should give support on their tutorials. They also have a very non-standard runtime (rather than use wasmd, they change much of the Go code), and do not support compatibility with standard Cosmos ecosystem tooling like Keplr and CosmJS, so we are unable to even provide support as we don't know their tooling.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CosmWasm/cw-template/issues/96#issuecomment-970112776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYEQFWWMR77EM2R3E7CKX3UMIUFTANCNFSM5H2VJHYQ .

-- Santiago Reyes

-- Santiago Reyes

elitelephant commented 2 years ago

It make a lot of sence, but the real problem with the console. Is that it represent a entry barrier to people not used to it.

elitelephant commented 2 years ago

And, developing the real problem and making the question more complex to make it somehow more understandable

elitelephant commented 2 years ago

In that concern, explaining and developing a good "manual" for using the command line would help user. And in this situation, as a normies non familiarize to the console. I would love to have a clearer answer to my initial / the initial question.

the-frey commented 2 years ago

@webmaster128 maybe lean = false (default) / lean = true? Or minimal? Think maybe minimal would be more descriptive than empty after having thought about it for a minute or two... 🤔

JakeHartnell commented 2 years ago

I think there is value in having a populated template that shows how to do a few basic things. What about an optional argument like --empty true that removes all the code using the tempate engine of cargo-generate?

This would be awesome!

the-frey commented 2 years ago

@JakeHartnell --minimal true WFY?

JakeHartnell commented 2 years ago

@JakeHartnell --minimal true WFY?

Even better.

elitelephant commented 2 years ago

pleaSe be paTient, i will Answer But i am pLanning to Explore the unknown

elitelephant commented 2 years ago

How can I see the new and the old contract to see what changes? I just realized that you told that I was related to Cosmo Wasm, and Cosmos Wasm Organization :)

elitelephant commented 2 years ago

Is the problem, really on the Smart Contract? I think it could be a problem with the instructions given to the console and who executes them. That's why is very important that a developer has to be passionate and curious about what he is doing.

orkunkl commented 2 years ago

I've setup https://github.com/CosmWasm/cw-template/tree/clean-1.0-beta for temporary use.

the-frey commented 2 years ago

Nice! Sorry I've been wall-to-wall with stuff and haven't had a chance to look at this yet >_<

ethanfrey commented 2 years ago

Moved to InterWasm org.

@orkunkl please take this over and feel free to merge you clean-1.0-beta in

elitelephant commented 2 years ago

How can I open a .txt document from the shell ?