Stacks JS- Add how-to guide for post conditions
This issue is created based on @hugocaillard's findings to add a how-to guide for Post conditions.
Reference: https://dev.to/stacks/understanding-stacks-post-conditions-e65Z
@hugocaillard Please add your thoughts and inputs to this issue.
Writing PCs (post conditions) can be difficult. Not because the code is hard to write, but because it's hard for developers to understand what they are trying to achieve with PCs (beyond "make transactions safe for users").
The only resources for that are unofficial, unmaintained, outdated and/or misleading (article by Kenny, misleading doc on hiro.so).
I think we need one or two resources (blog post and doc maybe) to explain to main aspects:
- what are PCs, what can we do with it, why is it important?
- use cases references (kind of the go to doc when trying to write a PC) with real world use case
- transfer STX / FT to a contract or an address
- mint an NFT
- transfer an NFT to a contract or an address
- ...
Note: some improvement might occurs on Stacks.js in the coming week, so the work on docs should reflect that (cc @janniks )
Yes, a comprehensive library of all the available post conditions and some example implementations would be huge.
We have a blog. Need to pull the content from there to include in the docs.
I couldn't find a blog post, can you share the link @LakshmiLavanyaKasturi?
@sabbyanandan, I remember you mentioned a blog somewhere about Post conditions. Can you please help post the link here? Thanks!
Just a little something I wrote regarding contracts with a single token or NFT. The syntax for Post-conditions is designed for contracts that contain any number of tokens or NFTs, therefore for a singl-token contract there is some redundancy in the syntax, which can be confusing at first.
https://discord.com/channels/621759717756370964/623217767356694547/1138651620314451969
On Thu, Sep 7, 2023 at 7:39 AM Lavanya Kasturi @.***> wrote:
@sabbyanandan https://github.com/sabbyanandan, I remember you mentioned a blog somewhere about Post conditions. Can you please help post the link here? Thanks!
— Reply to this email directly, view it on GitHub https://github.com/hirosystems/docs/issues/331#issuecomment-1709999931, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHJDL6GGLHPRGK4IX32TC3XZGW7VANCNFSM6AAAAAAWECKVIU . You are receiving this because you commented.Message ID: @.***>
-- Justin Enjo +1.619.869.3336 (mobile)
closing: https://docs.hiro.so/stacks/stacks.js/guides/post-conditions