SecretNetwork
SecretNetwork copied to clipboard
Secret contract code catalogue
Secret contract code catalogue is a repository for sample contracts to be used by developers to improve on-boarding / coding experience. Probably best documented Developer section of the build.scrt.network page
To-do's:
- [ ] Understand the status of internal hackathon projects and what it takes them to get them in sharable form
- [ ] Get Taariq to contribute with secret voting demo
Any secret contract with half-decent docs can be included in this catalog. I was thinking to start with very small contract, e.g.:
- A contract that can only set or get a string from the same key in its storage (storage usage)
- A contract that receives funds
- A contract that sends funds
- A contract that dispatches callbacks to other contracts
- A contract that dispatches callbacks that instantiates a new contract
- A contract that queries other contracts mid-execution (external query) and uses the answer
- A contract with access control (register + use passwords maybe, like how I implemented getting your hand in poker)
- A contract with CSPRNG usage (get seeds from users like I did on the poker demo)
- Maybe a simple GUI for each of these contracts
- Minimal but decent docs for each of these contracts
- How to compile + optimize + minimize
- How to track down floating point usage (forbidden on-chain as it's not deterministic)
- How to upload to the chain
- How to instantiate on-chian
- Ho to execute and query on-chain
And on top of that we can include links to the hackathon contracts (battlesheep, lottery, secret-secret, poker) and to Taariq's voting demo for more advanced examples, though the hackathon contract are quite a mess because we didn't have much time to polish the code and focused more on finishing before the deadline.
Anyway I do believe all of this is not a lot of work and I hope to get to it very soon.
Also:
- Writing unit test for contracts
- Debugging contracts (if possible)
Also for each contract:
- How to deploy to testnet
- Hot to init/execute/query on testnet
This is still WIP, maybe we can work with someone from the development committee to put this together. What contracts exist at the moment to go into this catalog? cc @assafmo