{"id":13511356,"url":"https://github.com/second-state/SewUp","last_synced_at":"2025-03-30T20:33:06.504Z","repository":{"id":43635396,"uuid":"366034179","full_name":"second-state/SewUp","owner":"second-state","description":"A library to help you sew up your Ethereum project with Rust and just like develop in a common backend","archived":false,"fork":false,"pushed_at":"2023-09-11T03:57:03.000Z","size":48179,"stargazers_count":52,"open_issues_count":39,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-07T00:28:40.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/second-state.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-05-10T12:25:22.000Z","updated_at":"2024-09-01T20:48:19.000Z","dependencies_parsed_at":"2024-01-13T19:22:22.620Z","dependency_job_id":"63190456-f986-4e41-bbea-ca103f3515f0","html_url":"https://github.com/second-state/SewUp","commit_stats":{"total_commits":252,"total_committers":3,"mean_commits":84.0,"dds":0.007936507936507908,"last_synced_commit":"075b64c9986941a5a68878762b3d357a992cb4f0"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSewUp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSewUp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSewUp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2FSewUp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/second-state","download_url":"https://codeload.github.com/second-state/SewUp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222581260,"owners_count":17006321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T03:00:48.192Z","updated_at":"2024-11-01T13:30:50.540Z","avatar_url":"https://github.com/second-state.png","language":"Rust","funding_links":[],"categories":["Dapps","Rust"],"sub_categories":[],"readme":"# SewUp\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/second-state/SewUp/CI)\n[![Generic badge](https://img.shields.io/badge/sewup-0.1.14-green.svg)](https://crates.io/crates/sewup)\n[![Generic badge](https://img.shields.io/badge/SewUpDoc-main-green.svg)](https://second-state.github.io/SewUp/sewup/)\n[![Generic badge](https://img.shields.io/badge/sewup_derive-0.1.14-green.svg)](https://crates.io/crates/sewup-derive)\n[![Generic badge](https://img.shields.io/badge/SewUpDeriveDoc-main-green.svg)](https://second-state.github.io/SewUp/sewup_derive/)\n[![Generic badge](https://img.shields.io/badge/cargo_sewup-0.1.14-green.svg)](https://crates.io/crates/cargo-sewup)\n\n**S**econdstate **EW**asm **U**tility **P**rogram, a library helps you sew up your Ethereum project with Rust and just like development in a common backend.\nSewup is a blockchain Rust contract framwork base on ethereum webassembly, and suitable for any ethereum wabassembly blockchain.\nIf you have question about Rust contract framework, and about the different between these, you can check out this wiki page of [contract framework](https://github.com/second-state/SewUp/wiki/Contract-Framework).\nThere is an [issue](https://github.com/second-state/SewUp/issues/116) on building document on Doc.rs, please kindly use the [document](https://second-state.github.io/SewUp/sewup/) of master instead.\nFurthermore, there is also [wiki site](https://github.com/second-state/SewUp/wiki) helps you work with sewup, once you got problems or confusing you can learn more on the wiki.\n\n## Slides \u0026 Demo\n| Date       | Event                   | Version | Slide        | Video                                                 | Material                  |\n|------------|-------------------------|---------|--------------|-------------------------------------------------------|---------------------------|\n| 2021/12/03 | ParaState Hackathon IV  | 0.1.9   | [hackthon4]  |                                                       | [todo app]                |\n| 2021/11/12 | ParaState Hackathon III | 0.1.7   | [hackthon3]  |                                                       | [utility token]           |\n| 2021/11/3  | ParaState Hackathon II  | 0.1.6   | [hackthon2]  | [record2]                                             | [material][h2], [hangman] |\n| 2021/10/30 | COSCon'21               | 0.1.4   | [coscon21]   |                                                       |                           |\n| 2021/10/26 | ParaState Hackathon     | 0.1.4   | [hackthon1]  | [record1]                                             | [material][h1]            |\n| 2021/09/07 | Version 0.1 release     | 0.1.0   |              | [Hello], [KV], [RDB], [ERC-20], [ERC-721], [ERC-1155] |                           |\n| 2021/06/19 | Rust meetup (Beijing)   | 0.0.1   | [prerelease] |                                                       |                           |\n\n[coscon21]: https://slides.com/yanganto/coscon21-writing-ewasm-contract-in-rust\n[hackthon1]: https://slides.com/yanganto/ethereum-wasm-in-rust\n[hackthon2]: https://slides.com/yanganto/key-value-storage-with-sewup\n[hackthon3]: https://slides.com/yanganto/writing-ethereum-webassembly-in-rust-iii-utility-token-with-sewup\n[hackthon4]: https://slides.com/yanganto/writing-ethereum-webassembly-in-rust-iv-todo-app-with-sewup\n[record1]: https://www.youtube.com/watch?v=DaVg5WCM2LI\n[record2]: https://youtu.be/XWeOALFPJQ0\n[prerelease]: https://slides.com/yanganto/sewup\n[Hello]: https://youtu.be/kbe3uuxkBNQ\n[KV]: https://youtu.be/LUpYIFGG36s\n[RDB]: https://youtu.be/sJLOcJRheIw\n[ERC-20]: https://youtu.be/sVGEuNBY1dc\n[ERC-721]: https://youtu.be/ivZIqnhOAfA\n[ERC-1155]: https://youtu.be/BsbAFT5rNGw\n[h1]: https://docs.google.com/document/d/1CTh3whx7jRtO4UQLqkp6S8w0fthVVHaDlhgfkAdDp8Q/edit?usp=sharing\n[h2]: https://docs.google.com/document/d/1qNYOFK1uCZauAJ0ghBc_ykI4RDYncdB0hiQULj5kNow/edit?usp=sharing\n[hangman]: https://github.com/second-state/sewup-kv-example\n[utility token]: https://github.com/second-state/sewup-token-example\n[todo app]: https://github.com/second-state/sewup-rdb-example\n\n## Usage\nAdd `sewup` with the features and the `sewup-derive` into Cargo.toml, and setup other sections\nas following, then you are ready to build contract with sewup.\n\nFeatures list (should select none or one of following)\n- kv - for writing contract as key value database withb bucket partition\n- rdb - for writing contract as relational database\n- token - for writing ERC-20, ERC-721, ERC-1155 tokens\n- single-bucket(working in process) - for the storage without bucket partition\n\nBeside, we suggest you using `anyhow` to handle your result and error, but not limited to,\nif you want to use other error crate please checkout `#[ewasm_main(rusty)]` and learn more.\nIf you want to write a contract return different type of data base on different handlers,\nplease checkout `#[ewasm_main(auto)]` and `EwasmAny` or the example of rdb feature to learn\nhow to write a flexible smart contract with ewasm.\n\n### Develop\nIt is easy to setup your sewup project with cargo-sewup with following commands.\n- `cargo install cargo-sewup`\n- `cargo sewup init`\nYou can use `-m \u003crusty|auto\u003e` option to initialize different type of sewup project,\nand you can learn more about the project configure\nfrom the doc of [ewasm\\_main!](https://second-state.github.io/SewUp/sewup_derive/attr.ewasm_main.html)\nand the wiki page of [Deploy Guide](https://github.com/second-state/SewUp/wiki/Develop-Guide).\n\n### Interact\nThere are so many clients can interact with contract.\n\nFor ERC tokens, we provide `web3js` examples in [wiki page](https://github.com/second-state/SewUp/wiki/ERC-Testing).\nThe example of clients interacting with contract with [kv](https://github.com/second-state/SewUp/blob/main/examples/kv-contract/src/client.rs) or [rdb](https://github.com/second-state/SewUp/blob/main/examples/rdb-contract/src/client.rs) features.\nYou can in the example projects for kv and rdb, then `Cargo run` to interact with the contract after modified the contract address.\n\n### Testing\nRun `cargo build --release --target=wasm32-unknown-unknown`, then the contract will build in `target/wasm32-unknown-unknown/release/*.wasm`\nBesides, you can run deploy the ewasm contract on [WasmEdge](https://github.com/WasmEdge/WasmEdge) and run tests on it with `cargo test`,\nfurthermore the constructor will also run when the contract deploying on [WasmEdge](https://github.com/WasmEdge/WasmEdge).\nIf you want to learn more details about the testing flow, please check out [Test the contract](https://github.com/second-state/SewUp/wiki/Develop-Guide#test-the-contract) section of develop guide wiki page.\n\n\n### Debugging\nFurthermore, you can debug your ewasm contract with debug macro `sewup::ewasm_dbg!`.\nBesides, it easy to know the exactly detail of storage with `ewasm_storage_debug!`.\nAnd all these debug method should run test of the contract with message output by `cargo test -- --nocapture`.\nTo learn more about the usage, you check out the examples in the [example](./examples/) folder.\n\n### Deployment\nOnce you want to deploy your contract to any network which support Ewasm by sweup command line tool, please read the [Deploy Guide](https://github.com/second-state/SewUp/wiki/Deploy-Guide) wiki page.\n\n## SewUp Development\nThere are two projects and several examples in the workspace, the contract project should build with target\n`wasm32-unknown-unknown` and the flag `-C link-arg=--export-table`.\nYou can run `cargo test` in each example folder to check on the test your modification.\n\nIt is easy to participate with [help want issues](https://github.com/second-state/SewUp/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) and the [good first issues](https://github.com/second-state/SewUp/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).\nLess but not least, please feel free to open any issue on this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2FSewUp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecond-state%2FSewUp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2FSewUp/lists"}