|new 0.1.2||Sep 22, 2021|
|0.1.1||Sep 14, 2021|
|0.0.11||Aug 27, 2021|
|0.0.6||Jul 23, 2021|
|0.0.2||Jun 22, 2021|
#489 in Procedural macros
204 downloads per month
Used in sewup
Secondstate EWasm Utility Program, a library helps you sew up your Ethereum project with Rust and just like development in a common backend. There is an issue on building document on Doc.rs, please kindly use the document of master instead. Furthermore, there is also wiki site helps you work with sewup, once you got problems or confusing you can learn more on the wiki.
|Date||Event||Slides / Demo video|
|2021/09/07||Version 0.1 release||Hello, KV, RDB, ERC-20, ERC-721, ERC-1155|
|2021/06/22||Rust online meetup||v0.0.2|
|2021/06/19||Rust meetup (Beijing)||v0.0.1-pre|
sewup with the features and the
sewup-derive into Cargo.toml, and setup other sections
as following, then you are ready to build contract with sewup.
Features list (should select none or one of following)
- kv - for writing contract as key value database
- rdb - for writing contract as relational database
- token - for writing ERC-20, ERC-721, ERC-1155 tokens
Beside, we suggest you using
anyhow to handle your result and error, but not limited to,
if you want to use other error crate please checkout
#[ewasm_main(rusty)] and learn more.
If you want to write a contract return different type of data base on different handlers,
EwasmAny or the example of rdb feature to learn
how to write a flexible smart contract with ewasm.
It is easy to setup your sewup project with
cargo-sewup init, and you can learn more about the project configure with the Deploy Guide wiki page.
There are so many clients can interact with contract.
For ERC tokens, we provide
web3js examples in wiki page.
The example of clients interacting with contract with kv or rdb features.
You can in the example projects for kv and rdb, then
Cargo run to interact with the contract after modified the contract address.
cargo build --release --target=wasm32-unknown-unknown, then the contract will build in
Besides, you can run deploy the ewasm contract on WasmEdge and run tests on it with
furthermore the constructor will also run when the contract deploying on WasmEdge.
If you want to learn more details about the testing flow, please check out Test the contract section of develop guide wiki page.
Furthermore, you can debug your ewasm contract with debug macro
sewup::ewasm_dbg!, and run the contract with message output by
cargo test -- --nocapture.
To learn more about the usage, you check out the examples in the example folder.
Once you want to deploy your contract to any network which support Ewasm by sweup command line tool, please read the Deploy Guide wiki page.
There are two projects and several examples in the workspace, the contract project should build with target
wasm32-unknown-unknown and the flag
You can run
cargo test in each example folder to check on the test your modification.